Skip to main content
POST
/
api
/
auth
/
login
Login
curl --request POST \
  --url https://copilotz.com/api/auth/login \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "[email protected]",
  "password": "your-password",
  "namespace": "example_namespace"
}
'
{
  "accessToken": "tk_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjRiOTBhYzEwM2ExM...",
  "expiresAt": "2024-05-23T13:53:03.591Z"
}

Body

application/json

Request payload for user authentication.

username
string<email>
required

User's email address used for authentication.

password
string<password>
required

User's password.

Example:

"your-password"

namespace
string
required

Namespace associated with the user's account.

Example:

"example_namespace"

Response

OK

Successful authentication response containing access token and expiration.

accessToken
string
required

JWT access token for authenticated requests.

Example:

"tk_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjRiOTBhYzEwM2ExM..."

expiresAt
string<date-time>
required

Expiration date and time of the access token.

Example:

"2024-05-23T13:53:03.591Z"