---
type: api
title: Generate verification code
description: Generate verification code for the domain claim challenge.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-domain-claim-generate-verification-code
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/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`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#apikey)

#### Path Parameters

- `organization_id` (string)
  Identifier for the Organization

## Description

Generate verification code for the domain claim challenge.

## Request Body

`application/json`

The verification code request

- `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` ([] BasicFailedReplyElement)
  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

#### Console

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

#### curl

```curl
curl -X POST "/organizations/{organization_id}/domains/_generate_verification_code"
```

