---
title: "Provision CTWA dataset"
method: POST
path: "/v1/whatsapp/dataset"
tags: ["WhatsApp"]
---

# Provision CTWA dataset

`POST /v1/whatsapp/dataset`

Creates (or fetches, if one already exists) the Meta dataset that
Click-to-WhatsApp ad events are reported against via the Conversions
API, and persists its ID on the account as `metadata.metaCapiDatasetId`.

The call is GET-first idempotent — a WABA can only own one CTWA
dataset, so a second call after a successful provision is a safe no-op
that returns the same ID with `created: false`.

Requires the connected WhatsApp account's token to carry the
`whatsapp_business_manage_events` permission. If the permission is
missing the endpoint returns 422 with a message asking the user to
reconnect the account.

## Request body

- object
  - `accountId` string, required — WhatsApp social account ID

## Response `200`

Dataset provisioned (or already present)

- object
  - `datasetId` string — Meta dataset ID linked to the WABA
  - `created` boolean — True if Meta created a new dataset on this call; false if one already existed

## Other responses

- `401` — Unauthorized
- `404` — WhatsApp account not found
- `422` — Account is missing `whatsapp_business_manage_events` — reconnect required
- `502` — Upstream Meta failure during provisioning

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/51932b099b2f/schema)
