v1.0.0
OpenAPI 3.1.0

Export customer data

US region

Client Libraries

Export customer data

Provide filters and attributes describing the customers you want to export. This endpoint returns export metadata; use the /exports/{export_id}/endpoint to download your export.

Body
application/json
  • filters
    required

    Use and, or, and not to combine segment and attribute conditions. The top-level object accepts one property; nest groups for complex filters.

    Use and, or, and not to combine segment and attribute conditions. The top-level object accepts one property; nest groups for complex filters.

    • and
      Type: array object[]

      Match all conditions to return results.

  • attributes
    Type: array string[]

    Recipient attributes you want to include as extra columns in your export.

Responses
  • application/json
  • 400

    The request is malformed.

  • 429

    Your request is over the 10-per-second limit.

Request Example for post/v1/exports/customers
curl https://api.customer.io/v1/exports/customers \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "filters": {
    "and": [
      {
        "segment": {
          "id": 3
        }
      },
      {
        "or": [
          {
            "attribute": {
              "field": "interest",
              "operator": "eq",
              "value": "roadrunners"
            }
          },
          {
            "attribute": {
              "field": "state",
              "operator": "eq",
              "value": "NM"
            }
          },
          {
            "not": {
              "attribute": {
                "field": "species",
                "operator": "eq",
                "value": "roadrunners"
              }
            }
          }
        ]
      }
    ]
  }
}'
{
  "export": {
    "id": 110,
    "user_id": 0,
    "user_email": "person@email.com",
    "total": 1234,
    "deduplicate_id": "110:1530296738",
    "type": "customers",
    "failed": false,
    "status": "done",
    "description": "Customers with segment filters—in \\Purchased Flowers\\",
    "downloads": 2,
    "created_at": 1530296738,
    "updated_at": 1530296738
  }
}