Secrets API reference
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.
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:
{
"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):
{
"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.cloudSecrets
A project-owned write-only runtime secret identity.
Create secret
/v1/secretsRequest body
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$descriptionstring | nulloptionaldefault: nullResponse
8 fields
idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$descriptionstring | nullrequiredstatus"active" | "disabled"requiredlatest_versioninteger | nullrequiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeupdated_atstringrequiredTime this resource was last updated, serialized as an ISO 8601 timestamp.
format: date-timeList secrets
/v1/secretsQuery parameters
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
status"active" | "disabled"optionallimitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$descriptionstring | nullrequiredstatus"active" | "disabled"requiredlatest_versioninteger | nullrequiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeupdated_atstringrequiredTime this resource was last updated, serialized as an ISO 8601 timestamp.
format: date-timehas_morebooleanrequiredGet secret
/v1/secrets/{id}Path parameters
idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
Query parameters
No query parameters
Response
8 fields
idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$descriptionstring | nullrequiredstatus"active" | "disabled"requiredlatest_versioninteger | nullrequiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeupdated_atstringrequiredTime this resource was last updated, serialized as an ISO 8601 timestamp.
format: date-timeUpdate secret
/v1/secrets/{id}Path parameters
idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
Request body
descriptionstring | nulloptionalstatus"active" | "disabled"optionalResponse
8 fields
idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
project_idstringrequiredProject identifier. Serialized with the proj_ prefix.
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$descriptionstring | nullrequiredstatus"active" | "disabled"requiredlatest_versioninteger | nullrequiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeupdated_atstringrequiredTime this resource was last updated, serialized as an ISO 8601 timestamp.
format: date-timeDelete secret
/v1/secrets/{id}Path parameters
idstringrequiredSecret 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
/v1/secret-versionsRequest body
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
valuestringrequiredmin length: 1 · max length: 4096Response
5 fields
idstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
numberintegerrequiredgreater than: 0 · max: 9007199254740991status"enabled" | "disabled"requiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeList secret versions
/v1/secret-versionsQuery parameters
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
limitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
numberintegerrequiredgreater than: 0 · max: 9007199254740991status"enabled" | "disabled"requiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timehas_morebooleanrequiredGet secret version
/v1/secret-versions/{id}Path parameters
idstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
Query parameters
No query parameters
Response
5 fields
idstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
numberintegerrequiredgreater than: 0 · max: 9007199254740991status"enabled" | "disabled"requiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-timeUpdate secret version
/v1/secret-versions/{id}Path parameters
idstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
Request body
status"enabled" | "disabled"requiredResponse
5 fields
idstringrequiredImmutable Secret version identifier; the response contains metadata only. Serialized with the sev_ prefix.
secret_idstringrequiredSecret identifier; secret values are never returned. Serialized with the sec_ prefix.
numberintegerrequiredgreater than: 0 · max: 9007199254740991status"enabled" | "disabled"requiredcreated_atstringrequiredTime this resource was created, serialized as an ISO 8601 timestamp.
format: date-time