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

# Upload an Audience File

> Upload a CDP export through DAM, trigger its audience import, and verify the result.

Use this path for a manual export or when your team does not have a recurring S3 pipeline. The file is uploaded as a DAM asset, then a provider import command copies its approved bytes into the same watched drop zone used by [S3 exports](https://docs.gradial.com/aci/personalization/external-audiences-s3.md).

First publish the provider configuration from [External Audiences](https://docs.gradial.com/aci/personalization/external-audiences.md). The provider must be enabled in the active release. Your tenant needs DAM upload support and a configured audience import notification lane. The import trigger requires `site.admin`; DAM upload and approval use their normal permissions.

## 1. Prepare the export

Use a non-empty `.json` or `.jsonl` file matching the provider's format and mapping. The `profiles.json` example in the shared guide can be used with `customer-cdp`. Convert CSV exports to the configured JSON shape before uploading.

For a `segmentIdsPath` mapping, upload the complete provider snapshot, because each accepted import replaces that provider's memberships. With `objectNamePattern`, the filename determines which segment is replaced. The importer preserves the uploaded version's original filename, so give the file the correct name before uploading.

## 2. Upload and approve the DAM asset

Upload the file through your DAM workflow and record its asset ID and version ID. The version must be approved and eligible for download; completing an upload alone does not make it importable.

For an API integration, the DAM upload sequence is:

1. `POST /v1/dam/uploads` with `filename`, `byteSize`, and `expectedSha256` (the file's 64-character lowercase SHA-256 hex digest). You may also supply `mime` and `folderPath`.
2. Upload the file bytes to the returned `uploadUrl` using the presigned upload contract.
3. `POST /v1/dam/uploads/{uploadId}/complete` to create the asset/version.
4. Approve the version with `POST /v1/dam/assets/{assetId}/lifecycle`, supplying `action: "approve"`, `versionId`, and the asset's current `expectedHead`.

For example, approval uses this body:

```json theme={null}
{
  "action": "approve",
  "versionId": "<uploaded-version-id>",
  "expectedHead": "<current-asset-head>"
}
```

Keep identity-bearing exports in a restricted DAM folder. They are operational import files and should not be embedded in published pages.

## 3. Trigger the provider import

Send an asset reference to the provider's import endpoint:

```bash theme={null}
curl --request POST \
  "$ACI_API_URL/v1/audience/providers/customer-cdp/imports" \
  --header "Authorization: Bearer $ACI_API_TOKEN" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: import-customer-cdp-profiles-2026-10-21" \
  --data '{
    "assetId": "<uploaded-asset-id>",
    "versionId": "<approved-version-id>"
  }'
```

Pin `versionId` when you want the import to use a specific approved version. The request accepts an asset reference, rather than raw file bytes or a caller-selected object key.

A successful trigger returns `202 Accepted` with `assetId`, `versionId`, `objectKey`, and `triggeredAt`. This confirms the copy was submitted to the import pipeline; it does **not** mean the memberships have been accepted. Retain those response values to find the corresponding report.

Use the same idempotency key when retrying the same request. Use a new key for a different upload or import action.

## 4. Wait for the import report

```bash theme={null}
curl "$ACI_API_URL/v1/audience/providers/customer-cdp/imports" \
  --header "Authorization: Bearer $ACI_API_TOKEN"
```

Find the report with the returned `objectKey` and `createdAt` at or after `triggeredAt`. This avoids mistaking a previous import of the same filename for the new one. Confirm `outcome: "accepted"` and review counts, skipped records, discovered IDs, and diagnostics before testing personalization.

The same validation, deduplication, replacement, and expiry rules apply to uploaded files and S3 exports. Re-triggering identical accepted content does not create a second membership set.

## 5. Use the memberships and clean up

Map the imported segment IDs to enabled ACI audiences, then use those audiences in [experiences and experiments](https://docs.gradial.com/aci/personalization/external-audiences.md#4-use-the-audience-in-an-experience). If you discover new segment IDs during import, review and publish their mappings before expecting them to target live visitors.

After an accepted import, delete or expire the source DAM asset through the DAM workflow according to your retention policy. The DAM copy has a separate lifecycle from the audience drop zone and is not removed by audience identity erasure. Removing the source asset does not revoke imported membership; update the provider's authoritative export or use the relevant privacy workflow to change membership or erase an identity.

## Troubleshoot

| Result | Action |
| - | - |
| `400` for a missing idempotency key or asset ID | Supply `Idempotency-Key` and a non-empty `assetId` |
| Provider not enabled (`409`) | Publish and activate the enabled provider configuration |
| Unsupported filename or empty asset (`422`) | Upload a non-empty file with a plain `.json` or `.jsonl` filename |
| File too large (`413`) | Check the provider's `limits.maxDumpBytes`; the default is 256 MiB |
| DAM eligibility failure | Check the selected version's approval, restrictions, and lifecycle |
| Import unavailable (`503`) | Have the tenant administrator verify the DAM copy and notification/import configuration |
| Trigger succeeds but targeting does not | Wait for the matching accepted report, then check mapping, identity handoff, consent, expiry, and release activation |


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