---
title: "Generate connection token"
method: POST
path: "/connection/generate_token"
tags: ["Connection Tokens"]
---

# Generate connection token

`POST /connection/generate_token`

This endpoint lets you generate a connection token to authenticate a user without having to indicate its credentials. To be able to generate a connection token for a user, you need to have `WRITE` access on that user and that user cannot have `PROVIDER` role. A connection token is valid only once and has a time to live of maximum one day.

## Request body

- object
  - `user_id` string, required — User id
  - `ttl` integer — Token time to live in seconds. It can be maximum 1 day.

## Response `200`

OK

- object
  - `token` string — New connection token
  - `expiration_date` string, date-time — Expiration date of the newly created token

## Other responses

- `400` — Your request is incorrect
- `401` — You are not authenticated
- `403` — You are not allowed to perform this action
- `404` — Resource does not exist

---

[API](https://skmtc.net/partoo/apis/partoo-rest-api.md) · [All operations](https://skmtc.net/partoo/apis/partoo-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/partoo/partoo-rest-api/revisions/3652d8b1a8b3/schema)
