> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Personal Access Token

> Create a new Personal Access Token for the caller.



## OpenAPI

````yaml /openapi.yaml post /auth/pats
openapi: 3.1.0
info:
  version: 1.807.0
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /auth/pats:
    post:
      tags:
        - Auth
      summary: Create Personal Access Token
      description: Create a new Personal Access Token for the caller.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                publicKey:
                  type: string
                  pattern: >-
                    ^-----BEGIN (RSA )?PUBLIC
                    KEY-----[A-Za-z0-9+/=\n\r\\]+-----END (RSA )?PUBLIC
                    KEY-----\s?$
                permissionId:
                  type: string
                externalId:
                  type: string
                daysValid:
                  type: integer
                  exclusiveMinimum: 0
                secondsValid:
                  type: integer
                  exclusiveMinimum: 0
              required:
                - name
                - publicKey
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                  dateCreated:
                    type: string
                  credId:
                    type: string
                  isActive:
                    type: boolean
                  kind:
                    type: string
                    enum:
                      - Pat
                      - ServiceAccount
                      - Token
                      - Code
                      - Recovery
                      - Temp
                      - Application
                  linkedUserId:
                    type: string
                  linkedAppId:
                    type: string
                  name:
                    type: string
                  orgId:
                    type: string
                  publicKey:
                    type: string
                  tokenId:
                    type: string
                  permissionAssignments:
                    type: array
                    items:
                      type: object
                      properties:
                        permissionName:
                          type: string
                        permissionId:
                          type: string
                        assignmentId:
                          type: string
                        operations:
                          type: array
                          items:
                            type: string
                      required:
                        - permissionName
                        - permissionId
                        - assignmentId
                required:
                  - accessToken
                  - dateCreated
                  - credId
                  - isActive
                  - kind
                  - linkedUserId
                  - linkedAppId
                  - name
                  - orgId
                  - publicKey
                  - tokenId
                  - permissionAssignments
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````