Quick Start
Get started with the Stateless API in minutes.
Prerequisites
Before you begin, you'll need:
- An API key (see Authentication)
- A configured form ID in your Stateless tenant
Make Your First API Call
Let's submit a simple form with contact information:
1. Prepare Your 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",
"first_name": "Jane",
"last_name": "Smith",
"consents": [
{
"type": "general_contact",
"granted": true
}
]
}'
2. Handle the Response
A successful response returns 200 OK:
{
"success": true,
"message": "Form submission accepted"
}
3. Handle Errors
If something goes wrong, you'll receive an error response:
{
"error": "ValidationError",
"message": "Invalid email address",
"details": {
"field": "email",
"reason": "Must be a valid email address"
}
}
Common Use Cases
Newsletter Signup
{
"form_id": "newsletter-signup",
"email": "user@example.com",
"consents": [
{
"type": "general_contact",
"granted": true,
"deadline": "1y"
}
]
}
Event Registration
{
"form_id": "event-registration",
"email": "attendee@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+15551234567",
"address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94102",
"country": "US"
},
"consents": [
{
"type": "general_contact",
"granted": true,
"deadline": "2026-12-31T23:59:59Z"
}
]
}
Next Steps
- Learn about error handling
- Understand consent management
- Explore the full API reference