curl -X POST "https://api.usegately.com/api/v1/auth/login" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword123"
}'
const response = await fetch('https://api.usegately.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123'
})
})
const data = await response.json()
{
"user": {
"id": "usr_abc123",
"email": "user@example.com",
"user_metadata": {
"role": "member",
"project_id": "your-project-id"
}
},
"session": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_abc123",
"email": "user@example.com"
}
}
}
{
"error": "Invalid email or password"
}
Authentication
Login
Authenticate a user with email and password
POST
/
api
/
v1
/
auth
/
login
curl -X POST "https://api.usegately.com/api/v1/auth/login" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword123"
}'
const response = await fetch('https://api.usegately.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123'
})
})
const data = await response.json()
{
"user": {
"id": "usr_abc123",
"email": "user@example.com",
"user_metadata": {
"role": "member",
"project_id": "your-project-id"
}
},
"session": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_abc123",
"email": "user@example.com"
}
}
}
{
"error": "Invalid email or password"
}
Request Body
string
required
The user’s email address
string
required
The user’s password
Response
object
The authenticated user object
object
Session information with access token
curl -X POST "https://api.usegately.com/api/v1/auth/login" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword123"
}'
const response = await fetch('https://api.usegately.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123'
})
})
const data = await response.json()
{
"user": {
"id": "usr_abc123",
"email": "user@example.com",
"user_metadata": {
"role": "member",
"project_id": "your-project-id"
}
},
"session": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_abc123",
"email": "user@example.com"
}
}
}
{
"error": "Invalid email or password"
}
Was this page helpful?
⌘I