Skip to navigation

Manage Secret Manager with the IBEE API

The IBEE API manages Secret Manager the way the portal does: enable it for a workspace, list and search secret names, read version history, change a secret’s settings, delete, undelete or destroy versions, and create or revoke app credentials. It never reads or writes a secret value. Values go only over the Vault API at your workspace’s address, with an app credential.

Before you begin

  • An API token with Secret Manager → Read (secret-manager.read) or Edit (secret-manager.write), and your workspace ID.
  • Every call is https://api.ibee.ai/v1/secret-manager/… with workspace_id as a query parameter and Authorization: Bearer <token>. See Authentication.
  • The token acts as the person who created it. Each call checks the token’s scope and that person’s current role in the workspace and, for changes, the organization’s identity verification:
CallsScopeThe token owner’s role
Status, names, search, metadata, historysecret-manager.readAny role with workspace access
Enable, change metadata, version actions, delete a secretsecret-manager.writeOwner, Admin or Technical
export IBEE_TOKEN="ibee_prod_key_xxxxxxxxxxxx.xxxxxxxx"
WS=710995 # your workspace ID
API=https://api.ibee.ai/v1/secret-manager
auth=(-H "Authorization: Bearer $IBEE_TOKEN")

Every operation

Method and pathScopeWhat it does
GET /secret-manager/workspacereadStatus: namespace, state, endpoint, max_versions, site_code
POST /secret-manager/workspace/enablewriteEnable Secret Manager. 202 with an operation. See Enable Secret Manager.
GET /secret-manager/namespaces/{name}/availabilityreadCheck a namespace name
GET /secret-manager/operations/{operation_id}readFollow an enable or app credential change
GET /secret-manager/secretsreadList names in a folder (prefix)
GET /secret-manager/catalogreadSearch names (query), paged with cursor
GET /secret-manager/secret-metadata/{secret_path}readA secret’s settings and versions
PUT /secret-manager/secret-metadata/{secret_path}writeChange a secret’s settings
DELETE /secret-manager/secret-metadata/{secret_path}writeDelete the secret and all its versions permanently
GET /secret-manager/secret-history/{secret_path}readVersion history
POST /secret-manager/secret-versions/{secret_path}/deletewriteDelete versions (recoverable)
POST /secret-manager/secret-versions/{secret_path}/undeletewriteUndelete versions
POST /secret-manager/secret-versions/{secret_path}/destroywriteDestroy versions (permanent)
GET /secret-manager/app-credentialsreadList app credentials
POST /secret-manager/app-credentialswriteCreate an app credential. 202 with an operation.
GET /secret-manager/app-credentials/{credential_id}readOne app credential
POST /secret-manager/app-credentials/{credential_id}/secret-idwriteIssue a new Secret ID (the old one stops working)
DELETE /secret-manager/app-credentials/{credential_id}writeRevoke an app credential. 202 with an operation.

{secret_path} is the path with plain slashes, for example /secret-manager/secret-metadata/payments/db; an encoded %2F is answered with a 307 redirect to the plain-slash path. Calls that touch the store (listing, search, metadata, history, version actions, delete) are billed as one operation each; status, operations, the name check and app credential calls aren’t. The full request and response schemas are in the API reference.

Secrets

List a folder

curl -s "${auth[@]}" "$API/secrets?workspace_id=$WS&prefix=payments/"

The answer has keys (the names in the folder; folders end in /) and items, one per name, with current_version, retained_versions, max_versions and updated_time. Leave out prefix for the top level; add managed=true to list ibee-managed/. A folder lists in one answer; there are no pages.

curl -s "${auth[@]}" "$API/catalog?workspace_id=$WS&query=stripe&limit=50"

Search matches part of a path or display name, ignoring case. The answer has items and next_cursor; pass cursor=<next_cursor> for the next page (limit 1–100, default 50). Secrets written outside the portal can take a few minutes to appear; indexed: false means the workspace hasn’t been fully indexed yet.

Read a secret’s settings and history

curl -s "${auth[@]}" "$API/secret-metadata/payments/db?workspace_id=$WS"
curl -s "${auth[@]}" "$API/secret-history/payments/db?workspace_id=$WS"

