Endpoint
Authorization
All requests must include a valid API key in theAuthorization header as a Bearer token.
Path Parameters
The unique identifier of the campaign you want to enroll leads into.
Request Body
An array of lead objects to upsert and enroll. Each object must contain at least an
email address. You may include any additional custom fields beyond the ones listed below — Leadterra will store them on the lead record and make them available as personalization variables in your campaign sequences.Example Request
Response Fields
The number of net-new leads that were created and enrolled in this request.
The number of existing leads whose records were updated and re-enrolled in this request.
The total number of leads processed in this request. Always equal to
enrolled + updated.Example Response
Upsert semantics: Leadterra matches leads by
email address. If a lead with that email already exists in your workspace, their record is updated with the fields you provide in this request and they are added to the campaign — they will not appear as a duplicate entry. Only fields explicitly included in the request body are overwritten; omitted fields retain their existing values.Error Codes
| Code | Meaning |
|---|---|
400 | Bad Request — the request body is malformed or missing required fields. |
401 | Unauthorized — your API key is missing, invalid, or revoked. |
404 | Not Found — no campaign exists for the provided :id in your workspace. |
422 | Unprocessable Entity — one or more lead objects failed validation (e.g. invalid email format). The response body will include a errors array describing each failure. |