Audiences

Create a streaming CSV import batch

post/public/v1/audience-drafts/{audienceId}/import-batches

Path parameters

audienceIdstring cuid required
Example:example

Request body

recordTypesinteger[] required
overwriteExistingboolean

Example request

{
  "recordTypes": [
    1
  ],
  "recordTypeQueries": [
    {
      "recordTypeId": 1
    }
  ],
  "files": [
    {
      "filename": "example",
      "disposition": "INCLUDE"
    }
  ]
}

Response

Audience upload batch created

Example response

{
  "audience": {
    "id": "example",
    "name": "example",
    "description": "example",
    "status": "DRAFT",
    "source": "FILTER",
    "recordTypes": [
      1
    ],
    "recordTypeQueries": [
      {
        "recordTypeId": 1
      }
    ],
    "search": "example",
    "revision": 1,
    "createdBy": {
      "id": 1,
      "firstName": "example",
      "lastName": "example",
      "avatar": "example"
    },
    "imports": [
      {
        "id": "example",
        "audienceId": "example",
        "filename": "example",
        "disposition": "INCLUDE",
        "status": "PENDING",
        "totalRows": 1,
        "createdRows": 1,
        "linkedRows": 1,
        "completedRows": 1,
        "rejectedRows": 1,
        "error": "example",
        "createdAt": "2024-01-01T12:00:00.000Z",
        "startedAt": "2024-01-01T12:00:00.000Z",
        "completedAt": "2024-01-01T12:00:00.000Z",
        "updatedAt": "2024-01-01T12:00:00.000Z"
      }
    ],
    "importBatches": [
      {
        "id": "example",
        "audienceId": "example",
        "status": "PENDING",
        "version": 1,
        "error": "example",
        "imports": [
          {
            "id": "example",
            "audienceId": "example",
            "filename": "example",
            "disposition": "INCLUDE",
            "status": "PENDING",
            "totalRows": 1,
            "createdRows": 1,
            "linkedRows": 1,
            "completedRows": 1,
            "rejectedRows": 1,
            "error": "example",
            "createdAt": "2024-01-01T12:00:00.000Z",
            "startedAt": "2024-01-01T12:00:00.000Z",
            "completedAt": "2024-01-01T12:00:00.000Z",
            "updatedAt": "2024-01-01T12:00:00.000Z"
          }
        ],
        "cancelRequestedAt": "2024-01-01T12:00:00.000Z",
        "startedAt": "2024-01-01T12:00:00.000Z",
        "completedAt": "2024-01-01T12:00:00.000Z",
        "createdAt": "2024-01-01T12:00:00.000Z",
        "updatedAt": "2024-01-01T12:00:00.000Z"
      }
    ],
    "createdAt": "2024-01-01T12:00:00.000Z",
    "updatedAt": "2024-01-01T12:00:00.000Z"
  },
  "batch": {
    "id": "example",
    "audienceId": "example",
    "status": "PENDING",
    "version": 1,
    "error": "example",
    "imports": [
      {
        "id": "example",
        "audienceId": "example",
        "filename": "example",
        "disposition": "INCLUDE",
        "status": "PENDING",
        "totalRows": 1,
        "createdRows": 1,
        "linkedRows": 1,
        "completedRows": 1,
        "rejectedRows": 1,
        "error": "example",
        "createdAt": "2024-01-01T12:00:00.000Z",
        "startedAt": "2024-01-01T12:00:00.000Z",
        "completedAt": "2024-01-01T12:00:00.000Z",
        "updatedAt": "2024-01-01T12:00:00.000Z"
      }
    ],
    "cancelRequestedAt": "2024-01-01T12:00:00.000Z",
    "startedAt": "2024-01-01T12:00:00.000Z",
    "completedAt": "2024-01-01T12:00:00.000Z",
    "createdAt": "2024-01-01T12:00:00.000Z",
    "updatedAt": "2024-01-01T12:00:00.000Z"
  },
  "imports": [
    {
      "id": "example",
      "audienceId": "example",
      "filename": "example",
      "disposition": "INCLUDE",
      "status": "PENDING",
      "totalRows": 1,
      "createdRows": 1,
      "linkedRows": 1,
      "completedRows": 1,
      "rejectedRows": 1,
      "error": "example",
      "createdAt": "2024-01-01T12:00:00.000Z",
      "startedAt": "2024-01-01T12:00:00.000Z",
      "completedAt": "2024-01-01T12:00:00.000Z",
      "updatedAt": "2024-01-01T12:00:00.000Z"
    }
  ]
}

Changes

Changed in 1 of the 2 revisions of this API.1