V2 API Overview
Introduction to SuperSend's V2 API with improved error handling and standardized responses
SuperSend V2 API provides a more consistent, developer-friendly experience with standardized error handling, proper HTTP status codes, and request tracking.
What's New in V2
request_id on every response{ success, data, request_id }Base URL
https://api.supersend.io/v2All V2 endpoints are prefixed with /v2. V1 endpoints continue to work at /v1.
Authentication
V2 uses the same API key authentication as V1:
curl -X GET 'https://api.supersend.io/v2/teams' \
-H 'Authorization: Bearer YOUR_API_KEY'Get your API key from the Organization Admin Settings.
Response Format
Success Responses
Single Resource (200 OK)
{
"success": true,
"data": {
"id": "abc-123",
"email": "john@example.com",
"first_name": "John"
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}List with Pagination (200 OK)
{
"success": true,
"data": [
{ "id": "1", "email": "a@example.com" },
{ "id": "2", "email": "b@example.com" }
],
"pagination": {
"total": 150,
"limit": 50,
"offset": 0,
"has_more": true
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}Action Message (200 OK)
{
"success": true,
"message": "Contact deleted successfully",
"request_id": "req_a1b2c3d4e5f6789012345678"
}Error Responses
All errors follow this format:
{
"error": {
"type": "invalid_request_error",
"code": "missing_required_parameter",
"message": "TeamId is required",
"param": "TeamId",
"doc_url": "https://docs.supersend.io/docs/errors#missing_required_parameter"
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}See Error Handling for complete error code reference.
Available V2 Endpoints
Core Resources
Teams
GET/v2/teamsGET/v2/teams/:idPOST/v2/teamsPATCH/v2/teams/:idGET/v2/teams/:id/usageContacts
POST/v2/contactsGET/v2/contactsGET/v2/contacts/:idPATCH/v2/contacts/:idDELETE/v2/contacts/:idDELETE/v2/contactsCampaigns
POST/v2/campaignsGET/v2/campaignsGET/v2/campaigns/:idPATCH/v2/campaigns/:idSenders
GET/v2/sendersGET/v2/senders/:idPATCH/v2/senders/:idEvents
GET/v2/eventsGET/v2/events/:idEmail Infrastructure
Sender Profiles
GET/v2/sender-profilesGET/v2/sender-profiles/:idPOST/v2/sender-profilesPATCH/v2/sender-profiles/:idDELETE/v2/sender-profiles/:idDomains
GET/v2/domainsGET/v2/domains/:idPlacement Tests
GET/v2/placement-testsGET/v2/placement-tests/:idPOST/v2/placement-testsBlacklist
GET/v2/blacklistPOST/v2/blacklistDELETE/v2/blacklist/:idIntegration Resources
Labels
GET/v2/labelsGET/v2/labels/:idPOST/v2/labelsPATCH/v2/labels/:idDELETE/v2/labels/:idIdentities (LinkedIn/Twitter)
GET/v2/identitiesGET/v2/identities/:idPATCH/v2/identities/:idDELETE/v2/identities/:idConversations
GET/v2/conversationsGET/v2/conversations/:idPATCH/v2/conversations/:idPOST/v2/conversations/:id/messagesGET/v2/conversations/:id/messagesWebhooks
GET/v2/webhooksGET/v2/webhooks/:idPOST/v2/webhooksPATCH/v2/webhooks/:idDELETE/v2/webhooks/:idPOST/v2/webhooks/:id/testGET/v2/webhooks/:id/deliveriesGET/v2/webhooks/:id/deliveries/:deliveryIdPOST/v2/webhooks/:id/deliveries/:deliveryId/retrySee Webhooks Documentation for full details on delivery logs and retry functionality.
Utility
GET/v2/healthGET/v2/openapi.yamlGET/v2/openapi.jsonRequest ID
Every V2 response includes a unique request_id:
"request_id": "req_a1b2c3d4e5f6789012345678"X-Request-Id: req_a1b2c3d4e5f6789012345678Use request IDs for:
Always log request IDs in your application:
const response = await fetch(url, options)
const requestId = response.headers.get('X-Request-Id')
const data = await response.json()console.log(Request ${requestId}: ${response.status})
if (!data.success) {
console.error(Error: ${data.error.code} - ${data.error.message})
}
Pagination
List endpoints support pagination with limit and offset:
# First page (50 items)
GET /v2/contacts?TeamId=xxx&limit=50&offset=0# Second page
GET /v2/contacts?TeamId=xxx&limit=50&offset=50
Pagination Response:
{
"pagination": {
"total": 150,
"limit": 50,
"offset": 50,
"has_more": true
}
}Use has_more to know if there are more pages.
V1 vs V2 Comparison
Error Handling
V1 (inconsistent):
// Sometimes 200 with error in body
{ "error": "Campaign not found" }// Sometimes proper status
// Status 404
{ "success": false, "error": "Not found" }
V2 (consistent):
// Always correct HTTP status with structured error
// Status 404
{
"error": {
"type": "not_found_error",
"code": "campaign_not_found",
"message": "Campaign not found"
},
"request_id": "req_..."
}Success Responses
V1:
// Various formats
{ "message": "Success", "contact": {...} }
{ "success": true, "data": {...} }
{ "contacts": [...] }V2:
// Always consistent
{
"success": true,
"data": {...},
"request_id": "req_..."
}Migration Guide
Migrating from V1 to V2 is straightforward:
/v1/ → /v2/-
/v1/contact/create → POST /v2/contacts-
/v1/auto/contacts → GET /v2/contactsrequest_id for debuggingSee V1 to V2 Migration for detailed migration guide.