---
title: "Create/update data endpoint"
method: POST
path: "/whatsapp/flows/{flow_id}/data_endpoint"
tags: ["WhatsApp Flows"]
---

# Create/update data endpoint

`POST /whatsapp/flows/{flow_id}/data_endpoint`

Create or update the data endpoint function code. The function handles dynamic data for your flow.

## Request body

- WhatsappFlowDataEndpointCreateRequest
  - `code` string, required — Cloudflare Worker code for the data endpoint

## Response `200`

Data endpoint saved

- WhatsappFlowDataEndpointResponse
  - `data` WhatsappFlowDataEndpoint, required
    - `function_id` string, uuid, required
    - `function_name` string, required
    - `endpoint_url` string, uri, nullable
    - `status` 'draft' | 'deployed' | 'error', required
    - `last_deployed_at` string, date-time, nullable
    - `code` string — Function source code

## Other responses

- `400` — Request validation failed
- `401` — Missing or invalid API key
- `404` — Resource not found
- `422` — Request validation failed

---

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