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

# Get tokens

> Returns a list of first-party API tokens for your organization. Requires admin access.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml get /tokens
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs
  - name: users
    description: Operations related to users
paths:
  /tokens:
    get:
      tags:
        - tokens
      summary: Get tokens
      description: >-
        Returns a list of first-party API tokens for your organization. Requires
        admin access.
      operationId: getTokens
      parameters:
        - description: The pagination cursor value.
          example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          explode: true
          in: query
          name: cursor
          required: false
          schema:
            type: string
          style: form
        - description: Number of results to return per page. Default is 200.
          example: 200
          explode: true
          in: query
          name: page_size
          required: false
          schema:
            type: integer
            maximum: 1000
          style: form
        - description: Filter by token IDs.
          explode: false
          in: query
          name: token_ids
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          style: form
        - description: Filter by user ID.
          example: 29827fb8-f2dd-4e80-9576-28e31e9934ac
          explode: true
          in: query
          name: user_id
          required: false
          schema:
            type: string
            format: uuid
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTokensList'
          description: A list of API tokens for your organization.
      security:
        - BearerAuth: []
components:
  schemas:
    PaginatedTokensList:
      example:
        next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
        previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ
        results:
          - token_id: f454d283-ca87-4a8a-bdbb-df212eca5353
            created_at: '2022-01-23T04:56:07.000Z'
            token_label: My API Token
            creator_user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
            user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
            access_level: READ_ONLY
      properties:
        next:
          description: >-
            The cursor with which to continue pagination if additional result
            pages exist.
          example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          nullable: true
          type: string
        previous:
          description: The cursor used to obtain the current result page.
          example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ
          nullable: true
          type: string
        results:
          items:
            $ref: '#/components/schemas/Token'
          type: array
      required:
        - results
      type: object
    Token:
      description: A first-party API token.
      example:
        token_id: f454d283-ca87-4a8a-bdbb-df212eca5353
        created_at: '2022-01-23T04:56:07.000Z'
        token_preview: ab123
        token_label: My API Token
        creator_user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
        user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
        access_level: READ_ONLY
      properties:
        token_id:
          description: The ID of the API token.
          example: f454d283-ca87-4a8a-bdbb-df212eca5353
          format: uuid
          type: string
        created_at:
          description: The date and time the token was created.
          example: '2022-01-23T04:56:07.000Z'
          format: date-time
          type: string
        token_label:
          description: A human-readable label for the token.
          example: My API Token
          type: string
        creator_user_id:
          description: The ID of the user who created the token.
          example: d4a7d928-783e-4599-8ec6-088d635a5bcc
          format: uuid
          type: string
        user_id:
          description: The ID of the user the token authenticates as.
          example: d4a7d928-783e-4599-8ec6-088d635a5bcc
          format: uuid
          type: string
        last_used_at:
          description: The date and time the token was last used.
          example: '2022-01-23T04:56:07.000Z'
          format: date-time
          nullable: true
          type: string
        access_level:
          $ref: '#/components/schemas/ApiAccessLevelEnum'
        expires_at:
          description: The date and time the token expires.
          example: '2023-01-23T04:56:07.000Z'
          format: date-time
          nullable: true
          type: string
      required:
        - token_id
        - created_at
        - token_label
        - creator_user_id
        - user_id
        - access_level
      type: object
    ApiAccessLevelEnum:
      description: The access level of an API token.
      enum:
        - READ_ONLY
        - FULL_ACCESS
      type: string
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````