---
title: "Obtain an access token"
method: POST
path: "/api/v1/auth/login"
tags: ["Auth"]
---

# Obtain an access token

`POST /api/v1/auth/login`

## Request

- Base URL: `https://session-replay.com`
- URL: `https://session-replay.com/api/v1/auth/login`
- Auth: none declared

Exchange credentials for a token pair, or exchange a refresh token for a fresh one. grant_type decides which: 'password' (the default) reads email and password, 'refresh_token' reads refresh_token.

## Request body

- object
  - `grant_type` 'password' | 'refresh_token': Defaults to password
  - `email` string: Password grant only
  - `password` string: Password grant only
  - `name` string: Label for the session being created
  - `refresh_token` string: Refresh token grant only

## Response `200`

tokens issued

## Other responses

- `400`: unsupported grant_type
- `401`: invalid credentials

---

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