---
title: "Create System Account Access Token"
url: "https://nov18-dev.movespot.fyi/apis/konnect-identity-3/versions/7179cf49-bbc4-42fb-b00f-57a9115554be/operations/post-system-accounts-id-access-tokens"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-identity-3/versions/7179cf49-bbc4-42fb-b00f-57a9115554be.md

# Create System Account Access Token

`POST` `/system-accounts/{accountId}/access-tokens`

Operation ID: `post-system-accounts-id-access-tokens`

Creates an access token for the specified system account (SA). The access token can be used for authenticating API and CLI requests. The token will only be displayed once on creation. Returns a 409 if the system account already has a token with the same name.

## Path parameters

- `accountId` (string, required) - ID of the system account.

## Request body

Content types: `application/json`

## Responses

- `201` - A response including a single system account access token with the token.
- `401` - Unauthenticated
- `403` - Unauthorized
- `404` - Not Found
- `409` - Conflict

## OpenAPI definition

```yaml
openapi: 3.0.2
info:
  title: Konnect Identity
  version: 3.0.2
servers:
  - url: https://global.api.konghq.com/v3
    description: Global Base URL
paths:
  /system-accounts/{accountId}/access-tokens:
    parameters:
      - name: accountId
        in: path
        description: ID of the system account.
        required: true
        schema:
          type: string
    post:
      operationId: post-system-accounts-id-access-tokens
      summary: Create System Account Access Token
      description: Creates an access token for the specified system account (SA). The
        access token can be used for authenticating API and CLI requests. The
        token will only be displayed once on creation. Returns a 409 if the
        system account already has a token with the same name.
      requestBody:
        $ref: "#/components/requestBodies/CreateSystemAccountAccessToken"
      responses:
        "201":
          $ref: "#/components/responses/SystemAccountAccessTokenCreated"
        "401":
          $ref: "#/components/responses/IdentityUnauthenticated"
        "403":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/IdentityNotFound"
        "409":
          $ref: "#/components/responses/IdentityConflict"
      tags:
        - System Accounts - Access Tokens
security:
  - personalAccessToken: []
  - systemAccountAccessToken: []
  - konnectAccessToken: []
  - serviceAccessToken: []
components:
  requestBodies:
    CreateSystemAccountAccessToken:
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
              expires_at:
                type: string
                format: date-time
            required:
              - name
              - expires_at
          examples:
            Sample Access Token:
              value:
                name: Sample Access Token
                expires_at: 2019-08-24T14:15:22Z
      description: The request body to create a system account access token.
  responses:
    SystemAccountAccessTokenCreated:
      description: A response including a single system account access token with the token.
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                description: ID of the system account access token.
                type: string
                format: uuid
                readOnly: true
              name:
                description: Name of the system account access token.
                type: string
              created_at:
                description: Timestamp of when the system account access token was created.
                type: string
                format: date-time
                readOnly: true
              updated_at:
                description: Timestamp of when the system account access token was last updated.
                type: string
                format: date-time
                readOnly: true
              expires_at:
                description: Timestamp of when the system account access token will expire.
                type: string
                format: date-time
                readOnly: true
              last_used_at:
                description: Timestamp of when the system account access token was last used.
                type: string
                format: date-time
                readOnly: true
              token:
                description: The token of the system account access token.
                type: string
                readOnly: true
                x-sensitive: true
            example:
              id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
              name: Sample Access Token
              created_at: 2022-08-01T14:16:09Z
              updated_at: 2022-08-02T08:35:49Z
              expires_at: 2022-12-31T12:52:23Z
              last_used_at: 2022-10-24T13:05:42Z
              token: spat_12345678901234567890123456789012345678901234567890
            title: System Account Access Token Created Response
          examples:
            Sample Access Token:
              value:
                id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
                name: Sample Access Token
                created_at: 2019-08-24T14:15:22Z
                updated_at: 2019-08-24T14:15:22Z
                expires_at: 2019-08-24T14:15:22Z
                last_used_at: 2019-08-24T14:15:22Z
                token: spat_12345678901234567890123456789012345678901234567890
    IdentityUnauthenticated:
      description: Unauthenticated
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
          examples:
            Unauthorized:
              $ref: "#/components/examples/401-unauthenticated"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            description: The error response object.
            type: object
            properties:
              status:
                description: The HTTP status code.
                type: integer
                example: 403
              title:
                description: The Error Response.
                type: string
                example: Unauthorized
              instance:
                description: The Konnect traceback code.
                type: string
                example: konnect:trace:952172606039454040
              detail:
                description: Details about the error response.
                type: string
                example: You do not have permission to perform this action
            title: Unauthorized Response
          examples:
            Unauthorized:
              $ref: "#/components/examples/403-permission-denied"
    IdentityNotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            Not Found:
              $ref: "#/components/examples/404-not-found"
    IdentityConflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ConflictError"
          examples:
            User is Already Active:
              $ref: "#/components/examples/409-user-is-already-active"
  schemas:
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 401
            title:
              example: Unauthorized
            type:
              example: https://httpstatuses.com/401
            instance:
              example: kong:trace:1234567890
            detail:
              example: Invalid credentials
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 404
            title:
              example: Not Found
            type:
              example: https://httpstatuses.com/404
            instance:
              example: kong:trace:1234567890
            detail:
              example: Not found
    ConflictError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 409
            title:
              example: Conflict
            type:
              example: https://httpstatuses.com/409
            instance:
              example: kong:trace:1234567890
            detail:
              example: Conflict
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
  examples:
    401-unauthenticated:
      value:
        status: 401
        title: Unauthenticated
        instance: konnect:trace:952172606039454040
        detail: A valid token is required
    403-permission-denied:
      value:
        status: 403
        title: Permission denied
        instance: konnect:trace:2822394689570210664
        detail: Only enterprise organizations can create teams
    404-not-found:
      value:
        status: 404
        title: Not Found
        instance: konnect:trace:2287285207635123011
        detail: The requested team was not found
    409-user-is-already-active:
      value:
        status: 409
        title: Resource Conflict
        instance: konnect:trace:6644808935508571943
        detail: User is already active
  securitySchemes:
    personalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs.

        You can generate a Personal Access Token (PAT) from the [personal access
        token page](https://cloud.konghq.com/global/account/tokens/) in the
        Konnect dashboard.

        The PAT token must be passed in the header of a request, for example:

        `curl -X GET 'https://global.api.konghq.com/v2/users/' --header
        'Authorization: Bearer kpat_xgfT...'`
    systemAccountAccessToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The system account access token is meant for automations and
        integrations that are not directly associated with a human identity.

        You can generate a system account Access Token by creating a system
        account and then obtaining a system account access token for that
        account.

        The access token must be passed in the header of a request, for example:

        `curl -X GET 'https://global.api.konghq.com/v2/users/' --header
        'Authorization: Bearer spat_i2Ej...'`
    konnectAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI authenticate with.
    serviceAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        The Service access token is meant to be used between internal services.
```
