Skip to main content
Use this endpoint to add or update a batch of leads and immediately enroll them in a specific campaign. Leadterra performs an upsert on each entry: if a lead with a matching email address already exists in your workspace, their record is updated with any new field values you provide and they are re-enrolled in the campaign. New leads are created and enrolled in a single operation, keeping your contact data clean without requiring a separate sync step.

Endpoint

Authorization

All requests must include a valid API key in the Authorization header as a Bearer token.

Path Parameters

string
required
The unique identifier of the campaign you want to enroll leads into.

Request Body

array
required
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

integer
The number of net-new leads that were created and enrolled in this request.
integer
The number of existing leads whose records were updated and re-enrolled in this request.
integer
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