Skip to content

Sources API

All source endpoints are prefixed with /api/sources and require authentication.

GET /api/sources

Returns all sources in your workspace.

Terminal window
curl "https://leads.500rockets.io/api/sources" \
-H "X-API-Key: 5l_live_..."

Response:

[
{
"id": "src_abc123",
"name": "Website Contact Form",
"webhookToken": "tok_...",
"webhookUrl": "https://leads.500rockets.io/api/webhooks/inbound/tok_...",
"fieldMappings": {},
"createdAt": "2026-03-01T12:00:00.000Z",
"createdBy": {
"id": "usr_...",
"name": "Chidi",
"email": "[email protected]"
}
}
]

GET /api/sources/:id

Returns a single source with its webhook URL and field mappings.


POST /api/sources

Creates a new source with a unique webhook token.

Terminal window
curl -X POST "https://leads.500rockets.io/api/sources" \
-H "X-API-Key: 5l_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Landing Page Form",
"fieldMappings": {
"full_name": "firstName",
"email_address": "email"
}
}'

Body:

FieldTypeRequiredDescription
namestringYesHuman-readable name for the source (max 255 chars)
fieldMappingsobjectNoMaps incoming field names to standard lead fields

Response (201):

{
"id": "src_new123",
"name": "Landing Page Form",
"webhookToken": "tok_...",
"webhookUrl": "https://leads.500rockets.io/api/webhooks/inbound/tok_...",
"fieldMappings": {
"full_name": "firstName",
"email_address": "email"
},
"createdAt": "2026-03-02T10:00:00.000Z"
}

PUT /api/sources/:id

Updates a source’s name or field mappings.

Terminal window
curl -X PUT "https://leads.500rockets.io/api/sources/src_abc123" \
-H "X-API-Key: 5l_live_..." \
-H "Content-Type: application/json" \
-d '{ "name": "Updated Form Name" }'

DELETE /api/sources/:id

Deletes a source. Existing leads from this source are preserved but will show the source as deleted.

Terminal window
curl -X DELETE "https://leads.500rockets.io/api/sources/src_abc123" \
-H "X-API-Key: 5l_live_..."

POST /api/sources/:id/regenerate-token

Generates a new webhook token for a source. The old token will stop working immediately.

Terminal window
curl -X POST "https://leads.500rockets.io/api/sources/src_abc123/regenerate-token" \
-H "X-API-Key: 5l_live_..."

Response:

{
"webhookToken": "tok_new...",
"webhookUrl": "https://leads.500rockets.io/api/webhooks/inbound/tok_new..."
}

Use this if you suspect a token has been compromised.

Field mappings let you transform incoming payload field names to the standard lead fields. This is useful when connecting form tools that use different field names.

Standard fields:

FieldTypeDescription
emailstringLead’s email address
firstNamestringFirst name
lastNamestringLast name
phonestringPhone number
companystringCompany or organization name

Example mapping:

If your form sends { "contact_email": "[email protected]", "org": "Acme" }, set field mappings to:

{
"contact_email": "email",
"org": "company"
}