Skip to content

Secrets API reference

View as Markdown

Project-scoped write-only runtime secrets.

Published contracts: @socra/secret-api@0.0.1.

Authenticated request and response

Replace the example Project identifier with your own authorized Project. IAM permissions and Secret service enablement on that Project apply. List and get return metadata. Secret values are write-only and are never included in responses; do not put live secret values into transcripts.

This illustrative read uses an existing access token. Set ACCESS_TOKEN through your authorized credential provider; keep it out of source, logs and shared shell history. The identifiers and response below are fictional, validated against the published package. They are not a runtime execution receipt.

sh
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Accept: application/json' \
  'https://secret.socra.cloud/v1/secrets?project_id=proj_01m00000000000000000000000&limit=1'

Example successful response body:

JSON
{
  "data": [
    {
      "id": "sec_01m00000000000000000000000",
      "project_id": "proj_01m00000000000000000000000",
      "name": "example-secret",
      "description": null,
      "status": "active",
      "latest_version": null,
      "created_at": "2026-10-20T12:00:00.000Z",
      "updated_at": "2026-10-20T12:00:00.000Z"
    }
  ],
  "has_more": false
}

For body requests, send JSON with Content-Type: application/json and the exact body fields listed under the operation. Required scopes, when declared, appear with the operation. A token and a valid request shape do not replace the service's authorization rules.

Handle unsuccessful responses

Inspect the HTTP status and response body before taking another action. The published API client retains status, method, URL and body on APIError. It accepts a JSON error object with optional error, message, code and details fields; it also preserves a text or empty body. The method contracts below do not declare a complete per-operation error catalog.

An illustrative JSON error body (field names follow the client contract; the message is an example):

JSON
{
  "message": "The request was rejected. Check the status and service permissions."
}
  • For 400 or another validation response, compare the named field, required fields, types, bounds and accepted values with this reference before correcting the request.
  • For 401, obtain or refresh your token through the supported authorization path. Never paste a token into a bug report.
  • For 403, stop and ask the resource owner to verify the intended principal, Account or Project, required permission and service enablement. An access denial is not evidence of a runtime defect.
  • For 404, verify the exact resource identifier and Account or Project context with its owner; do not recreate a resource merely because a read failed.
  • For 429, follow Retry-After if the service supplies it. These contracts specify no universal rate limit or retry interval.
  • For a 5xx response or interrupted connection after a write, inspect supported resource state before retrying. The effect may be uncertain; automatic replay can duplicate work.

These are status-based troubleshooting steps, not a promise that each operation returns each status or the sample body. Preserve the exact status and redacted body when requesting help.

Base URL

https://secret.socra.cloud

Secrets

A project-owned write-only runtime secret identity.

Create secret

POST/v1/secrets

Request body

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
descriptionstring | nulloptional
default: null

Response

8 fields

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
descriptionstring | nullrequired
status"active" | "disabled"required
latest_versioninteger | nullrequired
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time

List secrets

GET/v1/secrets

Query parameters

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

status"active" | "disabled"optional
limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
descriptionstring | nullrequired
status"active" | "disabled"required
latest_versioninteger | nullrequired
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time
has_morebooleanrequired

Get secret

GET/v1/secrets/{id}

Path parameters

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

Query parameters

No query parameters

Response

8 fields

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
descriptionstring | nullrequired
status"active" | "disabled"required
latest_versioninteger | nullrequired
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time

Update secret

PATCH/v1/secrets/{id}

Path parameters

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

Request body

descriptionstring | nulloptional
status"active" | "disabled"optional

Response

8 fields

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

project_idstringrequired

Project identifier. Serialized with the proj_ prefix.

namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
descriptionstring | nullrequired
status"active" | "disabled"required
latest_versioninteger | nullrequired
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time

Delete secret

DELETE/v1/secrets/{id}

Path parameters

idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

Query parameters

No query parameters

Response

No response body

Secret versions

Immutable write-only secret material metadata. Values are never returned.

Add secret version

POST/v1/secret-versions

Request body

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

valuestringrequired
min length: 1 · max length: 4096

Response

5 fields

idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

numberintegerrequired
greater than: 0 · max: 9007199254740991
status"enabled" | "disabled"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time

List secret versions

GET/v1/secret-versions

Query parameters

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

numberintegerrequired
greater than: 0 · max: 9007199254740991
status"enabled" | "disabled"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time
has_morebooleanrequired

Get secret version

GET/v1/secret-versions/{id}

Path parameters

idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

Query parameters

No query parameters

Response

5 fields

idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

numberintegerrequired
greater than: 0 · max: 9007199254740991
status"enabled" | "disabled"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time

Update secret version

PATCH/v1/secret-versions/{id}

Path parameters

idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

Request body

status"enabled" | "disabled"required

Response

5 fields

idstringrequired

Immutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.

secret_idstringrequired

Secret identifier; secret values are never returned. Serialized with the sec_ prefix.

numberintegerrequired
greater than: 0 · max: 9007199254740991
status"enabled" | "disabled"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time