---
title: "Create an integration token"
method: POST
path: "/v1/users/{user_id}/tokens"
tags: ["Users"]
---

# Create an integration token

`POST /v1/users/{user_id}/tokens`

## Request

- Base URL: `http://0.0.0.0:3000`
- URL: `http://0.0.0.0:3000/v1/users/{user_id}/tokens`
- Auth: none declared

Creates a short-lived, single-use token (`pit_`) for initiating OAuth flows. This token expires in ~10 minutes.

**Authentication**:
- `Authorization: Bearer <client_secret>` header
- `X-Auth-Type: partner` header (recommended)
- `client_id` in request body

**Usage**: Use the returned token to redirect end-users to connect their Gmail, Slack, or other integrations via the OAuth flow.

**Response**:
- `token`: A `pit_` prefixed integration token
- `expires_at`: ISO 8601 timestamp when the token expires

## Path parameters

- `user_id` string, uuid, required

## Request body

- object
  - `client_id` string, required

## Response `200`

Default Response

- object
  - `success` true, required
  - `data` object, required
    - `token` string, required
    - `expires_at` string, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `404`: Default Response
- `500`: Default Response

---

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