Skip to content

Log in to the server

POST
/auth/login
curl --request POST \
--url https://example.com/auth/login \
--header 'Content-Type: application/json' \
--data '{ "username": "example-user", "password": "example-password" }'

Logs a user in to the server and provides access credentials for the requesting client

A login request payload

Media typeapplication/json

A login request payload

object
username
required

The username of the requesting user

string
password
required

The password of the requesting user

string

Successful login

Media typeapplication/json

A response object containing an access token and refresh token

object
access_token
required

The access token generated by the server

string
expires_in
required

The lifetime of the access token, in seconds

number
refresh_token
required

The refresh token generated by the server

string
refresh_expires
required

The UTC timestamp at which the refresh token expires

string format: date-time
refresh_endpoint
required

The endpoint used to refresh the access token

string format: url
Example
{
"access_token": "G6IWgOSDfXylCr8donVs5wlnfaBvv6EszuKcppz9XXbC9AqiT5jp161nN05jghcQ2OQ/JMRvSaUQxf6L9fWVYA==",
"expires_in": 3600,
"refresh_token": "vRT0XmbTHs3KzrPZJD8F92AWnOrPk9o781mQkP63iyZZ8MNzfpd5x5xVRojFrjXmM72vYe3I9v/PR16dzHxgkg==",
"refresh_expires": "2026-07-11T15:30:00Z",
"refresh_endpoint": "/auth/refresh"
}

Unauthorized

Media typeapplication/json

Generic error object

object
error
required

The error message

string
description
required

The error description

string
Example
{
"error": "Unauthorized",
"description": "The username or password is incorrect"
}

Internal server error

Media typeapplication/json

Generic error object

object
error
required

The error message

string
description
required

The error description

string
Example
{
"error": "Internal server error",
"description": "The server encountered an error while processing the request"
}