---
title: "Create a connect token (CLI)"
method: POST
path: "/v1/users/{user_id}/connect-token"
tags: ["Users"]
---

# Create a connect token (CLI)

`POST /v1/users/{user_id}/connect-token`

## Request

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

Generates a short-lived, single-use token (`pit_`) for initiating OAuth flows from the CLI. Accepts `sk_` token auth instead of partner credentials.

**Authentication**:
- `Authorization: Bearer <sk_token>` header
- `X-User-ID: <user_id>` header

**Usage**: Used by `npx @attrove/cli connect <service>` to open a browser OAuth flow.

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

## Path parameters

- `user_id` string, uuid, required

## Response `200`

Default Response

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

## Other responses

- `403`: 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)
