Filter engagements by CRM object IDs

Use CRM company, contact, and deal IDs with GET /v2/engagements

View as Markdown

Use GET /v2/engagements with filter[crm_associations][eq] when your app already has IDs from HubSpot, Salesforce, or another connected CRM and you want the related AskElephant engagements.

Request shape

For readability, the examples below use indexed bracket syntax:

filter[crm_associations][eq][0][id]=12345
filter[crm_associations][eq][0][object_type]=company

Those query params represent one CRM association object with this shape:

1[
2 {
3 "id": "123",
4 "object_type": "company"
5 }
6]

The API also accepts the same value as a JSON-encoded array string in filter[crm_associations][eq], but the bracket form is usually easier to read in docs and examples.

When using these raw bracket query params with curl, add --globoff so curl does not treat [] as URL globbing syntax.

Each object includes:

  • id: the CRM record ID from your connected CRM
  • object_type: the CRM object type to match

For engagements, the common object_type values are:

  • company
  • contact
  • deal

The CRM source is inferred from the workspace’s connected CRM. You do not pass a separate CRM provider field.

Filter by CRM company ID

$curl --request GET \
> --globoff \
> --url 'https://app.askelephant.ai/api/v2/engagements?filter[crm_associations][eq][0][id]=12345&filter[crm_associations][eq][0][object_type]=company&order_by=updated_at:desc&limit=25' \
> --header 'Authorization: sk-apik_<id>.<secret>' \
> --header 'Accept: application/json'

Decoded filter value:

1[
2 {
3 "id": "12345",
4 "object_type": "company"
5 }
6]

Filter by CRM contact ID

$curl --request GET \
> --globoff \
> --url 'https://app.askelephant.ai/api/v2/engagements?filter[crm_associations][eq][0][id]=67890&filter[crm_associations][eq][0][object_type]=contact&order_by=updated_at:desc&limit=25' \
> --header 'Authorization: sk-apik_<id>.<secret>' \
> --header 'Accept: application/json'

Decoded filter value:

1[
2 {
3 "id": "67890",
4 "object_type": "contact"
5 }
6]

Filter by CRM deal ID

$curl --request GET \
> --globoff \
> --url 'https://app.askelephant.ai/api/v2/engagements?filter[crm_associations][eq][0][id]=deal_abc123&filter[crm_associations][eq][0][object_type]=deal&order_by=updated_at:desc&limit=25' \
> --header 'Authorization: sk-apik_<id>.<secret>' \
> --header 'Accept: application/json'

Decoded filter value:

1[
2 {
3 "id": "deal_abc123",
4 "object_type": "deal"
5 }
6]

Filter by multiple CRM objects

You can pass more than one CRM object in the same request.

$curl --request GET \
> --globoff \
> --url 'https://app.askelephant.ai/api/v2/engagements?filter[crm_associations][eq][0][id]=12345&filter[crm_associations][eq][0][object_type]=company&filter[crm_associations][eq][1][id]=67890&filter[crm_associations][eq][1][object_type]=contact&filter[crm_associations][eq][2][id]=deal_abc123&filter[crm_associations][eq][2][object_type]=deal&order_by=updated_at:desc&limit=25' \
> --header 'Authorization: sk-apik_<id>.<secret>' \
> --header 'Accept: application/json'

Decoded filter value:

1[
2 {
3 "id": "12345",
4 "object_type": "company"
5 },
6 {
7 "id": "67890",
8 "object_type": "contact"
9 },
10 {
11 "id": "deal_abc123",
12 "object_type": "deal"
13 }
14]

How engagement filtering combines

Engagement filtering uses bucket semantics:

  • AskElephant company_ids and CRM company associations share the company bucket
  • AskElephant contact_ids and CRM contact associations share the participant bucket
  • CRM deal associations populate a deal bucket

Values in the same bucket use OR semantics. Populated buckets combine with AND semantics.

Example: require a CRM company match and a CRM deal match in the same request:

$curl --request GET \
> --globoff \
> --url 'https://app.askelephant.ai/api/v2/engagements?filter[crm_associations][eq][0][id]=12345&filter[crm_associations][eq][0][object_type]=company&filter[crm_associations][eq][1][id]=deal_abc123&filter[crm_associations][eq][1][object_type]=deal&filter[start_at][gte]=2026-03-01T00:00:00.000Z&order_by=updated_at:desc&limit=25' \
> --header 'Authorization: sk-apik_<id>.<secret>' \
> --header 'Accept: application/json'

Limits and tips

  • filter[crm_associations][eq] supports up to 20 CRM association objects.
  • Use CRM record IDs here, not AskElephant cmp_... or cnt_... IDs.
  • Add expand=companies,contacts,owner if you want richer context in the response.

See also: Searching engagements and Pagination and filtering