---
title: "Discard a language's draft edits back to its submitted copy"
canonical: "https://bird.com/docs/api/reference/discard-whatsapp-template-language-edits"
---

# Discard a language's draft edits back to its submitted copy

`POST /v1/whatsapp/templates/{template_ref}/versions/{version_id}/languages/{language}/discard`

Restores one language of the template's draft to the copy the draft was branched from, discarding the edits made to it since. Only that language moves: every other language in the draft is left alone, which is what discarding the whole draft does not give you. A language the draft added, and a template that has never been submitted, have nothing to restore and are refused. Pass `revision` to make the discard a compare-and-set against the copy you read; omit it and the discard is last-write-wins, the same rule this language's `PUT` follows. Nothing reaches WhatsApp until the draft is submitted.

## Servers

- `https://{region}.platform.bird.com`: Regional API endpoint. Use the host for the region your organization is hosted in. Official Bird SDKs and the CLI select it automatically from your API key, so you rarely need to set it by hand.
  - `region`: `us1`, `eu1`. Default: `us1`. The region your organization's data is hosted in.
- `https://platform.bird.com`: Region-independent endpoint for authentication and account administration.
- `http://localhost:8080`: Local development.

## Authentication

Use one authentication option:

- `BearerAuth`: HTTP bearer authentication. Pass the API key as a bearer token in the `Authorization` header. Workspace
keys use `bk_{region}_*`; organization master keys use `bm_{region}_*`.
The prefix identifies the region and selects the
API endpoint. Official Bird SDKs and the CLI derive the region from the key.

- `CookieAuth`: Send `bird_session` in cookie. Session cookie set after signing in to the Bird dashboard. The cookie
value is an opaque session token; no session data is stored in the cookie
itself.

## Code samples

**TypeScript**

```ts
const restored = await bird.whatsapp.templates.versions.languages.discard(
  "order_update",
  "wav_01krdgeqcxet5s7t44vh8rt9mg",
  "en",
);
console.log(restored.language, restored.revision);
```

Examples: [TypeScript](/docs/api/reference/discard-whatsapp-template-language-edits.ts.md) · [Python](/docs/api/reference/discard-whatsapp-template-language-edits.py.md) · [Go](/docs/api/reference/discard-whatsapp-template-language-edits.go.md) · [PHP](/docs/api/reference/discard-whatsapp-template-language-edits.php.md) · [CLI](/docs/api/reference/discard-whatsapp-template-language-edits.cli.md) · [MCP](/docs/api/reference/discard-whatsapp-template-language-edits.mcp.md) · [cURL](/docs/api/reference/discard-whatsapp-template-language-edits.curl.md)

## Example response `200`

```json
{
  "language": "pt-BR",
  "revision": 4,
  "content_hash": "sha256:9f2c4e1a7b03d85fbc6e29d417a05e8c3b1d9f76a2e4c018d53b7f9a6c2e18d4"
}
```

## Path parameters

- `template_ref` (string, required): The template: its id (`wat_…`) or its slug. A value that parses as a `wat_` id is treated as one; anything else is a slug. Slugs on this channel can spell a typed id, so the two are told apart by parsing the value rather than by its character set.
- `version_id` (string, required): Version ID.
- `language` (string, required): The language, as a BCP-47 tag. Case and separator variance is accepted and normalised, and the canonical form is returned.

## Header parameters

- `Idempotency-Key` (string, optional)

  Client-supplied key. On operations supporting request deduplication, a retained
  response is replayed for duplicate requests with the same key within the
  idempotency window (3 hours by default). This protection requires a workspace,
  organization, or staff-account scope. User-only and unscoped unauthenticated operations,
  streams, and operations with a separate replay contract do not use this
  response replay.

  On a supported operation, if idempotency protection is unavailable before execution, the API returns
  `503 IdempotencyUnavailable` (E01033) without executing this attempt. Retry with
  backoff using the same key and request. An operation that takes effect before
  its response is retained can still execute again on retry.

  Two distinct 409 errors signal misuse:

  - `request_in_progress` (E01004): The same key is currently being
    processed by a concurrent request. Wait briefly and retry. The lock expires within 30 seconds.
  - `idempotency_key_reuse` (E01005): The same key has already completed
    against a different request body or method. Generate a new key.

  Recommended key format is `<event-type>/<entity-id>` (for example `welcome-user/usr_abc123`).
- `X-Workspace-Id` (string, optional): Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
- `X-Organization-Id` (string, optional): Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.

## Request body

- `revision` (integer): The revision you last read for this language, making the discard a compare-and-set: a mismatch is refused with a conflict, leaving an edit you have not seen in place. Omit it for last-write-wins, which is what a single writer wants. Supplying it for a language the draft no longer holds is also refused with a conflict rather than recreating the language.

## Response body

- `language` (string, required): The canonical form of the tag you addressed. Use it in later calls for this language.
- `revision` (integer, required): The language's new revision, to pass back on your next write.
- `content_hash` (string, required): A hash over the content as saved, so you can tell whether your next write would change anything without diffing the document.
- `updated_at` (string, required): When this language was last written.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
