SynapDocs
Hub REST API

Keys

The Keys operations of the Hub REST API (6 operations).

For BuildersOpen-source podSynap Cloud

Generated from Synap-core/backend main at 24fabe7, which can be newer than the stable release self-hosters install.

POST
/keys/rotate-cli

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

New key issued

application/json
  1. response
apiKey*string
keyId*string
scopes*array<string>
Example Request
curl -X POST 'https://pod.example.com/api/hub/keys/rotate-cli'
Example Response
{  "apiKey": "string",  "keyId": "string",  "scopes": [    "string"  ]}
GET
/keys/templates

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Templates

application/json
  1. response
templates*array<>
Example Request
curl -X GET 'https://pod.example.com/api/hub/keys/templates'
Example Response
{  "templates": [    {      "id": "string",      "name": "string",      "description": "string",      "stored": true,      "uses": [        "string"      ],      "permissions": [        "string"      ],      "workspaceIds": [        "string"      ],      "projectIds": [        "string"      ],      "entityIds": [        "string"      ],      "expiresInDays": 0    }  ]}
POST
/keys/requests

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Request Body

application/json
  1. body
template?string
Length1 <= length <= 120
permissions?array<>
Items1 <= items <= 128
uses?array<>
Items1 <= items <= 8
name?string
Length1 <= length <= 100
expiresInDays?|
Range1 <= value <= 36500
workspaceId?string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
Formatuuid
projectId?string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
Formatuuid

Response Body

Request filed

application/json
  1. response
request_code*string
request_id*string
review_url*string
expires_in*number
interval*number
Example Request
curl -X POST 'https://pod.example.com/api/hub/keys/requests' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "request_code": "string",  "request_id": "string",  "review_url": "string",  "expires_in": 0,  "interval": 0}
POST
/keys/requests/token

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Request Body

application/json
  1. body
request_code*string
Length16 <= length <= 128

Response Body

The key — shown once

application/json
  1. response
apiKey*string
keyId*string
keyPrefix*string
name*string
scopes*array<string>
expiresAt*string|null
Example Request
curl -X POST 'https://pod.example.com/api/hub/keys/requests/token' \  -H 'Content-Type: application/json' \  -d '{  "request_code": "stringstringstri"}'
Example Response
{  "apiKey": "string",  "keyId": "string",  "keyPrefix": "string",  "name": "string",  "scopes": [    "string"  ],  "expiresAt": "string"}
GET
/keys/requested

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Requested keys

application/json
  1. response
keys*array<>
Example Request
curl -X GET 'https://pod.example.com/api/hub/keys/requested'
Example Response
{  "keys": [    {      "keyId": "string",      "name": "string",      "keyPrefix": "string",      "templateId": "string",      "scopes": [        "string"      ],      "createdAt": "string",      "expiresAt": "string",      "lastUsedAt": "string",      "revokedAt": "string"    }  ]}
DELETE
/keys/requested/{keyId}

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

keyId*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
Formatuuid

Response Body

Revoked

application/json
  1. response
revoked*boolean
Example Request
curl -X DELETE 'https://pod.example.com/api/hub/keys/requested/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "revoked": true}

On this page