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

# Create Access Token



## OpenAPI

````yaml post /api/v1/access-tokens
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/access-tokens:
    post:
      tags:
        - access-tokens
      summary: Create Access Token
      operationId: create_access_token_api_v1_access_tokens_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubjectAccessTokenCommand'
      responses:
        '201':
          description: Access token created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubjectAccessTokenResponseDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    CreateSubjectAccessTokenCommand:
      properties:
        name:
          type: string
          maxLength: 128
          minLength: 1
          title: Name
        expiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiresat
      type: object
      required:
        - name
      title: CreateSubjectAccessTokenCommand
    CreateSubjectAccessTokenResponseDto:
      properties:
        token:
          $ref: '#/components/schemas/SubjectAccessTokenResponseDto'
        tokenString:
          type: string
          title: Tokenstring
      type: object
      required:
        - token
        - tokenString
      title: CreateSubjectAccessTokenResponseDto
    StringErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: StringErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SubjectAccessTokenResponseDto:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        createdAt:
          type: string
          format: date-time
          title: Createdat
        name:
          type: string
          title: Name
        expiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiresat
        creatorId:
          type: string
          title: Creatorid
      type: object
      required:
        - name
        - expiresAt
        - creatorId
      title: SubjectAccessTokenResponseDto
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````