Introduction
The Stable API gives you programmatic access to your organization's stable management data: horses, bookings, tasks, billing and more, through a RESTful JSON API.
Base URL: https://api.stable.se/v1
All API paths start with /v1. Request and response bodies are JSON.
Prerequisites
Before you begin, you'll need:
- A Stable account with an organization
- The API Access entitlement on your organization plan
- An API token with the scopes you need (see Authentication)
Your First Request
Check which application and organization your token belongs to:
curl https://api.stable.se/v1/auth/token-info \
-H "Authorization: Bearer stl_sk_your_token_here"
The response:
{
"type": "api_token",
"application": { "public_id": "app_example", "name": "Barn sync" },
"organization": { "public_id": "org_example", "name": "Sunrise Stables" },
"scopes": ["read:horses"]
}
Each endpoint has its own access rules, and not every endpoint accepts API tokens. See Authentication.
Key Concepts
Public IDs
All entities use prefixed public IDs:
| Entity | Prefix | Example |
|---|---|---|
| Horse | hrs_ | hrs_abc123 |
| User | usr_ | usr_def456 |
| Organization | org_ | org_xyz789 |
| Booking | bkg_ | bkg_ghi012 |
| Invoice | inv_ | inv_jkl345 |
Use these IDs in all API requests and store them in your system for cross-referencing.
Response Bodies
Response shapes are endpoint-specific. Some endpoints return the resource directly, as token-info does. Others wrap the result in an envelope and put it in data:
{
"status": "200 OK",
"message": null,
"data": { ... },
"error": null,
"code": null
}
Errors share one shape with a machine-readable code:
{
"status": "404 Not Found",
"message": "Horse not found",
"code": "not_found"
}
Content Type
Send Content-Type: application/json with every request that has a body (POST, PATCH, PUT).
Next Steps
- Authentication -- create and manage API tokens
- Pagination -- navigate large result sets
- Error Handling -- understand error responses
- Webhooks -- receive real-time event notifications
- API Reference -- browse all available endpoints