Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Create or rotate a secret

Store a new encrypted value or replace the existing value. The response contains metadata only. A connected account cannot be given a stored value: the request answers 409 SECRET_KIND_MISMATCH; delete the secret first. Enterprise: send external instead of value to create or repoint a secret whose value is read from one of the environment’s secret stores at dispatch. The value is read once and dropped, to record whether the store can produce it. If it cannot, the secret is still saved, with health.status: unreachable and the reason, and the response carries a warning (EXTERNAL_SECRET_UNREADABLE); calls that use it fail before anything is sent until the store can produce it. A reference that is wrong in itself (no such store, a path outside the store’s allowedPaths, a malformed Vault path) answers 400. An edition without secret stores answers 501 SECRET_STORES_UNAVAILABLE. A reference chooses which of the store’s secrets Anlyon reads with the store’s credential and where its value may be sent, so external also needs secret-stores:write on a key, and the workspace admin role for a person; without it the request answers 403.

PUT/api/v2/secrets/{name}
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Path parameters
namestringrequired

Uppercase secret name referenced by action templates.

min length 1 · max length 100 · matches ^[A-Z0-9_]+$
Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Request body
requiredapplication/json
valuestring
min length 1 · max length 8192
externalExternalSecretReference

Enterprise. Where an external secret's value lives: a path in one of the environment's secret stores, optionally one key and one version.

Show properties
storestringrequired

The store's name.

matches ^[a-z0-9][a-z0-9-]{0,62}$
pathstringrequired

AWS: the secret's name or ARN. Vault: the secret's path under the store's KV v2 mount, such as payments/stripe. Must sit under one of the store's allowedPaths when it has any.

min length 1 · max length 512
keystring | null

A key of the secret. AWS: a key of the secret string read as JSON; omit it to use the whole string. Vault: a key of the secret's data, required.

min length 1 · max length 256
versionstring | null

AWS: a version id (a UUID) or a staging label such as AWSPREVIOUS. Vault: a version number. Omit it to read the current version at each dispatch.

min length 1 · max length 64 · matches ^[A-Za-z0-9_.:-]+$
descriptionstring
max length 500
allowedHostsstring[] | null

Hosts this secret may be sent to. A leading dot matches subdomains (".stripe.com" admits "api.stripe.com"). Required when a stored value is created: a write that would leave it with no hosts is refused with 400. Omit it on a rotation to keep the hosts it has. A secret read from your own vault (external) must name at least one host when it is created; omitting it then answers 400. Omitting it on a rotation or a repoint leaves the existing value alone, so rotating a secret never widens where it may go.

max items 20
allowedPlacementsstring[] | null

Where in the request this secret may appear. Null or omitted means anywhere for a stored value, and ["header"] for a secret read from your own vault. A credential in a header is the intended use; the same value in a URL is usually a mistake or an exfiltration.

max items 3
Responses
200

Secret metadata returned, with a warning when an external secret could not be read yet; the value is never exposed.

successbooleanrequired
Allowed:true
dataSecretrequired

Secret metadata. The encrypted value is never exposed by any API.

Show properties
idstringrequired
namestringrequired
matches ^[A-Z0-9_]+$
descriptionstring | nullrequired
allowedHostsstring[] | nullrequired

Hosts this secret may be sent to. Null only on a secret stored before hosts were required, which may be sent to any public host until its next write names them.

allowedPlacementsstring[] | nullrequired

Where in the request this secret may appear. Null means anywhere.

kindstringrequired

static holds a value you stored. connection is a connected account: its value is an access token fetched at dispatch, its hosts come from the integration, and it may only appear in a header. external (Enterprise) is read at dispatch from one of the environment's secret stores and is not stored by Anlyon. PUT cannot change a secret's kind.

Allowed:staticconnectionexternal
connectionobject | nullrequired

For a signed-in account, which integration it is and whether it still works. status mirrors health.status, which is the one record of it for both kinds of connected account. Null for a static secret, including one connected with an API key.

Show properties
integrationIdstringrequired
statusstringrequired

The same value as health.status. Reconnect the account to use it again.

Allowed:activeneeds_reauth
healthobject | nullrequired

Whether the connected account still works, whichever way it was connected. active, or needs_reauth with a reason once the provider refused the credential or the connector service could not refresh it. A dispatch that uses a needs_reauth account fails before anything is sent. Reconnect it with POST /api/v2/connections/{secretName}/reconnect. For an external secret, whether its store could last produce it: active, or unreachable with a reason. Null for a secret you stored directly, which Anlyon cannot check.

Show properties
statusstringrequired
Allowed:activeneeds_reauthunreachable
checkedAtstring<date-time> | nullrequired

When Anlyon last asked the provider whether the credential works. Null when it never has.

reasonstring | nullrequired

Set while status is needs_reauth or unreachable. key_rejected: the provider refused the stored key. access_revoked: the provider no longer honours the signed-in account's grant. refresh_failed: the connector service could not refresh its token. store_unreachable: the secret store did not answer. store_denied: the store refused Anlyon's credential for this path. reference_not_found: the store has no secret at that path, version or key.