The history answer has current_version and versions, keyed by version number, each with created_time, deletion_time (empty unless deleted) and destroyed. Add managed=true for a secret in ibee-managed/.

Change a secret’s settings

curl -s -X PUT "${auth[@]}" "$API/secret-metadata/payments/db?workspace_id=$WS" \
-H "Content-Type: application/json" \
-d '{"max_versions": 5, "cas_required": true, "delete_version_after": "0", "custom_metadata": {"owner": "payments-team"}}'
FieldValues
max_versions0–1,000 versions to keep; 0 uses the workspace default
cas_requiredtrue makes every write send check-and-set
delete_version_after"0" (never) or a duration such as "720h" (30 days). Deleted versions are still billed.
custom_metadataUp to 32 string pairs (keys up to 128 characters, values up to 512). Replaces the existing pairs. Never put secret values here.

Calling PUT on a path that doesn’t exist creates it with settings but no value; the portal shows Value not saved until a value is written over the Vault API.

Delete, undelete and destroy versions

curl -s -X POST "${auth[@]}" "$API/secret-versions/payments/db/delete?workspace_id=$WS" \
-H "Content-Type: application/json" -d '{"versions": [3]}'

Send 1–100 version numbers. Use /undelete to bring deleted versions back and /destroy to erase them permanently.

Delete a secret

curl -s -X DELETE "${auth[@]}" "$API/secret-metadata/payments/db?workspace_id=$WS"

This removes the secret, every version and its settings. It can’t be undone.

App credentials

Create a read-only credential for the payments folder. Send an Idempotency-Key (8–128 characters: letters, digits, ., _, : and -):

curl -s -X POST "${auth[@]}" "$API/app-credentials?workspace_id=$WS" \
-H "Idempotency-Key: payments-api-credential-001" \
-H "Content-Type: application/json" \
-d '{"name": "payments-api", "access": "read", "folder": "payments"}'

The answer is 202 with credential (its id, name, access, folder, state) and an operation. Poll GET /secret-manager/operations/{id} until status is completed, then issue the Secret ID:

curl -s -X POST "${auth[@]}" "$API/app-credentials/$CREDENTIAL_ID/secret-id?workspace_id=$WS"
{
"role_id": "8f1c…",
"secret_id": "3b9e…",
"namespace": "acme-payments",
"mount": "approle",
"endpoint": "https://secrets.ibee.ai"
}

The secret_id is returned once and can’t be read again; store it straight away. Calling this again issues a new Secret ID and the previous one stops working at once. If the credential is still being set up, the call answers 409 app_credential_pending; wait and retry.

  • access is read (default) or read_write. folder is optional; leave it out for every secret.
  • GET /secret-manager/app-credentials returns items (never Secret IDs) and the workspace’s limit (50).
  • DELETE /secret-manager/app-credentials/{id} revokes the credential: 202 with an operation. Apps lose access within seconds.

Errors

Errors come back as JSON:

{ "error": "namespace_taken", "message": "This namespace name is already taken", "request_id": "…" }
StatuserrorMeaning
402billing_deniedBilling refused the enable; see billing_reason
403insufficient_scopeThe token lacks the required_scope
403(other codes)The token owner’s workspace role doesn’t allow the call
403access_deniedThe secret store refused the request for this role
403verification_requiredThe organization’s identity verification isn’t complete
403workspace_restricted / workspace_suspendedThe workspace is read-only or suspended
404workspace_not_enabledSecret Manager isn’t enabled in this workspace
404secret_not_found, not_found, app_credential_not_found, operation_not_foundNothing at that path or ID
409workspace_pending, lifecycle_pendingSetup or a workspace change is in progress; retry shortly
409app_credential_limit, app_credential_name_taken, app_credential_pending, app_credential_revokedSee App credentials
409idempotency_conflictThe Idempotency-Key was used for a different request
413secret_too_largeOver the size limit
422invalid_request, invalid_path, invalid_metadata, invalid_version, invalid_name, invalid_cursorThe request breaks a rule; see Limits
503 / 504secret_manager_unavailable, secret_manager_timeout, billing_unavailableTry again shortly

Every error is listed in Troubleshooting.