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

# Get the current API key

> Returns the API key used for the request: its name, granted permissions and IP allow list. Needs no permission, so it is a good connectivity check.

**Permission:** none, any active key.



## OpenAPI

````yaml /docs/users-api.yaml get /token/info
openapi: 3.1.0
info:
  title: Spartan Users API
  version: '2026.11'
  description: >-
    Users, balances, suspensions, IP bans and sessions. Also holds the token
    endpoint you can use to test a key.


    All requests need an API key from **Admin, API** in the `Authorization:
    Bearer <key>` header. Replace `{domain}` with the domain of your Spartan
    installation. Successful responses use the envelope `{"data": ..., "meta":
    {"request_id": ...}}`; errors use `{"error": {"code", "message", "details"},
    "request_id"}`.
servers:
  - url: https://{domain}/api/application
    description: Your Spartan installation
    variables:
      domain:
        default: billing.example.com
        description: Domain of your Spartan installation, without https://
security:
  - bearerAuth: []
tags:
  - name: Token
  - name: Users
  - name: User actions
paths:
  /token/info:
    get:
      tags:
        - Token
      summary: Get the current API key
      description: >-
        Returns the API key used for the request: its name, granted permissions
        and IP allow list. Needs no permission, so it is a good connectivity
        check.


        **Permission:** none, any active key.
      operationId: getTokenInfo
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Token'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
              example:
                data:
                  id: 8
                  name: Billing sync
                  permissions:
                    user_management:
                      - users.index
                      - users.show
                    service_management:
                      - services.index
                      - services.show
                    product_management:
                      - products.index
                      - products.show
                    ticket_management:
                      - tickets.index
                      - tickets.show
                    coupon_management:
                      - coupons.index
                      - coupons.show
                    module_blog:
                      - modules.blog.posts.read
                  allowed_ips: []
                  last_used_at: '2026-11-16T14:33:47.000000Z'
                  created_at: '2026-11-16T14:25:18.000000Z'
                meta:
                  request_id: c2c7169e-7803-46c9-bd6b-07e9de7e9599
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Token:
      type: object
      properties:
        id:
          type: integer
          description: API key id.
        name:
          type: string
          description: Name given to the key in Admin, API.
        permissions:
          type: object
          properties: {}
          description: >-
            Granted permissions grouped by area, for example
            `service_management` or `module_blog`.
          additionalProperties:
            type: array
            items:
              type: string
        allowed_ips:
          type: array
          items:
            type: string
          description: >-
            IP addresses, CIDR ranges or hostnames the key is limited to. Empty
            means any IP.
        last_used_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Last time the key was used.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    Meta:
      type: object
      properties:
        request_id:
          type: string
          format: uuid
          description: Request id, also sent in the `X-Request-ID` response header.
      required:
        - request_id
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Machine readable error code, for example `unauthorized`,
                `forbidden`, `not_found`, `invalid_service_state`.
            message:
              type: string
              description: Human readable explanation.
            details:
              type: object
              properties: {}
              description: Extra context. An empty object for most errors.
              additionalProperties: true
          required:
            - code
            - message
            - details
        request_id:
          type: string
          format: uuid
          description: >-
            Request id. Also returned in the `X-Request-ID` header. Send your
            own with `X-Request-ID` to correlate logs.
      description: Error envelope returned by every failed request.
      required:
        - error
        - request_id
  responses:
    Unauthorized:
      description: Missing, invalid or inactive API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: No Authorization header
              value:
                error:
                  code: unauthorized
                  message: Bearer token required.
                  details: {}
                request_id: 9aca26ca-e06f-4725-8e4b-4385d6c03422
            invalid:
              summary: Unknown or inactive key
              value:
                error:
                  code: unauthorized
                  message: Invalid or inactive token.
                  details: {}
                request_id: 8802a669-6f06-453e-a1d8-0b81621167c3
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key created in Admin, API. Send it as `Authorization: Bearer <key>`.
        Each key has its own permissions and optional IP allow list.

````

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