> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Push Import

> Import iOS and Android devices from OneSignal, Braze, Customer.io or a CSV

Creates a draft import and returns its warnings. Nothing is read from the source until you [start it](https://docs.sequenzy.com/api-reference/push/start-import.md). Requires the `subscribers:write` scope.

What an import does:

* Only iOS (APNs) and Android (FCM) devices are imported. Web push subscriptions are tied to the previous provider's VAPID keys and cannot be moved, so they are skipped.
* Opted-in devices are linked to a contact by external ID, then email. When no contact matches, a contact is created without joining lists or starting sequences. A device with only an unknown external ID gets a push-only contact with no email or phone; email and SMS sends skip it. A device whose email belongs to a contact with a different external ID is skipped as `identity_conflict`.
* Devices the source reports as opted out are stored as `unsubscribed` and never receive push.
* Tokens Sequenzy already has (for example registered by your app through the SDK) are left as they are and counted as `matched`. Devices are matched on the token, so when your app later registers an imported token through the SDK, it updates the same device.
* With `importAttributes`, source tags and custom attributes are copied onto contacts only for keys a contact does not have yet.
* Tokens that cannot work are rejected as `invalid`: iOS tokens that are FCM tokens (Customer.io apps that send iOS through FCM), Firebase installation IDs and malformed tokens.

## Body

**source** `string` *required*

`onesignal`, `braze`, `customer_io`, or `csv`.

**apiKey** `string`

Required except for `csv`. A OneSignal App API key, a Braze REST API key with the `users.export.segment` permission, or a Customer.io App API key. Stored encrypted and never returned. It is deleted once the devices are read, or when the import is canceled; a failed import keeps it so you can resume.

**onesignalAppId** `string`

Required for `onesignal`. The App ID (a UUID) from Settings, Keys & IDs.

**brazeRestEndpoint** `string`

Required for `braze`. Your instance's REST endpoint, such as `rest.iad-01.braze.com`. Only Braze REST hosts are accepted.

**brazeSegmentId** `string`

Required for `braze`. The API identifier of a segment with the users to import.

**customerIoRegion** `string` (default: us)

`us` or `eu`.

**customerIoSegmentId** `string`

Required for `customer_io`. The ID of a segment with the people to import.

**platforms** `string[]`

`ios` and/or `android`. Defaults to both.

**importAttributes** `boolean` (default: true)

Copy source tags and attributes onto contacts, filling only missing keys.

**appIds** `string[]`

Only import devices of these source apps (Braze app name, Customer.io `app_identifier`, CSV `app_id`). Devices without an app are kept.

**csv** `string`

`csv` source only: the file, or its first part, at most 5 MB. Send more parts with [Add CSV rows](https://docs.sequenzy.com/api-reference/push/add-import-rows.md). Columns:
`token` (or `push_token`, `device_token`, `identifier`) and `platform` (`ios`, `android`, or OneSignal `device_type` codes) are required; `external_id` or `email` find the contact; optional `status` or `subscribed` (blank means opted in), `unsubscribed`, `app_id`, `last_active`, `token_type`, `app_version`, `os_version`, `device_model`, `locale`, `timezone` and `attribute.<name>` columns. OneSignal's own subscription export is read as is.

**csvParts** `integer`

`csv` source only, sent with `csv`. How many parts you will send, including this first one (1 to 10,000). When set, [Start](https://docs.sequenzy.com/api-reference/push/start-import.md) returns 409 until every part has been added, so an upload that stops part-way is never imported partially, and a part beyond the declared count returns 409. `progress.csvParts` shows the parts received. Recommended whenever you send more than one part; the CLI and dashboard always set it.

```bash theme={null}
curl https://api.sequenzy.com/api/v1/push/imports \
  --request POST \
  --header "Authorization: Bearer $SEQUENZY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "source": "onesignal",
    "apiKey": "os_v2_app_...",
    "onesignalAppId": "1b2c3d4e-0000-4000-8000-00000000abcd"
  }'
```

## Responses

```json 201 theme={null}
{
  "success": true,
  "import": {
    "id": "pimp_123",
    "source": "onesignal",
    "sourceLabel": "OneSignal",
    "status": "draft",
    "config": { "platforms": ["ios", "android"], "importAttributes": true, "onesignal": { "appId": "1b2c3d4e-0000-4000-8000-00000000abcd" } },
    "progress": { "recordsRead": 0, "totalRows": 0, "processedRows": 0, "percent": null },
    "counts": { "imported": 0, "matched": 0, "unsubscribed": 0, "skipped": 0, "invalid": 0, "subscribersCreated": 0 },
    "skippedReasons": {},
    "invalidReasons": {},
    "warnings": [
      { "code": "android_not_configured", "severity": "warning", "message": "Firebase is not set up. Android devices are imported but receive nothing until you add a service account from the same Firebase project your app used with OneSignal." }
    ],
    "error": null,
    "stalled": false,
    "canResume": false
  },
  "message": "Draft created. Review the warnings, then start it."
}
```

```json 400 theme={null}
{
  "error": "onesignalAppId is required: the OneSignal App ID (a UUID) from Settings > Keys & IDs."
}
```

```json 401 theme={null}
{
  "error": "Invalid API key"
}
```

```json 403 theme={null}
{
  "error": "API key is missing required scope: subscribers:write"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.