curl --request POST \
--url https://api.royalti.io/auth/login \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "Testpassword"
}
'{
"message": "Successful",
"workspaces": [
{
"workspaceId": "7bd60554-4f63-4c62-a5f6-c29c3f67cb2a",
"name": "Royalti Demo",
"status": "active",
"userType": [
[
"Artist"
]
],
"role": "user"
}
],
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjRlNDI3MjllLWYxNGQtNDhlNy1iNGNiLWMxODliNmQxNThlNiIsIm5hbWUiOiJyZWZyZXNoX3Rva2VuIiwiaWF0IjoxNzA3MzAxNTAxLCJleHAiOjE3MDczODc5MDF9.TPEuW4Fuzycid1sGEeXGZseIK187QE5ECF92WDhcpHE"
}/auth/login
curl --request POST \
--url https://api.royalti.io/auth/login \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "Testpassword"
}
'{
"message": "Successful",
"workspaces": [
{
"workspaceId": "7bd60554-4f63-4c62-a5f6-c29c3f67cb2a",
"name": "Royalti Demo",
"status": "active",
"userType": [
[
"Artist"
]
],
"role": "user"
}
],
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjRlNDI3MjllLWYxNGQtNDhlNy1iNGNiLWMxODliNmQxNThlNiIsIm5hbWUiOiJyZWZyZXNoX3Rva2VuIiwiaWF0IjoxNzA3MzAxNTAxLCJleHAiOjE3MDczODc5MDF9.TPEuW4Fuzycid1sGEeXGZseIK187QE5ECF92WDhcpHE"
}/auth/login endpoint authenticates a user and returns an access token.
Rate Limiting:POST
Request Payload:
| Parameter | Type | Description | Required |
|---|---|---|---|
| string | User’s email address | Yes | |
| password | string | User’s password | Yes |
| rememberMe | boolean | Whether to extend the session duration | No |
Note: The access token should be included in theSecurity:Authorizationheader asBearer <token>for subsequent requests.
const response = await fetch('https://api.royalti.io/auth/login', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"email": "sample-email",
"password": "sample-password",
"loginToken": "sample-loginToken"
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"