curl -X POST "https://api.usegately.com/api/v1/auth/verify" \
-H "Authorization: Bearer gately_sk_live_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "token": "MEMBER_ACCESS_TOKEN" }'
{
"valid": true,
"claims": {
"sub": "6f1c2a9e-1b2d-4c7a-9a51-2f0f1e3d4c5b",
"email": "user@example.com",
"project_id": "a3b9c1d2-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"role": "member",
"type": "project_member",
"iat": 1767139200,
"exp": 1767744000
}
}
{
"valid": false,
"error": "Token was not issued for this project"
}
Authentication
Verify Token
Verify a member session token from your backend
POST
/
api
/
v1
/
auth
/
verify
curl -X POST "https://api.usegately.com/api/v1/auth/verify" \
-H "Authorization: Bearer gately_sk_live_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "token": "MEMBER_ACCESS_TOKEN" }'
{
"valid": true,
"claims": {
"sub": "6f1c2a9e-1b2d-4c7a-9a51-2f0f1e3d4c5b",
"email": "user@example.com",
"project_id": "a3b9c1d2-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"role": "member",
"type": "project_member",
"iat": 1767139200,
"exp": 1767744000
}
}
{
"valid": false,
"error": "Token was not issued for this project"
}
Check that a session token sent to your backend was issued by Gately to a member of your project. Gately checks the token’s signature and expiry, and that it belongs to the project that owns the API key.
Use this from your server only. In Node.js,
verifyToken calls this endpoint and caches the result for you.
Requires a secret API key (
gately_sk_...) in the Authorization header. Public keys and project IDs are rejected with 401.Request Body
string
required
The member’s session token (
access_token)Response
boolean
true when the token is valid for your projectobject
string
Why verification failed, present when
valid is false: Token expired, Invalid token, Token was not issued for this project, or an API key errorcurl -X POST "https://api.usegately.com/api/v1/auth/verify" \
-H "Authorization: Bearer gately_sk_live_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "token": "MEMBER_ACCESS_TOKEN" }'
{
"valid": true,
"claims": {
"sub": "6f1c2a9e-1b2d-4c7a-9a51-2f0f1e3d4c5b",
"email": "user@example.com",
"project_id": "a3b9c1d2-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"role": "member",
"type": "project_member",
"iat": 1767139200,
"exp": 1767744000
}
}
{
"valid": false,
"error": "Token was not issued for this project"
}
Was this page helpful?