Skip to content
Subako Docs
Esc
navigateopen⌘Jpreview

POST /v1/vaults/{vault_id}/credentials

POST/v1/vaults/{vault_id}/credentials
Authorization
AuthorizationBearer token · headerrequired
Path parameters
vault_idstring<uuid>required
Vault id
Header parameters
Idempotency-Keystring
Retry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Request body
requiredapplication/json
display_namestringrequired
max length 200
payloadCredentialPayloadBodyrequired
Show properties
One of:
object
access_tokenstringrequired
auth_schemestringrequired
Allowed:oauth
expires_atstring | null
refreshany | RefreshBlockBody
Show properties
One of:
any
any
RefreshBlockBody
client_idstringrequired
refresh_tokenstringrequired
scopestring | null
token_endpointstringrequired
token_endpoint_authobjectrequired
How the client authenticates to the token endpoint. Opaque: the fields depend on the method and on the provider, so no shape is promised.
object
auth_schemestringrequired
Allowed:static_bearer
tokenstringrequired
protocolProtocolBodyrequired
Mirrors `Protocol`'s spellings rather than deriving serde on the domain type: renaming a domain variant must not silently change the wire.
Allowed:mcp
targetstringrequired
min length 1 · max length 2048
Responses
201Created.
idstring<uuid>required
400Malformed body.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks credential.manage.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such vault, or the caller cannot see it.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
409Idempotency-Key was already used for a different request. Duplicate credential target.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.us.cloud.subako.ai/v1/vaults/497f6eca-6276-4993-bfeb-53cbbbba6f08/credentials" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "display_name": "string",
  "payload": {
    "access_token": "string",
    "auth_scheme": "oauth",
    "expires_at": "string",
    "refresh": {}
  },
  "protocol": "mcp",
  "target": "string"
}'
Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}