Update Integration
Update settings for an existing API integration.
Request
PATCH /api/v1/integrations/{id}
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer {client_token} | Yes |
Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | Integration ID |
Body Parameters
All fields are optional. Only include fields you want to update.
| Parameter | Type | Description |
|---|---|---|
key_label | string | Friendly name |
is_active | boolean | Enable/disable the key |
is_primary | boolean | Set as primary key |
daily_limit | integer | Max requests per day |
minute_limit | integer | Max requests per minute |
spend_limit_amount | decimal | Spend alert threshold |
spend_limit_period | string | daily or monthly |
spend_limit_action | string | warn or block |
warning
You cannot update provider_name or credentials. To change these, delete the integration and create a new one.
Example Requests
Update Limits
curl -X PATCH "https://spideriq.ai/api/v1/integrations/42" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"daily_limit": 20000,
"minute_limit": 200
}'
Disable a Key
curl -X PATCH "https://spideriq.ai/api/v1/integrations/42" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_active": false
}'
Set Spend Limit
curl -X PATCH "https://spideriq.ai/api/v1/integrations/42" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"spend_limit_amount": 1000.00,
"spend_limit_period": "monthly",
"spend_limit_action": "block"
}'
Make Primary
curl -X PATCH "https://spideriq.ai/api/v1/integrations/42" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_primary": true
}'
Response
Success (200 OK)
{
"success": true,
"integration": {
"id": 42,
"provider_name": "openrouter",
"provider_label": "OpenRouter",
"key_label": "Production OpenRouter",
"is_active": true,
"is_primary": true,
"priority": 10,
"daily_limit": 20000,
"daily_count": 1247,
"minute_limit": 200,
"minute_count": 3,
"health_status": "healthy",
"spend_limit_amount": 1000.00,
"spend_limit_period": "monthly",
"spend_limit_action": "block",
"updated_at": "2026-02-26T15:30:00Z"
}
}
Error Responses
404 Not Found - Integration doesn't exist or belongs to another brand
{
"success": false,
"error": "Integration not found"
}
400 Bad Request - Invalid field value
{
"success": false,
"error": "spend_limit_action must be 'warn' or 'block'"
}
Notes
- Setting
is_primary: trueautomatically updatespriorityto 10 - Setting
is_primary: falsesetspriorityto 0 - Disabling a key (
is_active: false) removes it from selection pool - Spend limits take effect on next billing sync