---
title: "Create Authorization"
method: POST
path: "/v2/auth/tokens"
tags: ["App user provisioning"]
---

# Create Authorization

`POST /v2/auth/tokens`

## Request

- Base URL: `https://api.village.ai`
- URL: `https://api.village.ai/v2/auth/tokens`
- Auth: API key in header `secret-key`

Generate a Bearer token for a user. Use this to authenticate users for API access. Requires your app secret key in the secret-key header. Provide: external_user_id (your unique user identifier) and email. Returns a JWT token valid for 1 year. If the user was previously cancelled, this reactivates them.

## Request body

- CreateTokenRequest: Request body for creating an authentication token
  - `external_user_id` string, required: Unique identifier for the user in your system
  - `email` string, email, required: Email address of the user
  - `grant` 'full' | 'public': Token grant level. 'full' enables sync, paths, and all platform features (billed per user). 'public' enables API-only access like search and enrich (no sync, no user creation).

## Response `200`

Token created successfully

- object
  - `data` TokenResponse, required: Authentication token response
    - `token` string, required: JWT access token for API requests
    - `expires_in` number, required: Token lifetime in seconds
    - `expires_at` number, required: Unix timestamp when token expires
    - `token_type` 'Bearer', required: Token type (always Bearer)
  - `metadata` object, required
    - `request_id` string, required

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - missing or invalid authentication
- `422`: Validation error - invalid external_user_id or email format

---

[API](https://skmtc.dev/village/apis/village-v2-api.md) - [All operations](https://skmtc.dev/village/apis/village-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/village/apis/village-v2-api/revisions/aebe21a1a544?raw)
