Validate Token
Validate the current access token and retrieve user information.
Use this endpoint to check if a token is still valid and to get current user information and workspace context.
Request
curl -X POST "https://platform.protobox.ai/api/v1/auth/validate" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json"const response = await fetch('https://platform.protobox.ai/api/v1/auth/validate', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + accessToken,
'Content-Type': 'application/json',
}
});
const { data } = await response.json();
console.log('User info:', data.user);import requests
response = requests.post(
'https://platform.protobox.ai/api/v1/auth/validate',
headers={'Authorization': f'Bearer {access_token}'}
)
user_info = response.json()['data']['user']Response
{
"success": true,
"data": {
"valid": true,
"user": {
"id": "user_123",
"email": "user@example.com",
"name": "John Doe",
"current_workspace": {
"id": "ws_456",
"name": "Acme Corp",
"role": "admin"
}
},
"token": {
"expires_at": "2024-01-15T11:30:00Z",
"issued_at": "2024-01-15T10:30:00Z"
}
}
}{
"success": false,
"error": {
"code": "INVALID_TOKEN",
"message": "Token is invalid or expired"
}
}