DocumentationAPI reference

Rust · 0.1.0

Create Personal Access Token

POST /api/v1/users/{user}/personalAccessTokens

UserService · UserService_CreatePersonalAccessToken

Protocol-derived reference. Authorization and instance policy still apply. Schema descriptions are inherited from the MIT-licensed application contract; examples here are not executed against a live server.

Access

Owner-only: the user named in the path must be the authenticated caller. Instance administrator status does not allow acting on another account here.

Capture the token once

The token value is returned only by this creation response. Store it securely before discarding the response; list operations cannot recover it. Positive expiresInDays sets an expiry; zero or a negative value produces no expiration in this implementation. A PAT has the account's authority, not a separate set of scopes. Delete the token resource when the integration no longer needs it.

Request

CreatePersonalAccessToken creates a new Personal Access Token for a user. The token value is only returned once upon creation.

POST/api/v1/users/{user}/personalAccessTokens

Parameters

Name / locationType / requirementDescription
user
path
string
Required
The user id.

Request body

Required

application/json · CreatePersonalAccessTokenRequest

Responses

200 · OK

application/json · CreatePersonalAccessTokenResponse

default · Default error response

application/json · Status

Complete operation definition

All declared constraints, media types and response details are retained below. Schema references link to their complete definitions.

Open JSON definition
{
  "tags": [
    "UserService"
  ],
  "description": "CreatePersonalAccessToken creates a new Personal Access Token for a user.\n The token value is only returned once upon creation.",
  "operationId": "UserService_CreatePersonalAccessToken",
  "parameters": [
    {
      "name": "user",
      "in": "path",
      "description": "The user id.",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreatePersonalAccessTokenRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatePersonalAccessTokenResponse"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}