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

# Get token information

> Returns the credential used for this request, the one workspace it can access, and the workspace member it acts as. Call it first to learn the companyId for workspace routes. Requires an API key or OAuth access token; the token acts with its member's current permissions. Web sessions are not accepted.



## OpenAPI

````yaml https://api.gowindmill.com/api/v2/openapi.json get /token-info
openapi: 3.1.0
info:
  title: Windmill API
  version: 2.0.0
  description: >-
    Use the Windmill API to integrate your systems, automate workflows, and
    build applications on your organization's data. Authenticate with an API key
    or OAuth access token. Each request uses the authenticated user's
    permissions within the selected workspace.
servers:
  - url: https://api.gowindmill.com/api/v2
security:
  - bearerAuth: []
paths:
  /token-info:
    get:
      tags:
        - Tokens
      summary: Get token information
      description: >-
        Returns the credential used for this request, the one workspace it can
        access, and the workspace member it acts as. Call it first to learn the
        companyId for workspace routes. Requires an API key or OAuth access
        token; the token acts with its member's current permissions. Web
        sessions are not accepted.
      operationId: tokenInfo.get
      responses:
        '200':
          description: The token, workspace, and member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTokenInfoResponse'
        '401':
          description: >-
            Authentication is missing or invalid. Send a valid API key or OAuth
            access token in the Authorization: Bearer <TOKEN> header before
            retrying.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - UNAUTHORIZED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - FORBIDDEN
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '429':
          description: >-
            The API-client request budget is exhausted. API keys allow 500
            requests per minute per key; OAuth clients allow 500 per minute per
            client and workspace. Reads and writes share the budget. One HTTP
            request counts once, including bulk requests. Wait for the
            Retry-After delay before retrying.
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying the request.
              required: true
              schema:
                type: integer
                minimum: 0
                example: 42
            RateLimit:
              description: >-
                Current request budget: limit is the maximum count, remaining is
                the unused count, and reset is seconds until the window resets,
                not a timestamp.
              required: true
              schema:
                type: string
                example: limit=500, remaining=0, reset=42
            RateLimit-Policy:
              description: >-
                Request limit and window length in seconds, formatted as
                <limit>;w=<seconds>.
              required: true
              schema:
                type: string
                example: 500;w=60
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - RATE_LIMITED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
      security:
        - bearerAuth: []
components:
  schemas:
    GetTokenInfoResponse:
      type: object
      properties:
        token:
          oneOf:
            - $ref: '#/components/schemas/TokenInfoApiKey'
            - $ref: '#/components/schemas/TokenInfoOAuth'
          discriminator:
            propertyName: type
            mapping:
              API_KEY: '#/components/schemas/TokenInfoApiKey'
              OAUTH: '#/components/schemas/TokenInfoOAuth'
          description: The credential that authenticated this request.
        company:
          type: object
          properties:
            id:
              type: string
              description: Workspace ID. Use it as companyId in workspace routes.
              title: Workspace ID
              example: company-example
            slug:
              type: string
              description: >-
                Workspace URL slug. Workspace routes also accept it as
                companyId.
              title: Workspace slug
              example: example-co
            name:
              type: string
              description: Workspace display name.
              title: Workspace name
              example: Example Co
          required:
            - id
            - slug
            - name
          description: The one workspace this token can access.
        actor:
          type: object
          properties:
            memberId:
              type: string
              description: Workspace member the token acts as.
              title: Member ID
              example: member-avery
            employeeId:
              type:
                - string
                - 'null'
              description: >-
                Org-chart employee linked to that member, or null when none is
                linked.
              title: Employee ID
              example: employee-avery
          required:
            - memberId
            - employeeId
          description: The workspace member whose current permissions apply to this token.
      required:
        - token
        - company
        - actor
      title: Token information
      example:
        token:
          type: API_KEY
          id: api-key-example
          access: READ_WRITE
        company:
          id: company-example
          slug: example-co
          name: Example Co
        actor:
          memberId: member-avery
          employeeId: employee-avery
    TokenInfoApiKey:
      type: object
      properties:
        type:
          type: string
          enum:
            - API_KEY
          description: The request used a workspace API key.
        id:
          type: string
          description: ID of the API key.
          title: API key ID
        access:
          type: string
          enum:
            - READ
            - READ_WRITE
          description: READ allows reads only; READ_WRITE also allows changes.
          title: API key access
          example: READ_WRITE
      required:
        - type
        - id
        - access
      title: API key token
    TokenInfoOAuth:
      type: object
      properties:
        type:
          type: string
          enum:
            - OAUTH
          description: The request used an OAuth access token.
      required:
        - type
      title: OAuth token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an API key or OAuth access token. Enter only the token in the
        authorization dialog; requests send it as `Authorization: Bearer
        <TOKEN>`.


        Create an API key in your workspace's **Settings → API keys**. Keys
        start with `wm_api_` and only work in the workspace where they were
        created. Read-only keys can read data; creating, updating, or deleting
        data requires a read-write key.


        ```http

        Authorization: Bearer wm_api_example

        ```


        OAuth access tokens are issued for connected Windmill applications.


        ```http

        Authorization: Bearer <OAUTH_ACCESS_TOKEN>

        ```


        Both token types use the authenticated user's workspace permissions.
        Each endpoint's permission requirements and the sharing settings of the
        requested items still apply.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.