API Reference
Integrate SureProgramming into your workflow with our REST API.
Base URL
https://sureprogramming.com/api
All API endpoints are relative to this base URL.
Authentication
The API supports two authentication methods:
1. Session Authentication (Browser)
When logged in via the web interface, your session cookie is automatically used for API requests.
2. API Key Authentication
For programmatic access, use an API key in the Authorization header:
Authorization: Bearer sp_your_api_key_here
Generate API keys in your account settings.
Response Format
All responses are JSON with the following structure:
Success Response
{
"success": true,
"data": {
// Response data here
}
}
Error Response
{
"success": false,
"error": "Error message here"
}
Endpoints Overview
Authentication
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Create a new account |
POST |
/api/auth/login |
Log in to account |
POST |
/api/auth/logout |
Log out current session |
GET |
/api/auth/me |
Get current user info |
Projects
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/projects |
List all projects |
POST |
/api/projects |
Create a new project |
GET |
/api/projects/{id} |
Get project details |
PUT |
/api/projects/{id} |
Update a project |
DELETE |
/api/projects/{id} |
Delete a project |
Project Tools
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/projects/{id}/tools |
List tools for a project |
POST |
/api/projects/{id}/tools/{type}/enable |
Enable a tool |
POST |
/api/projects/{id}/tools/{type}/disable |
Disable a tool |
Subscription
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/subscription/status |
Get subscription status |
Example: List Projects
curl -X GET https://sureprogramming.com/api/projects \
-H "Authorization: Bearer sp_your_api_key"
Response
{
"success": true,
"data": {
"projects": [
{
"id": 1,
"name": "My iOS App",
"description": "A great iOS application",
"platform": "ios",
"created_at": "2026-09-01T10:00:00Z"
}
]
}
}
Example: Create Project
curl -X POST https://sureprogramming.com/api/projects \
-H "Authorization: Bearer sp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My New Project",
"description": "Project description",
"platform": "web"
}'
Response
{
"success": true,
"data": {
"project": {
"id": 2,
"name": "My New Project",
"description": "Project description",
"platform": "web",
"created_at": "2026-09-01T12:00:00Z"
}
}
}
Rate Limits
API requests are rate limited to ensure fair usage:
- Authentication endpoints: 5 requests per minute
- All other endpoints: 60 requests per minute
Rate limit headers are included in all responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1630000000
HTTP Status Codes
| Code | Description |
|---|---|
200 |
Success |
201 |
Created (for POST requests) |
400 |
Bad Request - Invalid parameters |
401 |
Unauthorized - Invalid or missing authentication |
403 |
Forbidden - Subscription required |
404 |
Not Found - Resource doesn't exist |
429 |
Too Many Requests - Rate limited |
500 |
Internal Server Error |