Skip to content

Saved Credentials API

Create, rotate and delete a runtime plane's saved credentials from a script. The portal's Credentials tab does the same, and encrypts secrets for you; use this API for automation, or on a self-managed runtime plane.

Paths below are relative to your Runtime Manager API. {planeId} is the runtime plane's ID, and {id} a credential's id. Administrators only.

Self-managed portal

On a self-managed runtime plane, the Credentials tab and the collector form's Saved credential choice have not been tested with the self-managed portal yet. Until they have, use this API there.

Endpoints

Method and path What it does
GET /credential-types Lists the credential types and their fields
GET /runtime-plane/{planeId}/credentials Lists the plane's credentials. Add ?type=entra_sp for one type
POST /runtime-plane/{planeId}/credentials Creates a credential
GET /runtime-plane/{planeId}/credentials/{id} Shows one credential and the collectors that use it
PUT /runtime-plane/{planeId}/credentials/{id} Edits a credential; a changed value updates every collector that uses it
POST /runtime-plane/{planeId}/credentials/{id}/restart-preview Shows what a PUT would restart, without saving
POST /runtime-plane/{planeId}/credentials/{id}/retry Updates again the collectors that are not updated
POST /runtime-plane/{planeId}/credentials/{id}/restart External secret store planes only: restarts every collector that uses it
DELETE /runtime-plane/{planeId}/credentials/{id} Deletes an unused credential; returns 204
GET /api/v1/rsa-keys/runtime-planes/{planeId}/active The plane's active public key, to encrypt secrets with

Credential types

Type Fields Secret field
entra_sp (Azure Entra Service Principal) tenantId, clientId, clientSecret clientSecret
databricks_pat (Databricks personal access token) token token
databricks_oauth (Databricks service principal, OAuth) clientId, clientSecret clientSecret
openai (OpenAI) apiKey apiKey
anthropic (Anthropic) apiKey apiKey

The secret is write-only, and always encrypted

  • Send the secret encrypted with the runtime plane's active key, never in plain text. Fetch the key from GET /api/v1/rsa-keys/runtime-planes/{planeId}/active.
  • Send keyFingerprint: the lowercase hex SHA-256 of that public key's X.509 DER bytes, so Trust3 can confirm you used the current key.
  • Trust3 never decrypts the secret; only the runtime plane can. A secret not encrypted with the plane's current key is rejected.
  • No response ever returns the secret, encrypted or not.

On a runtime plane with an external secret store, send the key name instead, and no keyFingerprint.

Create a credential

POST /runtime-plane/{planeId}/credentials

JSON
1
2
3
4
5
6
7
{
  "name": "prod-sp",
  "type": "entra_sp",
  "publicFields": { "tenantId": "<directory (tenant) ID>", "clientId": "<application (client) ID>" },
  "secret": { "clientSecret": "<the client secret, encrypted with the plane's key>" },
  "keyFingerprint": "<fingerprint of the key you encrypted with>"
}
  • name — up to 255 characters, unique on the runtime plane ignoring case, with no leading or trailing spaces.
  • publicFields — the type's non-secret fields. Never put the secret here.
  • secret — exactly one entry, the type's secret field.

The response is 201 with the credential, without the secret. version starts at 1.

Edit and rotate a credential

PUT /runtime-plane/{planeId}/credentials/{id}

  • Send the full name and publicFields.
  • Leave secret out to keep the stored secret. Send secret and keyFingerprint only to replace it.
  • The type, and an entra_sp credential's tenantId and clientId, cannot change. Create a new credential instead.
  • version goes up by one whenever the secret or a field changes. A rename alone does not change it.
  • A new version is copied into every collector that uses the credential, one at a time, and each restarts once. The response lists every collector with its state.

If the request times out, the change is saved. Do not change the credential again; read it to see each collector's state, and retry the ones that are not updated.

Preview the restart first

Send the same body you would send to the PUT to POST /runtime-plane/{planeId}/credentials/{id}/restart-preview. Nothing is saved, and the request is checked exactly as the PUT checks it.

JSON
1
2
3
4
5
6
7
8
9
{
  "credentialId": 17,
  "version": 3,
  "valuesChange": true,
  "changedFields": ["clientSecret"],
  "restarts": [ { "applicationId": 40, "applicationName": "collector-prod", "groups": ["databricks", "azure"] } ],
  "notRestarted": [ { "applicationId": 41, "applicationName": "collector-dev", "groups": ["azure"], "reason": "the collector is stopped, so it is not updated now. Booting it applies the new version" } ],
  "warnings": []
}

