Skip to main content

Targeting API

API for Targeting

Quick Startโ€‹

# List available operations
epilot targeting

# Call an operation
epilot targeting changeCampaignStatus -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

Common Flagsโ€‹

FlagDescription
-p key=valueSet a named parameter
-d '{...}'Request body JSON
-H 'Key: Value'Custom header
-t, --token <token>Bearer token for authentication
--profile <name>Use a named profile
-s, --server <url>Override server base URL
-i, --includeInclude response headers in output
--jsonOutput raw JSON (no formatting)
-v, --verboseVerbose output (show request details)
--jsonata <expr>JSONata expression to transform response
--definition <file>Override OpenAPI spec file/URL
--guidedPrompt for all parameters interactively
--no-interactiveDisable interactive prompts

Operationsโ€‹

Campaign

Campaign Delivery

Target

  • matchTargets โ€” Find targets from the provided list that include the provide entities.
  • getTargetQueries โ€” Transform target filters into Lucene queries for the provided target IDs.

Campaign Recipient

changeCampaignStatusโ€‹

Change the status of a campaign to a desired status.

POST /v1/campaign/{campaign_id}/status

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID

Sample Call

epilot targeting changeCampaignStatus \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

Using positional args for path parameters:

epilot targeting changeCampaignStatus b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting changeCampaignStatus -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'campaign'
Sample Response
{
"campaign": {
"_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"_org": "string",
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"_schema": "string",
"_title": "string",
"_tags": ["string"],
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"name": "string",
"goal": "string",
"status": "draft",
"start_date": "1970-01-01",
"end_date": "1970-01-01",
"flow_id": "string",
"job_id": "string",
"target": {
"$relation": [
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"_tags": ["string"]
}
]
}
}
}

getCampaignJobStatusโ€‹

Get the status of a campaign's automation job

GET /v1/campaign/{campaign_id}/job

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID

Sample Call

epilot targeting getCampaignJobStatus \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

Using positional args for path parameters:

epilot targeting getCampaignJobStatus b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting getCampaignJobStatus -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'status'
Sample Response
{
"status": "queued",
"execution_summary": [
{
"execution_id": "string",
"execution_status": "string"
}
]
}

getCampaignPortalsโ€‹

Get the list of portals and its widgets where the campaign is used.

GET /v1/campaign/{campaign_id}/portals

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID

Sample Call

epilot targeting getCampaignPortals \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

Using positional args for path parameters:

epilot targeting getCampaignPortals b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting getCampaignPortals -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata '$'
Sample Response
[
{
"portal": {
"origin": "string",
"domain": "string",
"name": "string"
},
"widgets": [
{
"id": "string",
"headline": {
"en": "string",
"de": "string"
}
}
]
}
]

retriggerCampaignAutomationsโ€‹

Retrigger automation executions for specific campaign recipients that have failed.

POST /v1/campaign/{campaign_id}/automations:retrigger

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID

Request Body (required)

Sample Call

epilot targeting retriggerCampaignAutomations \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-d '{"recipient_ids":["3fa85f64-5717-4562-b3fc-2c963f66afa6"]}'

Using positional args for path parameters:

epilot targeting retriggerCampaignAutomations b8c01433-5556-4e2b-aad4-6f5348d1df84

Using stdin pipe:

cat body.json | epilot targeting retriggerCampaignAutomations -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting retriggerCampaignAutomations -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'results[0]'
Sample Response
{
"message": "string",
"results": [
{
"recipient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": "success",
"execution_id": "string",
"error": "string"
}
]
}

matchCampaignsโ€‹

Match campaigns based on target entities.

POST /v1/campaign:match

Request Body (required)

Sample Call

epilot targeting matchCampaigns

With request body:

epilot targeting matchCampaigns \
-d '{
"entity_refs": [
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string"
}
],
"campaign_ids": ["b8c01433-5556-4e2b-aad4-6f5348d1df84"]
}'

Using stdin pipe:

cat body.json | epilot targeting matchCampaigns

With JSONata filter:

epilot targeting matchCampaigns --jsonata 'results[0]'
Sample Response
{
"hits": 0,
"results": [
{
"campaign": {
"_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"_org": "string",
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"_schema": "string",
"_title": "string",
"_tags": ["string"],
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"name": "string",
"goal": "string",
"status": "draft",
"start_date": "1970-01-01",
"end_date": "1970-01-01",
"flow_id": "string",
"job_id": "string",
"target": {
"$relation": [
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"_tags": ["string"]
}
]
}
}
}
]
}

matchTargetsโ€‹

Find targets from the provided list that include the provide entities.

POST /v1/target:match

Request Body (required)

Sample Call

epilot targeting matchTargets

With request body:

epilot targeting matchTargets \
-d '{
"entity_refs": [
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string"
}
],
"target_ids": ["b8c01433-5556-4e2b-aad4-6f5348d1df84"]
}'

Using stdin pipe:

cat body.json | epilot targeting matchTargets

