Update catalog

Use /catalogs/update to update an existing catalog.

Update

post

Update one or multiple profile's data and track events

Authorizations
Header parameters
X-Batch-ProjectstringRequired

The unique project key, identifying a project on the Batch platform

Example: project_0664hxvwffvbpn278gxdyhsadddqgna6
Bodyobject[]

Edit multiple profiles at once. You can specify at most 200 operations or the API call will be rejected.

post
POST /2.6/profiles/update HTTP/1.1
Host: api.batch.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-Batch-Project: text
Content-Type: application/json
Accept: */*
Content-Length: 546

[
  {
    "identifiers": {
      "custom_id": "jane.doe@demobatch.com"
    },
    "attributes": {
      "$email_address": "jane.doe@demobatch.com",
      "$email_marketing": "subscribed",
      "$phone_number": "+33639981337",
      "$sms_marketing": "unsubscribed",
      "$language": "en",
      "$region": "FR",
      "$timezone": "Europe/Paris",
      "firstname": "Jane",
      "date(birthdate)": "1989-07-20T00:00:00Z",
      "interests": [
        "bikes",
        "cinema"
      ],
      "reward_programs": {
        "$add": [
          "premium_customer"
        ]
      }
    },
    "events": [
      {
        "name": "added_to_cart",
        "attributes": {
          "$label": "pumpkin",
          "quantity": 5,
          "unit_price": 3.99,
          "$tags": [
            "fruits",
            "organic",
            "on_sale"
          ]
        }
      }
    ]
  }
]

Request structure

Route

The Catalog API exposes a POST endpoint that allows to update an existing catalog:

/catalogs/update

A catalog can have up to 25 fields.

Headers and authentication

See Overview → Using Project APIs.

Post data

The body of the request must contain a valid JSON payload describing the operations to be executed on the audience.

Here is a how a complete JSON payload looks like:

{
    "name": "MOVIES",
    "fields": [
        {
            "action": "add",
            "name": "director",
            "type": "string"
        },
        {
            "action": "remove",
            "name": "duration"
        }
    ]
}

Responses

Success

If the call to the API endpoint is successful you will receive an HTTP 202 confirmation.

Failure

If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

Last updated

Was this helpful?