Skip to content

Bulk add targets to a target list
Stable

Request

Adds multiple targets to a target list. Creates target records if they don't exist, then links them to the target list. Existing targets in the list are left unchanged (skipped). Behaves the same as legacy /targets/ API. device_name should be provided for proper target run creation. device_alias can be provided as a direct property and will be stored in device_meta.

Security
pipelines_SCAPIAuthToken
Path
pipeline_idstring, (uuid)required

ID of the Pipeline

targetlist_idstring, (uuid)required

ID of the Target List

Bodyapplication/jsonrequired

Array of device IDs (strings) or device objects with metadata

One of:
Array [
string

Device ID

]
cURL
curl -i -X POST \
  'https://api.esper.io/_mock/openapi/pipelines/v0/pipelines/{pipeline_id}/targetlists/{targetlist_id}/targets-bulk/' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "device_id": "18d21907-a3b3-491b-9237-d835de82a3ef",
      "device_name": "ESPR-LAB-AAA03",
      "device_alias": "Actineon Edge 10A"
    },
    {
      "device_id": "550e8400-e29b-41d4-a716-446655440002",
      "device_name": "ESPR-LAB-AAA04",
      "device_alias": "Actineon Edge 10B"
    }
  ]'

Responses

Bulk add completed successfully

Bodyapplication/json
codeinteger
Example:200
messagestring
Example:"Bulk add completed. 2 target(s) created, 5 target(s) added to list, 1 target(s) skipped."
contentobject
Response
{ "code": 200, "message": "Bulk add completed. 2 target(s) created, 5 target(s) added to list, 1 target(s) skipped.", "content": { "created_count": 2, "added_count": 5, "skipped_count": 1, "errors": [] } }