Skip to main content

Authentication

All Stateless API endpoints require authentication using a bearer token.

API Keys

To access the Stateless API, you need an API key. Contact your organization administrator or reach out to support to obtain an API key.

Using Your API Key

Include your API key in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Example Request

curl -X POST https://api.statelessapp.com/api/v1/forms/accept-submission \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"form_id": "newsletter-signup",
"email": "user@example.com"
}'

Security Best Practices

  • Never commit API keys to version control
  • Store API keys in environment variables or secure configuration management
  • Rotate API keys periodically for enhanced security
  • Use different API keys for development and production environments
  • Limit API key permissions to only what's necessary for your integration

Authentication Errors

If authentication fails, you'll receive a 401 Unauthorized response:

{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}

Common authentication issues:

  • Missing Authorization header
  • Incorrect bearer token format
  • Expired or revoked API key
  • API key without necessary permissions