Leads
Create leads with or without a sponsor and update them with complete curl request examples.
Build a request
Example data only. No request is sent.
curl --fail-with-body --silent --show-error --globoff --max-time 30 --request POST \
--url "${BRELLA_API_BASE_URL}"'/api/core/organizations/123/events/456/leads' \
--header "Accept: application/vnd.brella.v4+json" \
--header "Brella-API-Access-Token: ${BRELLA_API_ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--data-raw '{
"registrant_id": 1201,
"notes": "Requested pricing information"
}'{
"data": {
"id": "1201",
"type": "lead"
}
}The token scope determines returned fields. This selector illustrates that configuration; it does not change your token or the request.
Collection path: events/{event_id}/leads
The target registrant and any supplied creator, sponsor, or lead-scan answers must belong to the URL event. The scope’s sponsor row restriction also limits which existing leads can be patched.
POST a lead
Without a sponsor
Use a scope with no sponsor row restriction. Omit sponsor_id, as in this example, or send "sponsor_id": null.
View the minimal cURL example
curl --fail-with-body --silent --show-error --globoff --max-time 30 --request POST \
--url "${BRELLA_API_BASE_URL}"'/api/core/organizations/123/events/456/leads' \
--header "Accept: application/vnd.brella.v4+json" \
--header "Brella-API-Access-Token: ${BRELLA_API_ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--data-raw '{
"registrant_id": 1201,
"notes": "Requested pricing information"
}'Success returns 201 Created with response type lead. Select sponsor_ids in Write-response fields to receive sponsor-ids: []. The lead can then be read within its registrant’s event by a scope without sponsor restrictions.
For a sponsor
Include sponsor_id to assign the lead to a sponsor in the event:
View the complete cURL example
curl --fail-with-body --silent --show-error --globoff --max-time 30 --request POST \
--url "${BRELLA_API_BASE_URL}"'/api/core/organizations/123/events/456/leads' \
--header "Accept: application/vnd.brella.v4+json" \
--header "Brella-API-Access-Token: ${BRELLA_API_ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--data-raw '{
"sponsor_id": 103705,
"registrant_id": 1201,
"created_by_registrant_id": 1301,
"notes": "Requested pricing information"
}'With a sponsor-restricted scope, an omitted or null sponsor_id selects the first configured restricted sponsor. For a scope restricted to exactly one sponsor, that sponsor is used. Supply an explicit allowed ID when choosing among several restricted sponsors. A sponsor outside the event or restricted set returns 404; omitting the input does not bypass the restriction to create a lead without a sponsor.
Useful write-response fields include event_id, sponsor_ids, registrant_id, created_by_registrant_id, notes, and updated_at.
PATCH a lead
This example updates notes and saves lead-scan answers. Each answer identifies the sponsor and question definition that own the answer.
View the complete cURL example
curl --fail-with-body --silent --show-error --globoff --max-time 30 --request PATCH \
--url "${BRELLA_API_BASE_URL}"'/api/core/organizations/123/events/456/leads/3898' \
--header "Accept: application/vnd.brella.v4+json" \
--header "Brella-API-Access-Token: ${BRELLA_API_ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--data-raw '{
"notes": "Requested pricing and a Q4 follow-up",
"custom_fields_attributes": [
{
"sponsor_id": 103705,
"question_id": 901,
"values": [
"Q4"
]
}
]
}'Omitting sponsor_id preserves existing ownership. Sending an explicit sponsor ID replaces all ownerships for an unrestricted scope, or only the visible restricted ownership set for a restricted scope. Sending "sponsor_id": null returns 404; PATCH does not use the POST fallback or clear ownership.
A sponsor-restricted scope receives 404 when attempting to read or patch a lead without a sponsor. For event exports that include those leads, see Export leads with registrant details.
An unrestricted scope may reassign created_by_registrant_id; a sponsor-restricted scope receives 404 for that reattribution attempt. A lead created without a creator can legitimately return created-by-registrant-id: null.
Input reference
5 inputs. Expand a field for its request type and update behavior. These are the example request keys; your administrator can configure aliases.
sponsor_idScalar ID or `null`
- POST
- Optional; omission or null uses the scope's sponsor fallback, if any
- PATCH
- Optional; omit to preserve ownership, null is not accepted
With no sponsor row restriction, POST accepts an omitted or null sponsor_id and creates a lead without a sponsor. With restricted sponsors, omission or null selects the first configured restricted sponsor. An explicit ID must belong to the event and any restricted set. On PATCH, an explicit ID replaces all ownerships for an unrestricted scope, or only the visible restricted ownership set for a restricted scope; omitted sponsor_id leaves ownership unchanged and null returns 404.
registrant_idScalar ID
- POST
- Required for a successful create
- PATCH
- Optional
Target registrant; must belong to the event.
created_by_registrant_idScalar ID
- POST
- Optional
- PATCH
- Optional for unrestricted scopes
Creator/scanner registrant. Sponsor-restricted scopes cannot change it on PATCH.
notesScalar string or `null`
- POST
- Optional
- PATCH
- Optional
Lead notes.
custom_fields_attributesArray of objects
- POST
- Ignored
- PATCH
- Optional
Lead-scan answers are processed only on PATCH.