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

# CreateTokenAPI mints a new API token for the caller. The raw token is returned


> exactly once.




## OpenAPI

````yaml /api/openapi.json post /v1/tokens
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, and experiments. Authenticate with
    a Bearer API key (erdo_api_...) or scoped token (erdo_token_...).
  version: '2026-07-25'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/tokens:
    post:
      summary: >
        CreateTokenAPI mints a new API token for the caller. The raw token is
        returned
      description: |
        exactly once.
      operationId: POST:mcp.CreateTokenAPI
      requestBody:
        content:
          application/json:
            schema:
              properties:
                expires_in_days:
                  description: >
                    0 defaults to 30 days — the REST surface intentionally does
                    not expose no-expiry tokens to prevent callers accidentally
                    minting eternal credentials with a minimal payload like
                    {"name": "ci"}.
                  format: int64
                  title: >
                    ExpiresInDays is the token lifetime in days. Omitting the
                    field or sending
                  type: integer
                name:
                  title: |
                    Name is a human label for the token.
                  type: string
                organization_id:
                  description: >
                    to the caller's currently-active org. Must be an org the
                    caller belongs to.
                  title: >
                    OrganizationID is the token's DEFAULT org (id or slug).
                    Optional — defaults
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  default_org:
                    $ref: '#/components/schemas/mcp.TokenOrg'
                  expires_at:
                    type: string
                  hint:
                    type: string
                  id:
                    type: string
                  token:
                    title: >
                      Token is the raw secret, returned ONCE. Store it now; it
                      is never shown again.
                    type: string
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    mcp.TokenOrg:
      properties:
        id:
          type: string
        name:
          type: string
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````