---
type: api
title: Generate verification code
description: Generate verification code for the domain claim challenge.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-domain-claim-generate-verification-code
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-domain-claim-generate-verification-code
products:
  - Elastic Cloud Enterprise
---

# Generate verification code

## Paths

- `POST` `/organizations/{organization_id}/domains/_generate_verification_code`

#### Path parameters

- `organization_id` (string) — required
  Identifier for the Organization

## Description

Generate verification code for the domain claim challenge.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Request body

The verification code request

`application/json`

- `domain_claim_request` (string) — required
  The domain claim request

## Responses

#### `200`

The verification code response

`application/json`

- `verification` (string)
  The verification code to use for the domain claim challenge
#### `404`

Organization not found. (code: `organization.not_found`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X POST "${API_URL}/organizations/${ORGANIZATION_ID}/domains/_generate_verification_code" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_claim_request": "string"
  }'
```

