v1

latestOpenAPI 3.0.02026-07-17112116167.8 KB
MCP PATs

Mint an MCP Personal Access Token for a workspace

Returns the secret ONCE in the response body. At least one scope must be provided. The PAT is bound to the URL's workspace; the body has no workspace field.

post/api/workspaces/{wid}/mcp/pats

Path parameters

widstring required

Workspace ID

Request body

expires_atstring
namestring required
scopesstring[] required

Example request

{
  "expires_at": "2026-09-09T08:30:00Z",
  "name": "claude-desktop-laptop",
  "scopes": [
    "[\"mcp:read\"",
    "\"mcp:exec\"]"
  ]
}

Response

Created

created_atstring required
expires_atstring required
idstring required
namestring required
prefixstring required
scopesstring[] required
secretstring required
workspace_idstring required

Example response

{
  "expires_at": "2026-09-09T08:30:00Z",
  "id": "agpat_a1b2c3d4e5f6g7h8",
  "prefix": "agpat_a1b2c3d4e5f6g7h8"
}