Personal Access Tokens

Create a personal access token

Changed on

Mints a new personal access token for the caller. Deliberately not admin-gated — any authenticated org member may create their own, unlike OAuth app registration.

The token is minted against a lazily-created, per-org synthetic OAuth app (clientId: pat-system:<orgId>) shared by every PAT in that org — the same signing, hashing, and revocation machinery as /oauth2/token, reused rather than duplicated.

scopes is validated against the org's configured MCP_SCOPES env var, not the full role-aware OAuth-app scope catalog — a non-admin can request any scope in that set.

Session only. The bearer token must be the user's interactive session JWT. OAuth access tokens and personal access tokens (phpat_...) are rejected with 403, so a token that is already issued cannot mint another with wider scopes or a longer life.

The response's accessToken is shown once; only its SHA-256 hash is stored. It's prefixed phpat_ (see the bearerAuth security scheme).

post/personal-access-tokens

Request

  • Base URL
    https://app.pipeshub.com/api/v1
  • URL
    https://app.pipeshub.com/api/v1/personal-access-tokens
  • Auth
    HTTP bearer

Request body

namestring required

Label to help you recognize the token later

scopesstring[]

Scopes to grant, validated against the org's configured MCP_SCOPES (not the full role-aware OAuth-app scope set). Defaults to every scope in MCP_SCOPES if omitted.

Example request

{
  "name": "Claude Desktop",
  "scopes": [
    "kb:read",
    "semantic:write"
  ]
}

Response

Personal access token created successfully

messagestring required

Example response

{
  "message": "Personal access token created successfully",
  "token": {
    "accessToken": "phpat_eyJhbGciOiJIUzI1NiIs..."
  }
}

Changes

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the new optional request property

    • info

      added the optional property ///// to the response with the status