Skip to main content

Secrets

Endpoints for storing squad secrets, configuring external secret providers, rotating values, and auditing secret access. Secret values are never returned by the API once stored.

Prerequisites
  • API key: Authorization: Bearer <token>
  • An Operator key — all secret endpoints require Operator scope

Endpoints

MethodPathDescription
GET/api/squads/{squadId}/secretsList secrets for a squad (metadata only)
POST/api/squads/{squadId}/secretsCreate a secret
PATCH/api/secrets/{id}Update secret metadata
POST/api/secrets/{id}/rotateRotate a secret to a new version
DELETE/api/secrets/{id}Delete (revoke) a secret
GET/api/secrets/{id}/usageWhere the secret is bound and used
GET/api/secrets/{id}/access-eventsAccess audit trail for the secret
GET/api/squads/{squadId}/secret-providersList supported provider types
GET/api/squads/{squadId}/secret-providers/healthHealth of configured providers
GET/api/squads/{squadId}/secret-provider-configsList provider configurations
POST/api/squads/{squadId}/secret-provider-configsCreate a provider configuration
GET/api/secret-provider-configs/{id}Read a provider configuration
PATCH/api/secret-provider-configs/{id}Update a provider configuration
DELETE/api/secret-provider-configs/{id}Delete a provider configuration
POST/api/secret-provider-configs/{id}/defaultMark a configuration as the squad default
POST/api/secret-provider-configs/{id}/healthRun a health check against a provider
POST/api/squads/{squadId}/secret-provider-configs/discovery/previewPreview a provider connection before saving a config
POST/api/squads/{squadId}/secrets/remote-import/previewList importable secrets from a configured provider
POST/api/squads/{squadId}/secrets/remote-importImport selected secrets from a provider

Supported providers: local_encrypted, aws_secrets_manager, gcp_secret_manager, vault.


List secrets

GET /api/squads/{squadId}/secrets

Returns secret metadata for the squad. Values are never included.

Response fields

FieldTypeDescription
idUUIDSecret ID
keystringReference key (e.g. STRIPE_API_KEY)
namestringHuman-readable name
providerstringBacking provider
statusstringactive, disabled, archived, or deleted
managedModestringslaw_managed (value held by SLAW) or external_reference (resolved from the provider)
externalRefstring | nullProvider-side reference, for external_reference secrets
latestVersionintegerCurrent version number
descriptionstring | nullOptional description
lastResolvedAttimestamp | nullLast time the value was resolved for use
lastRotatedAttimestamp | nullLast rotation time
createdAttimestampCreation time

Create a secret

POST /api/squads/{squadId}/secrets

Request body

FieldTypeRequiredDescription
namestringyesHuman-readable name
keystringnoReference key ([A-Za-z0-9_.-]+); derived from name if omitted
providerstringnoOne of the supported providers
providerConfigIdUUIDnoProvider configuration to use
managedModestringnoslaw_managed (default) or external_reference
valuestringconditionalRequired for slaw_managed secrets; the raw secret value
externalRefstringconditionalRequired for external_reference secrets; forbidden otherwise
descriptionstringnoOptional description
providerVersionRefstringnoProvider-side version pointer
providerMetadataobjectnoProvider-specific metadata

A slaw_managed secret must supply value; an external_reference secret must supply externalRef and must not supply value. Returns 201 Created.

Example

curl -X POST http://localhost:3100/api/squads/$SQUAD_ID/secrets \
-H "Authorization: Bearer $SLAW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Stripe API Key", "key": "STRIPE_API_KEY", "value": "sk_live_..." }'

Update a secret

PATCH /api/secrets/{id}

Updates metadata only — name, key, status, providerConfigId, description, externalRef, or providerMetadata. Use rotate to change the value.


Rotate a secret

POST /api/secrets/{id}/rotate

Creates a new version. Provide value for managed secrets, or externalRef / providerVersionRef for externally referenced secrets.

Request body

FieldTypeRequiredDescription
valuestringconditionalNew raw value (managed secrets)
externalRefstringconditionalNew provider reference (external secrets)
providerVersionRefstringnoNew provider version pointer
providerConfigIdUUIDnoSwitch the backing provider configuration

Delete a secret

DELETE /api/secrets/{id}

Revokes the secret. Bindings that depend on it will fail to resolve.


Secret usage

GET /api/secrets/{id}/usage

Returns the bindings and consumers that reference the secret, so you can confirm impact before rotating or deleting.


Access events

GET /api/secrets/{id}/access-events

Returns the access audit trail for the secret.

Response fields

FieldTypeDescription
providerstringProvider that served the value
actorType / actorIdstringWho triggered the access
consumerType / consumerIdstringWhat consumed the value (agent, plugin, binding)
configPathstring | nullConfig key the value was injected into
issueIdUUID | nullIssue context, when applicable
heartbeatRunIdUUID | nullHeartbeat run context, when applicable
outcomestringResolution outcome
errorCodestring | nullFailure code, when the access failed
createdAttimestampWhen the access occurred

Provider configurations

Provider configs hold the non-sensitive connection settings for an external secret store. Credentials themselves are never persisted in a provider config — the API rejects sensitive keys (access keys, tokens, passwords, private keys) in the config body.

  • GET /api/squads/{squadId}/secret-providers — list supported provider types
  • GET /api/squads/{squadId}/secret-providers/health — aggregate provider health
  • POST /api/squads/{squadId}/secret-provider-configs — create a configuration
  • GET / PATCH / DELETE /api/secret-provider-configs/{id} — manage one configuration
  • POST /api/secret-provider-configs/{id}/default — set the squad default
  • POST /api/secret-provider-configs/{id}/health — test connectivity

Discovery & remote import

For external providers, these endpoints let you validate a connection and pull existing secrets in without retyping their values. All three require an Operator key.

Preview a provider connection

POST /api/squads/{squadId}/secret-provider-configs/discovery/preview

Tests a provider connection before you persist a configuration.

FieldTypeRequiredDescription
providerstringyesOne of the supported providers
configobjectnoNon-sensitive connection settings to test (default {})

Preview a remote import

POST /api/squads/{squadId}/secrets/remote-import/preview

Lists the secrets available in a configured provider so you can choose what to import. Each candidate is classified (e.g. ready, duplicate, conflict).

FieldTypeRequiredDescription
providerConfigIdUUIDyesProvider configuration to read from
querystringnoFilter candidates by name
pageSizeintegernoPage size, 1–100
nextTokenstringnoPagination cursor from a previous page

Import selected secrets

POST /api/squads/{squadId}/secrets/remote-import

Imports the chosen secrets as external_reference entries. Returns counts of imported, skipped, and errored secrets.

FieldTypeRequiredDescription
providerConfigIdUUIDyesProvider configuration to import from
secretsarrayyes1–100 selections, each with externalRef (required) plus optional name, key, description, providerVersionRef, providerMetadata

Next steps

  • Routines — bind secrets into routine environments
  • Activity — secret writes appear in the squad audit trail