---
title: "Login"
method: POST
path: "/api/v1/users/token"
tags: ["Session"]
---

# Login

`POST /api/v1/users/token`

With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.

## Response `200`

successful operation

- object
  - `access_token` string — valid for 1 day
  - `expires_in` integer
  - `refresh_token` string — valid for 2 weeks
  - `refresh_token_expires_in` integer
  - `token_type` string

## Other responses

- `400` — Disambiguate via `type`: - `invalid_client` for an unmatched `client_id` - `invalid_grant` for unmatched credentials
- `401` — Disambiguate via `type`: - default value for a regular authentication failure - `invalid_token` for an expired token

---

[API](https://skmtc.net/cpy/apis/peertube.md) · [All operations](https://skmtc.net/cpy/apis/peertube/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpy/peertube/revisions/efe11b159e43/schema)
