- Sequences are created by users in the web app
- The API client lists the sequences via API applying the necessary filters
-
Collect the sequences from
response.sequences -
Iterate the endpoint through
response._links.next.hrefwhile respecting theRetry-AfterHTTP Header - Add leads to the desired sequences
Sequences Endpoints
List Sequences
Sequence Object
dynamic_fields_used can include more fields than are strictly required to add a lead. It lists every field the sequence’s active stages reference, including ones that have a fallback and therefore don’t need to be present on every lead:- Fields referenced only inside a conditional block (e.g.
{% if custom_field_1 %}...{% elsif custom_field_2 %}...{% endif %}) — the sequence renders fine even if none of them are present on a given lead, since the block is simply skipped. - Fields with a Liquid
defaultfilter (e.g.{{ company_name | default: "there" }}) — the sequence falls back to the default value when the field is missing.
missing_lead_field error described below.Request format
Retrieve a list of Sequences:name(case insensitive search)statuscreated_by_user_idcreated_by_user_email
Response
This will return a200 OK with a list of Sequences:
response._links.next.href (e.g. GET /sequences?page[after]=e6890fa2c0453fd2691c06170293131678deb47b&page[size]=20).
Links
-
self-GETpoints back to the same object -
next-GETpoints to the next page of entries, when available -
prev-GETpoints to the previous page of entries, when available
Add leads to a Sequence
This endpoint allows users to add one or more leads to an existing active sequence in Amplemarket. It supports flexible lead management with customizable distribution settings, real-time validations, and asynchronous processing for improved scalability. For specific API details, please refer to the API specification.This endpoint does not update leads already in sequence, it can only add new ones
Choosing the sequence
A sequence is identified by itsid, which is used in the POST request:
- Use the “List Sequences” endpoint
- Go to the Amplemarket Dashboard, navigate to Sequences, and choose your Sequence.
- In the URL bar of your browser, you will find a URL that looks like this:
https://app.amplemarket.com/dashboard/sequences/cb4925debf37ccb6ae1244317697e0f - In this case, the sequence
idiscb4925debf37ccb6ae1244317697e0f
Request format
The request has two main properties:leads: An array of objects, each of them representing a lead to be added to the sequence. Each lead object must include at least anemailorlinkedin_urlfield at the root level of the object. These properties are used to check multiple conditions, including exclusion lists and whether they are already present in other sequences. If you do not have either one, you may omit the field or set it tonull. Other supported properties:data: holds other lead data fields, such asfirst_nameandcompany_domainoverrides: used to bypass certain safety checks. It can be omitted completely or partially, and the default value isfalsefor each of the following overrides:ignore_recently_contacted: whether to override the recently contacted check. Note that the time range used for considering a given lead as “recently contacted” is an account-wide setting managed by your Amplemarket account administratorignore_exclusion_list: whether to override the exclusion listignore_duplicate_leads_in_other_draft_sequences: whether to bypass the check for leads with the sameemailorlinkedin_urlpresent in other draft sequencesignore_duplicate_leads_in_other_active_sequences: whether to bypass the check for leads with the sameemailorlinkedin_urlpresent in other active or paused sequences
settings: an optional object storing lead distribution configurations affecting all leads:leads_distribution: a string that can have 2 values:sequence_senders: (default) the leads will be distributed across the mailboxes configured in the sequence settingscustom_mailboxes: the leads will be distributed across the mailboxes referred to by the/settings/mailboxesproperty, regardless of the sequence setting.
mailboxes: an array of email addresses, that must correspond to mailboxes connected to the Amplemarket account. If/settings/leads_distributioniscustom_mailboxes, this property will be used to assign the leads to the respective users and mailboxes. Otherwise, this property is ignored.
Request limits
Each request can have up to 250 leads, if you try to send more, the request will fail with an HTTP 400. Besides theemail and linkedin_url, each lead can have up to 50 data fields on the data object.
Both the data field names and values must be of the type String, field names can be up to 255 characters while values can be up to 1024 characters.
The names of the data fields can only have lowercase letters, numbers or underscores (_),
and must start with a letter. Some examples of rejected data field names:
Request example
Response format
There are 3 potential outcomes:-
The request is successful, and it returns the number of leads that were added and skipped due to safety checks. Example:
Checks corresponding to
in_exclusion_list_and_skipped,recently_contacted_and_skipped,in_other_draft_sequences_and_skipped, andin_other_active_sequences_and_skippedcan be bypased by using theoverridesproperty on the lead object -
The request was malformed in itself. In that case, the response will have the HTTP Status code
400, and the body will contain an indication of the error, following the standard format. -
The request was correctly formatted, but due to other reasons the request cannot be completed.
The response will have the HTTP Status code
422, and a single propertyvalidation_errors, which can indicate one or more problems. Example
Error codes and their explanations
Allerror_code values have an associated message giving more details about the specific cause of failure.
Some of the errors include:
Common errors and pitfalls
- Invalid email field: do not use placeholder values like
"unknown"or"N/A". It is best to ommit the field or set it tonull. - Linkedin URL field: to be used as an identifier of the lead, it should be put at the top level of the lead, not inside the
datapart of the lead.
Remove a contact from sequences
This endpoint removes a contact from every sequence it is in, or from the sequences you choose. Removal works across the whole account, whoever owns the sequence, and includes Duo sequences. Archived sequences are ignored. For specific API details, refer to the API specification for listing a contact’s sequences and removing a contact from sequences. Example flow:-
Find the contact’s
id, for example with the Get contact by email endpoint -
List the contact’s sequences with
GET /contacts/{id}/sequences, followingresponse._links.next.hrefto get every page -
Remove the contact from all of them, or send the
idof each sequence to remove it from
Listing the contact’s sequences
page[size], 10 by default), and _links.next is present while there are more.
A contact can appear more than once in the same sequence, for example after two duplicate contacts are merged. Each entry is a separate lead, and
created_at tells them apart.Request format
sequence_ids: an array of sequence IDs, as returned by the endpoint above or by List Sequences, with up to 250 IDs.- Leave it out to remove the contact from every sequence it is in.
- When present, it must be a non-empty array of strings; an empty array is rejected rather than treated as “all”.
Request examples
Remove the contact from two sequences:{}.
Response format
A successful request returns sequence IDs grouped by what happened to each:
Removals finish in the background, so the sequence page can take a few moments to show the lead as removed.
Error codes and their explanations
The body of an error response follows the standard format.
Common errors and pitfalls
- Sending
"sequence_ids": []to mean “all”: leave the property out instead. - Sending the body without
Content-Type: application/json: the request is rejected with a 415 instead of being read.