API authentication uses a bearer token:
Every Secryn API request authenticates with a bearer token in the Authorization header.
Secryn does not accept the access key as a query parameter, cookie, or session. Query parameters such as include, resource, and secrets select the response. They are not credentials.
Every request must include:
Authorization: Bearer YOUR_TOKEN
Accept: application/json
If the header is missing or invalid, the API returns:
401 Unauthorized
Secryn supports two types of API tokens:
A vault access key is a machine credential for exactly one vault. It is created and rotated on that vault in the web interface. Secryn stores it as an HMAC-SHA256 hash keyed by APP_KEY.
The key:
GET and HEAD onlycurl --request GET \
--url "https://secryn.example.com/api/v1/vaults/{vault_id}" \
--header "Accept: application/json" \
--header "Authorization: Bearer VAULT_ACCESS_KEY"
Vault access keys are intended for:
When a key or certificate is marked public:
Authorization: Bearer <resource public token>Public tokens apply only to:
Secrets can never be public.
curl --request GET \
--url "https://secryn.example.com/api/v1/certificates/{certificate_id}" \
--header "Accept: application/json" \
--header "Authorization: Bearer RESOURCE_PUBLIC_TOKEN"
This token:
Authentication verifies identity. Authorization determines access.
Vault access keys:
GET and HEADPublic Resource Tokens:
Unauthorized access attempts return:
403 Forbidden
To invalidate a public token:
A new token is generated if public visibility is re-enabled.
Secret values, secret versions, and audit before/after values are encrypted with Laravel encryption keyed by APP_KEY. Private keys use a SECRYN-PRIVATE-V1 envelope encrypted with that same key. A public resource token returns public material only, never a private key. See the security model. A vault access key can still read private keys in that vault, so limit which vaults you expose, and use HTTPS.
| Status | Meaning |
|---|---|
| 401 | Missing bearer token, or the access key does not match the vault |
| 403 | Resource exists but is not active yet |
| 404 | Resource not found |
| 410 | Resource is expired |
Authorization: Bearer header.