Skip to main content
POST
/
auth
/
login
Login
curl --request POST \
  --url https://api.royalti.io/auth/login \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "someone@example.com",
  "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"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

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);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
email
string<email>
required

The email of the user

password
string

The password associated with the username

loginToken
string

loginToken allows user to signin without using password

Response

Success With LoginLink

message
string
workspaces
object[]
refresh_token
string