valuesChange: false means the edit changes nothing the collectors use, for example a rename.

List and view

  • Both the list and a single credential show summary, for example prod-sp v4 · 18 of 20 applied · 2 pending.
  • A single credential shows usages: each collector that uses it, with state and stateText. States are APPLIED, PENDING, NOT_APPLIED and NOT_UPDATED — see What the states mean. A NOT_UPDATED usage carries copyError.
  • keyRevoked: true means the plane's encryption key was rotated after the secret was entered, so the plane can no longer read it. Send the secret again in a PUT, encrypted with the current key.
  • The runtime plane's details show "capabilities": ["credentials"] where this API manages the plane's saved credentials.

Use a credential in a connection

Set the section's *.credential-ref field to the credential's id, as text (for example "17"). Leave it "" to enter the fields directly.

Collector section Field Type it takes
Databricks databricks.credential-ref databricks_pat, databricks_oauth or entra_sp, by Authentication method
Azure azure.credential-ref entra_sp, for the connection's tenant
Monitoring (classifier LLM) classifier.llm.credential-ref openai or anthropic, by Classifier LLM provider

On save, Trust3 writes the credential's values into the connection's fields whatever the request sent for them, so you can leave them out. Connector create, update and import responses carry a warnings list when Trust3 changed something instead of refusing it — for example CREDENTIAL_REFERENCE_CLEARED when an import cleared a credential that does not exist on the target runtime plane.

Planes with an external secret store

Plane's secret store (secretStoreRef) The credential's secret field holds
Blank or RSA The secret, encrypted with the plane's key
ASM/<secret>, AKV/<vault>, GSM/<secret>, K8S/<secret> The key name of the secret inside that store
JSON
1
2
3
4
5
6
{
  "name": "prod-sp",
  "type": "entra_sp",
  "publicFields": { "tenantId": "<directory (tenant) ID>", "clientId": "<application (client) ID>" },
  "secret": { "clientSecret": "collector-entra-secret" }
}
  • A key name is 1 to 253 letters, digits, ., _ and -; on Azure Key Vault, 1 to 127 letters, digits and -.
  • A value that looks like an encrypted secret or like the secret itself (dapi…, dose…, sk-…, sk-ant-…) is rejected, as is a keyFingerprint.
  • Responses include secretKeyName.
  • After you change the value in the store and keep the key name, call POST /runtime-plane/{planeId}/credentials/{id}/restart to restart every collector that uses it.

Errors

Code HTTP Meaning What to do
CREDENTIAL_KEY_NOT_ACTIVE 400 The fingerprint is not the plane's active key. Fetch the current key, encrypt again and resend.
CREDENTIAL_SECRET_NOT_ENCRYPTED 400 The secret is not encrypted for the plane's key. Encrypt it with the plane's active key.
CREDENTIAL_FIELD_LOCKED 400 You tried to change the type, or an entra_sp tenant ID or client ID. Create a new credential.
CREDENTIAL_NOT_FOUND 400 A connection names a credential that is not on this plane. Use an id from this plane's list.
CREDENTIAL_TYPE_MISMATCH 400 The credential's type does not fit the section, authentication method or LLM provider. Pick a credential of the right type.
CREDENTIAL_FIELD_MISMATCH 400 An entra_sp credential is for another tenant than the connection's. Pick a credential for this tenant.
CREDENTIALS_NOT_MANAGED_HERE 400 The plane is self-managed and this Runtime Manager only tracks it. Use the plane's own Runtime Manager.
CREDENTIALS_SECRET_STORE_UNREADABLE 400 The plane's secret store setting is not recognised. Fix the plane's secret store setting.
VALIDATION_ERROR 400 A missing or invalid field, an unknown type, or the secret sent as a public field. Fix the field named in the message.
ENTITY_NOT_FOUND 404 No such credential or runtime plane. Check the IDs.
CREDENTIAL_NAME_EXISTS 409 Another credential on the plane has that name, ignoring case. Pick another name.
CREDENTIAL_IN_USE 409 Connections still use the credential; usages lists them. Switch them to another credential or direct entry first.
CREDENTIAL_REFERENCE_CONFLICT 409 The connection's saved credential was changed by another update at the same moment. Reload and save again.
CREDENTIALS_IN_USE_ON_PLANE 409 You tried to change the plane's secret store kind while it has saved credentials. Delete the credentials first.