tokens

Create a service token

Changed on

Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.

post/tokens

Request

  • Base URL
    https://api.smithery.ai
  • URL
    https://api.smithery.ai/tokens
  • Auth
    HTTP bearer

Request body

organizationIdstring

Optional organization ID to scope the token to. When provided, the token is minted with org context. The authenticated user must be an admin or owner of the organization.

Example request

{
  "policy": [
    {
      "rpcReqMatch": {
        "params.name": "^(create_issue|search_issues)$"
      }
    }
  ],
  "organizationId": "org_01H1234567890"
}

Response

Token created successfully

tokenstring required

The signed service token.

expiresAtstring required

ISO 8601 timestamp when the token expires.

Example response

{
  "expiresAt": "2024-01-01T01:00:00.000Z"
}

Changes