Allowed:key_rejectedaccess_revokedrefresh_failedstore_unreachablestore_deniedreference_not_foundnull
integrationIdstring | nullrequired

The integration this secret was connected for, by signing in or with an API key. Null for a secret you stored directly. A secret connected with an API key is static with this set.

externalobject | nullrequired

For an external secret, the store and where in it. Never a value. Null otherwise.

Show properties
storestringrequired
storeTypestringrequired
Allowed:aws_secrets_managerhashicorp_vault
pathstringrequired
keystring | nullrequired
versionstring | nullrequired
lastUsedAtstring<date-time> | nullrequired
createdAtstring<date-time>required
updatedAtstring<date-time>required
warningExternalSecretWarning

The secret was saved, and its store could not produce the value just now. Calls that use it fail before anything is sent until the store can.

Show properties
codestringrequired
Allowed:EXTERNAL_SECRET_UNREADABLE
reasonstringrequired
Allowed:store_unreachablestore_deniedreference_not_found
messagestringrequired
202

Accepted, not applied: the change loosens a guardrail, so a workspace admin has to approve it. Location is the request to poll.

successbooleanrequired
Allowed:true
signOffRequiredbooleanrequired
Allowed:true
dataSignOffRequestrequired

A governance change that loosens a guardrail, asked for by an API key, a CLI login or an MCP session, waiting for a workspace admin. Give signOffUrl to a person; poll pollUrl.

Show properties
objectstringrequired
Allowed:sign_off_request
idstringrequired
statusstringrequired

pending until a workspace admin decides. applied: approved and in effect. rejected, expired (after 24 hours), cancelled (withdrawn by the credential) and failed (approved but could not be applied, see error): nothing changed.

Allowed:pendingappliedrejectedexpiredcancelledfailed
operationstringrequired
Allowed:policy.createpolicy.updatepolicy.deletepolicy_file.applyimpact_limit.updateimpact_limit.archivebudget.putbudget.deleteenvironment.resumeaction.createaction.updateaction.importsecret.putsecret_store.createsecret_store.updatesecret_store_settings.updateoauth_app.put
environmentIdstring<uuid>required
resourceobject | nullrequired
Show properties
typestringrequired
idstringrequired
namestring
summarystringrequired
changesSignOffChange[]required
Show properties
Array of SignOffChange
fieldstringrequired
fromany | nullrequired

The value before. Never a secret value.

toany | nullrequired

The value after. Never a secret value.

directionstringrequired
Allowed:tighteninglooseningneutral
reasonstringrequired
diffstringrequired

The changes as plain text

signOffUrlstring<uri>required

The console page where a workspace admin approves or rejects it. Give this to a person.

pollUrlstringrequired
pollAfterSecondsintegerrequired
requestedByobjectrequired
Show properties
typestringrequired
Allowed:api_keyoauth_clientsystem
idstring | nullrequired
onBehalfOfstring | null

For a CLI login or an MCP session

createdAtstring<date-time>required
expiresAtstring<date-time>required
decidedAtstring<date-time> | nullrequired
decidedByobject | nullrequired
Show properties
typestringrequired
Allowed:user
idstringrequired
viastringrequired
Allowed:consoleemail_link
decisionNotestring | nullrequired
resultany | nullrequired

When applied, what the original request would have returned: the limit, budget, policy or action as it now is.

errorobject | nullrequired
Show properties
codestringrequired
messagestringrequired
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

402

Payment Required - Usage quota exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

409

The secret exists with another kind (SECRET_KIND_MISMATCH).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

501

This edition does not include secret stores (SECRET_STORES_UNAVAILABLE).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'https://api.anlyon.com/api/v2/secrets/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "value": "string",
  "external": {
    "store": "string",
    "path": "string",
    "key": "string",
    "version": "string"
  },
  "description": "string",
  "allowedHosts": [
    "string"
  ],
  "allowedPlacements": [
    "url"
  ]
}'
Response
{
  "success": true,
  "data": {
    "id": "sec_01JABCDEF",
    "name": "string",
    "description": "string",
    "allowedHosts": [
      "string"
    ],
    "allowedPlacements": [
      "url"
    ],
    "kind": "static",
    "connection": {
      "integrationId": "hubspot",
      "status": "active"
    },
    "health": {
      "status": "active",
      "checkedAt": "2019-08-24T14:15:22Z",
      "reason": "key_rejected"
    },
    "integrationId": "github",
    "external": {
      "store": "prod-vault",
      "storeType": "aws_secrets_manager",
      "path": "payments/stripe",
      "key": "apiKey",
      "version": "string"
    },
    "lastUsedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "warning": {
    "code": "EXTERNAL_SECRET_UNREADABLE",
    "reason": "store_unreachable",
    "message": "string"
  }
}

Was this page helpful?