Authentication
Validate API tokens and authenticate requests
Authentication
The Snack Prompt API uses API Key authentication. Include your API key in the x-api-key header with every request.
Required Headers
Header
Value
Required
x-api-key
Your API key
Yes
Content-Type
application/json
For POST/PUT requests
Validates the API token and returns the authenticated user's details, such as ID and email.
Use this endpoint to verify your API key is working correctly before making other requests.
Authorizations
x-api-keystringRequired
API Key authentication. Get your key at snackprompt.com/api-keys.
Example: x-api-key: sk-your-api-key-here
Responses
200
Token is valid
application/json
codeintegerOptionalExample:
200401
Invalid or missing API key
application/json
get/v1/auth/token/validate
curl -X GET "https://api-integrations.snackprompt.com/v1/auth/token/validate" \
-H "x-api-key: YOUR_API_KEY"
{
"code": 200,
"meta": {
"version": "v1.0.2",
"is_authenticaded": true
},
"response": {
"id": "1q2w3e4r5t6y7u8i9o0p",
"name": "John Doe",
"username": "john_doe",
"email": "user@example.com",
"avatar": "http://files.snackprompt.com.....png"
}
}Last updated
Was this helpful?