---
updatedAt: 2026-06-26T13:02:09.000Z
agentTools:
  projectIndex: https://developers.newo.ai/llms.txt
---

# Obtain access token

Exchange your API key for a JWT access token and refresh token.
API keys are managed in the Newo platform under **Account → API Keys**.

The returned `access_token` must be passed as `Authorization: Bearer <token>`
on all subsequent API calls. It expires after 15 minutes; use the refresh
endpoint to renew it without re-authenticating.


# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Authentication",
    "version": "1.0.0",
    "contact": {
      "name": "Newo Support",
      "url": "https://docs.newo.ai"
    },
    "description": "Endpoints to obtain and manage JWT tokens. Partners authenticate using an API key\nissued from the Newo platform under **Account → API Keys**.\n\n**Typical flow:**\n1. Call `POST /api/v1/auth/api-key/token` with your API key in the `x-api-key` header\n   to receive an `access_token` and `refresh_token`.\n2. Pass the `access_token` as `Authorization: Bearer <token>` on all other API calls.\n3. Access tokens expire after **15 minutes**. Use `POST /api/v1/auth/token/refresh`\n   with your `refresh_token` to get a new pair without re-authenticating.\n4. Optionally call `POST /api/v1/auth/token/revoke` to invalidate a refresh token.\n"
  },
  "servers": [
    {
      "url": "https://api.newo.ai",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/auth/api-key/token": {
      "post": {
        "operationId": "obtainTokenByApiKey",
        "summary": "Obtain access token",
        "description": "Exchange your API key for a JWT access token and refresh token.\nAPI keys are managed in the Newo platform under **Account → API Keys**.\n\nThe returned `access_token` must be passed as `Authorization: Bearer <token>`\non all subsequent API calls. It expires after 15 minutes; use the refresh\nendpoint to renew it without re-authenticating.\n",
        "security": [],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "description": "Your Newo API key from Account → API Keys.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Access token issued successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenDto"
                }
              }
            }
          },
          "4XX": {
            "description": "Newo API error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "JWTBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT Bearer token. Obtain your token from the Newo platform under\n**Account → API Keys**.\n"
      }
    },
    "schemas": {
      "ApiErrorItemDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "TokenDto": {
        "type": "object",
        "title": "TokenDto",
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "refresh_token"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "JWT access token. Pass as `Authorization: Bearer <token>` on all API calls."
          },
          "token_type": {
            "type": "string",
            "description": "Token type — always `\"Bearer\"`.",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "string",
            "description": "Access token lifetime in seconds (typically `\"900\"` for 15 minutes).",
            "example": "900"
          },
          "refresh_token": {
            "type": "string",
            "description": "Refresh token. Use with `POST /api/v1/auth/token/refresh` to obtain a new pair."
          }
        }
      },
      "ApiErrorDto": {
        "type": "object",
        "description": "Standard error response returned on 4XX responses.",
        "properties": {
          "code": {
            "type": "integer",
            "description": "HTTP-aligned error code"
          },
          "type": {
            "type": "string",
            "description": "Custom error type identifier"
          },
          "reason": {
            "type": "string",
            "description": "Human-readable reason for the error"
          },
          "errors": {
            "type": "array",
            "description": "Field-level validation errors (if applicable)",
            "items": {
              "$ref": "#/components/schemas/ApiErrorItemDto"
            }
          }
        },
        "required": [
          "code",
          "reason"
        ]
      }
    }
  },
  "security": [
    {
      "JWTBearer": []
    }
  ]
}
```