With JSONata filter:

epilot targeting matchTargets --jsonata 'results[0]'
Sample Response
{
"hits": 0,
"results": [
{
"target": {
"_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"_org": "string",
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"_schema": "string",
"_title": "string",
"_tags": ["string"],
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"name": "string",
"description": "string",
"entity_schema": "string",
"entity_filters": {}
}
}
]
}

getTargetQueriesโ€‹

Transform target filters into Lucene queries for the provided target IDs.

POST /v1/target/queries

Request Body (required)

Sample Call

epilot targeting getTargetQueries \
-d '{"target_ids":["b8c01433-5556-4e2b-aad4-6f5348d1df84"]}'

Using stdin pipe:

cat body.json | epilot targeting getTargetQueries

With JSONata filter:

epilot targeting getTargetQueries --jsonata 'results[0]'
Sample Response
{
"results": [
{
"target_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"query": "string",
"error": "string"
}
]
}

createRecipientโ€‹

Creates a new recipient associated with a campaign.

POST /v1/campaign/{campaign_id}/recipient

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID

Request Body (required)

Sample Call

epilot targeting createRecipient \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

With request body:

epilot targeting createRecipient \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-d '{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string",
"automation_status": "pending",
"automation_execution_id": "string"
}'

Using positional args for path parameters:

epilot targeting createRecipient b8c01433-5556-4e2b-aad4-6f5348d1df84

Using stdin pipe:

cat body.json | epilot targeting createRecipient -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting createRecipient -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'entity_id'
Sample Response
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string",
"title": "string",
"automation_status": "pending",
"automation_execution_id": "string",
"portal_status": "sent",
"portal_status_updated_at": "1970-01-01T00:00:00.000Z",
"portal_state": {},
"updated_at": "1970-01-01T00:00:00.000Z"
}

updateRecipientโ€‹

Updates a recipient's attributes.

PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID
recipient_idpathstring (uuid)YesThe entity ID of the recipient

Request Body (required)

Sample Call

epilot targeting updateRecipient \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-d '{"automation_status":"pending","automation_execution_id":"string","portal_status":"sent","portal_state":{}}'

Using positional args for path parameters:

epilot targeting updateRecipient b8c01433-5556-4e2b-aad4-6f5348d1df84 b8c01433-5556-4e2b-aad4-6f5348d1df84

Using stdin pipe:

cat body.json | epilot targeting updateRecipient -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 -p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting updateRecipient -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 -p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'entity_id'
Sample Response
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string",
"title": "string",
"automation_status": "pending",
"automation_execution_id": "string",
"portal_status": "sent",
"portal_status_updated_at": "1970-01-01T00:00:00.000Z",
"portal_state": {},
"updated_at": "1970-01-01T00:00:00.000Z"
}

updateRecipientPortalStatusโ€‹

Updates the portal status for a specific campaign recipient.

PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID
recipient_idpathstring (uuid)YesThe entity ID of the recipient

Request Body (required)

Sample Call

epilot targeting updateRecipientPortalStatus \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 \
-d '{"status":"sent"}'

Using positional args for path parameters:

epilot targeting updateRecipientPortalStatus b8c01433-5556-4e2b-aad4-6f5348d1df84 b8c01433-5556-4e2b-aad4-6f5348d1df84

Using stdin pipe:

cat body.json | epilot targeting updateRecipientPortalStatus -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 -p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting updateRecipientPortalStatus -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 -p recipient_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'entity_id'
Sample Response
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string",
"title": "string",
"automation_status": "pending",
"automation_execution_id": "string",
"portal_status": "sent",
"portal_status_updated_at": "1970-01-01T00:00:00.000Z",
"portal_state": {},
"updated_at": "1970-01-01T00:00:00.000Z"
}

getRecipientsโ€‹

Get a paginated list of recipients for a campaign.

GET /v1/campaign/{campaign_id}/recipients

Parameters

NameInTypeRequiredDescription
campaign_idpathstring (uuid)YesThe campaign ID
limitquerynumberNoNumber of items to return
nextquerystringNoCursor for pagination
qquerystringNoSearch by recipient title
automation_statusquery"pending" | "in_progress" | "success" | "failed" | "cancelled"NoFilter by automation status
portal_statusquery"sent" | "seen" | "dismissed" | "clicked"NoFilter by portal status

Sample Call

epilot targeting getRecipients \
-p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84

Using positional args for path parameters:

epilot targeting getRecipients b8c01433-5556-4e2b-aad4-6f5348d1df84

With JSONata filter:

epilot targeting getRecipients -p campaign_id=b8c01433-5556-4e2b-aad4-6f5348d1df84 --jsonata 'results[0]'
Sample Response
{
"results": [
{
"entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
"entity_schema": "string",
"title": "string",
"automation_status": "pending",
"automation_execution_id": "string",
"portal_status": "sent",
"portal_status_updated_at": "1970-01-01T00:00:00.000Z",
"portal_state": {},
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"next": "string",
"total": 0
}