VotePipe

PATCH /v1/organization

Update organization details using a partial update (PATCH) approach. Only the fields you provide in the request body will be modified; all other settings remain unchanged. This endpoint allows you to programmatically update organization settings including Discord webhook URLs, notification preferences, message templates, embed configurations, and admin alert settings. Use this endpoint to automate configuration management, update settings in bulk, integrate with configuration management tools, or synchronize settings across multiple environments. The partial update approach ensures you can modify specific settings without affecting others.


Request

http
PATCH https://api.votepipe.com/v1/organization Authorization: Bearer mr_live_your_api_key_here Content-Type: application/json { "name": "New Name", "settings": { "discord_webhook_url": "https://discord.com/api/webhooks/new", "discord_notifications_enabled": true, "discord_message_type": "embed", "discord_message_template": "🎉 **{{voter_name}}** voted on **{{provider_name}}**!", "discord_embed_template": { "color": 65280, "title": "🎉 New Vote Received!", "description": "**{{voter_name}}** just voted on **{{provider_name}}**", "fields": [ {"name": "Vote ID", "value": "{{vote_id}}", "inline": true} ], "footer": {"text": "VotePipe • Vote Notification"}, "timestamp": "{{received_at}}" } } }

Request Body

FieldTypeRequiredDescription
namestringNoOrganization display name
slugstringNoURL-friendly identifier (changing this will break webhook URLs)
settingsobjectNoOrganization settings (see Settings Fields below)

Settings Fields:

FieldTypeDescription
discord_webhook_urlstring | nullDiscord webhook URL for vote notifications
discord_admin_webhook_urlstring | nullDiscord webhook URL for admin notifications (Growth+)
discord_notifications_enabledbooleanEnable/disable Discord vote notifications
discord_message_typestringMessage type: "simple" (default) or "embed" (Growth+)
discord_message_templatestringCustom message template for simple messages (all plans). Supports variables like {voter_name}, {provider_name}
discord_embed_templateobject | nullCustom embed JSON template for rich embeds (Growth+ only, requires message_type: "embed")
admin_daily_summarybooleanEnable daily admin summary (Growth+)
admin_weekly_summarybooleanEnable weekly admin summary (Growth+)
admin_vote_spike_alertsbooleanEnable vote spike alerts (Growth+)
admin_permanent_fail_alertsbooleanEnable permanent callback failure alerts (Growth+)
admin_usage_warningsbooleanEnable usage warnings at 80% and 100% (Growth+)
server_callback_urlstring | nullServer callback URL for vote events (deprecated, use callbacks endpoint)

Response (200 OK)

json
{ "data": { "id": "1", "slug": "my-server", "name": "New Name", "plan": "pro", "status": "active", "settings": { "discord_webhook_url": "https://discord.com/api/webhooks/new", "discord_admin_webhook_url": null, "discord_notifications_enabled": true, "discord_message_type": "embed", "discord_message_template": "🎉 **{{voter_name}}** voted on **{{provider_name}}**!", "discord_embed_template": { "color": 65280, "title": "🎉 New Vote Received!", "description": "**{{voter_name}}** just voted on **{{provider_name}}**", "fields": [ {"name": "Vote ID", "value": "{{vote_id}}", "inline": true} ], "footer": {"text": "VotePipe • Vote Notification"}, "timestamp": "{{received_at}}" }, "admin_daily_summary": true, "admin_weekly_summary": true, "admin_vote_spike_alerts": true, "admin_permanent_fail_alerts": true, "admin_usage_warnings": true, "server_callback_url": null }, "usage": { "votes_this_month": 1234, "votes_limit": 25000, "providers_count": 5, "providers_limit": 25 } }, "meta": { "request_id": "req_abc123" } }

Error Responses

400 Bad Request - Validation Error

json
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid input", "details": [ { "field": "slug", "message": "Slug already taken" } ] } }

401 Unauthorized

json
{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication required" } }

Example: cURL

bash
curl -X PATCH https://api.votepipe.com/v1/organization \ -H "Authorization: Bearer mr_live_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "New Name", "settings": { "discord_webhook_url": "https://discord.com/api/webhooks/new", "discord_message_type": "embed", "discord_message_template": "🎉 **{{voter_name}}** voted on **{{provider_name}}**!", "discord_embed_template": { "color": 65280, "title": "🎉 New Vote Received!", "description": "**{{voter_name}}** just voted on **{{provider_name}}**", "fields": [{"name": "Vote ID", "value": "{{vote_id}}", "inline": true}], "footer": {"text": "VotePipe • Vote Notification"}, "timestamp": "{{received_at}}" } } }'

Example: JavaScript

javascript
const updateResponse = await fetch('https://api.votepipe.com/v1/organization', { method: 'PATCH', headers: { 'Authorization': 'Bearer mr_live_your_api_key_here', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'New Name', settings: { discord_webhook_url: 'https://discord.com/api/webhooks/new', discord_message_type: 'embed', discord_message_template: '🎉 **{{voter_name}}** voted on **{{provider_name}}**!', discord_embed_template: { color: 65280, title: '🎉 New Vote Received!', description: '**{{voter_name}}** just voted on **{{provider_name}}**', fields: [{name: 'Vote ID', value: '{{vote_id}}', inline: true}], footer: {text: 'VotePipe • Vote Notification'}, timestamp: '{{received_at}}' } } }) }); const updatedData = await updateResponse.json();

Learn More