User API
REST API for managing your assets, content, and analytics programmatically
Base URL
https://opttab.com/api/v1/user
Authentication
All requests to the User API must be authenticated using your API key. You can generate API keys from your dashboard at Dashboard → API Settings.
Header Authentication (Recommended)
X-API-Key: your_api_key_here
Example Request
curl -H "X-API-Key: your_api_key_here" \
"https://opttab.com/api/v1/user/assets"
Assets API
Manage your assets with full CRUD operations, filtering, and search capabilities.
/assets
Retrieve your assets with optional filtering and pagination.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| per_page | integer | Items per page (max: 100) |
| status | string | Filter by status |
| category | string | Filter by category |
Example Request
curl -H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/assets?page=1&per_page=10"
Example Response
{
"success": true,
"data": [
{
"id": 1,
"name": "My Profile Photo",
"category": "Likeness: Personal Look (Image)",
"status": "active",
"geo_score": 85,
"visibility_score": 92,
"created_at": "2025-01-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 10,
"total": 45
}
}
/assets
Create a new asset.
Required Fields
name- Asset namecategory- Asset categoryai_models- Array of AI models to opt-in/out
Example Request
curl -X POST \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Profile Photo",
"category": "Likeness: Personal Look (Image)",
"description": "Professional headshot",
"ai_models": ["gpt-4", "claude-3", "gemini-pro"],
"links": ["https://example.com/portfolio"]
}' \
"https://opttab.com/api/v1/user/assets"
/assets/{id}
Update an existing asset.
Example Request
curl -X PUT \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Asset Name",
"description": "Updated description"
}' \
"https://opttab.com/api/v1/user/assets/123"
/assets/{id}
Delete an asset.
Example Request
curl -X DELETE \
-H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/assets/123"
Studio Content API
Create and manage your studio content programmatically.
/studio/content
Retrieve your studio content items.
Example Request
curl -H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/studio/content"
/studio/content
Create new studio content.
Example Request
curl -X POST \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Tutorial",
"content": "Learn how to use our product",
"type": "tutorial",
"tags": ["tutorial", "product"]
}' \
"https://opttab.com/api/v1/user/studio/content"
Analytics API
Access your analytics data, visibility scores, and performance metrics.
/analytics
Get analytics overview for your account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| time_range | string | 7days, 30days, 90days, all |
| asset_id | integer | Filter by specific asset |
Example Request
curl -H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/analytics?time_range=30days"
Example Response
{
"success": true,
"data": {
"visibility_score": 85,
"geo_score": 92,
"total_assets": 45,
"active_campaigns": 3,
"ai_model_coverage": {
"gpt-4": true,
"claude-3": true,
"gemini-pro": true
}
}
}
/analytics/assets/{id}
Get detailed analytics for a specific asset.
Example Request
curl -H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/analytics/assets/123"
Campaigns API
Manage your campaigns programmatically.
/campaigns
Retrieve your campaigns.
Example Request
curl -H "X-API-Key: your_api_key" \
"https://opttab.com/api/v1/user/campaigns"
Error Handling
The API uses standard HTTP response codes to indicate success or failure.
Common Response Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 429 | Rate Limit Exceeded |
| 500 | Internal Server Error |
Error Response Format
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid or expired"
}
}
Rate Limiting
The User API enforces rate limits to ensure fair usage:
- Standard Plan: 100 requests per minute
- Pro Plan: 500 requests per minute
- Enterprise Plan: Custom limits
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1643024400
Need Help?
For additional support or questions about the User API, please contact our team.
Contact Support →