---
updatedAt: 2026-04-30T09:53:36.000Z
---

# Create a new agent token

Creates a new agent token. The secret value is only shown once and must be stored securely.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/public/v1/agentTokens": {
      "post": {
        "description": "Creates a new agent token. The secret value is only shown once and must be stored securely.",
        "operationId": "AgentTokens_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentTokenCreateBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTokenCreateResponseSchema"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new agent token",
        "tags": [
          "Public",
          "Agent Tokens"
        ],
        "x-admin-only": true
      }
    }
  },
  "info": {
    "title": "Entitle API",
    "description": "Entitle API documentation",
    "version": "1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.entitle.io"
    },
    {
      "url": "https://api.us.entitle.io"
    },
    {
      "url": "https://api.ca.entitle.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "csrf-token": {
        "type": "apiKey",
        "in": "header",
        "name": "csrf-token",
        "description": "CSRF token required for state-changing requests"
      }
    },
    "schemas": {
      "AgentTokenCreateBodySchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "format": "string",
            "example": "Agent token name",
            "description": "Display name for the new token"
          }
        },
        "required": [
          "name"
        ]
      },
      "AgentTokenCreateResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000",
            "description": "Unique identifier for the agent token"
          },
          "name": {
            "type": "string",
            "description": "Display name for the agent token"
          },
          "token": {
            "type": "string",
            "format": "string:base64",
            "example": "dXNlcm5hbWU6cGFzc3dvcmQ=",
            "description": "The token secret value in base64 format. Store securely - this is only shown once."
          }
        },
        "required": [
          "id",
          "name",
          "token"
        ]
      }
    }
  },
  "security": [
    {
      "csrf-token": []
    }
  ]
}
```