Skip to main content
These recipes show how to chain API calls for complete recruiting workflows. Each recipe includes the exact endpoints, request bodies, and expected responses.

Manage project pipeline entries

Use this workflow when an integration needs to read candidates from a project, filter them by stage, add new leads to a project, or move existing leads through the pipeline.
1

Get the project stages

Pipeline entry filters use stage IDs, not stage names. Start by reading the project and storing the stage ID you need, for example the Sourced stage.
Response excerpt:
2

List only entries in a given stage

The project is selected by the URL path (/projects/{project_id}/entries). Add stage_id as a query parameter to return only entries currently in that stage for the same project. Values like Sourced are not accepted directly; use the stage UUID returned by GET /projects/{id}.
3

Create or update the contact

If the lead is new, create a contact first:
If the lead already exists and you only need to update their profile, use:
4

Add the contact to the project

Add the contact to the project pipeline. If stage_id is omitted, Leonar adds the contact to the first stage of the project pipeline. Per-contact sequence values can be supplied under custom_variables. Project variables such as project_variable_1 are shared by every entry in the project and must instead be set through PUT /projects/{id} under project_variables.
5

Move an existing project lead to another stage

Use the pipeline entry ID from GET /projects/{id}/entries, then pass the target stage UUID.

Source candidates and add to project

Find candidates on LinkedIn and add them to a recruiting project’s pipeline.
1

Get your connected LinkedIn account

Response — pick an account with api_status.recruiter: "active" or api_status.sales_navigator: "active":
2

Look up location IDs (for LinkedIn filters)

Response:
3

Search LinkedIn profiles

LinkedIn pagination is cursor-based. To load more results, reuse the cursor returned by the previous response. Do not send only page: 2; that can return the same profiles as page 1.
Response — profiles with already_in_project: false can be added:
4

Load the next LinkedIn page

Send the same search body with the returned cursor. The cursor is the value that advances the LinkedIn result set.
5

Add selected profiles to project

Pass the full profile objects directly from the search response. Include experiences, educations, skills, summary, and picture_url to create rich contact records:
The more fields you include, the richer the contact record. Fields like already_in_project and existing_contact_id from the search response are ignored — they are response-only metadata.
Response:

Enrich a contact and find their email

1

Trigger enrichment

Response:
2

Poll until completed

Enrichment is asynchronous. Poll every 5 seconds:
Response when completed:
The email is automatically added to the contact record. No need to update the contact manually.

Enroll contacts in a sequence

1

List available sequences

2

Enroll contacts (simple format)

3

Or enroll with custom variables

Sequence custom variables use fixed placeholder names: {{custom_variable_1}} through {{custom_variable_5}}. Add those placeholders in the sequence step content, then pass per-contact values in custom_variables when enrolling. Arbitrary names like project_name are rejected.Example sequence step:
Example enrollment payload:
At send time, Leonar resolves the example step to something like:
Response:

Create and manage a deal

1

Get pipeline stages

2

Create a deal

3

Link a contact to the deal

4

Move deal through stages

5

Close the deal


Search and tag contacts

1

Create a tag

2

Search contacts

3

Tag matching contacts

For each matching contact:

Send a message to a contact

For LinkedIn messages, specify the channel and optionally the sender account:
For first-time WhatsApp messages, provide an international phone number when the contact does not have an existing WhatsApp chat or provider ID: