<!-- llms.txt: https://workos.com/llms.txt -->

# Domain verification

Add domains to the organization the token was issued for and track the DNS verification of each one.

## Add an organization domain

Add a domain to the token's organization and begin DNS verification.

:::code-group

```graphql language="graphql" title="Mutation" tab="1"
mutation CreateOrganizationDomain($domain: String!) {
  createOrganizationDomain(domain: $domain) {
    createdAt
    domain
    id
    nameServer
    organizationId
    state
    subdomain
    verificationPrefix
    verificationToken
  }
}
```

```json language="json" title="Response" tab="2"
{
  "data": {
    "createOrganizationDomain": {
      "createdAt": "2024-01-01T00:00:00.000Z",
      "domain": "domain_example",
      "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "nameServer": "AwsRoute53",
      "organizationId": "organizationId_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "state": "Failed",
      "subdomain": "subdomain_example",
      "verificationPrefix": "verificationPrefix_example",
      "verificationToken": "verificationToken_example"
    }
  }
}
```

:::

## Delete an organization domain

Delete a domain belonging to the token's organization and return it.

:::code-group

```graphql language="graphql" title="Mutation" tab="1"
mutation DeleteOrganizationDomain($id: ID!) {
  deleteOrganizationDomain(id: $id) {
    createdAt
    domain
    id
    nameServer
    organizationId
    state
    subdomain
    verificationPrefix
    verificationToken
  }
}
```

```json language="json" title="Response" tab="2"
{
  "data": {
    "deleteOrganizationDomain": {
      "createdAt": "2024-01-01T00:00:00.000Z",
      "domain": "domain_example",
      "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "nameServer": "AwsRoute53",
      "organizationId": "organizationId_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "state": "Failed",
      "subdomain": "subdomain_example",
      "verificationPrefix": "verificationPrefix_example",
      "verificationToken": "verificationToken_example"
    }
  }
}
```

:::

## Get an organization domain

Return a domain by ID within the token's organization, including its verification status.

:::code-group

```graphql language="graphql" title="Query" tab="1"
query OrganizationDomain($id: ID!) {
  organizationDomain(id: $id) {
    createdAt
    domain
    id
    nameServer
    organizationId
    state
    subdomain
    verificationPrefix
    verificationToken
  }
}
```

```json language="json" title="Response" tab="2"
{
  "data": {
    "organizationDomain": {
      "createdAt": "2024-01-01T00:00:00.000Z",
      "domain": "domain_example",
      "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "nameServer": "AwsRoute53",
      "organizationId": "organizationId_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "state": "Failed",
      "subdomain": "subdomain_example",
      "verificationPrefix": "verificationPrefix_example",
      "verificationToken": "verificationToken_example"
    }
  }
}
```

:::

## List organization domains

List the domains belonging to the organization the token was issued for.

:::code-group

```graphql language="graphql" title="Query" tab="1"
query OrganizationDomains($after: String, $before: String, $limit: Int, $order: PaginationOrder) {
  organizationDomains(after: $after, before: $before, limit: $limit, order: $order) {
    data {
      createdAt
      domain
      id
      nameServer
      organizationId
      state
      subdomain
      verificationPrefix
      verificationToken
    }
    listMetadata {
      after
      before
    }
  }
}
```

```json language="json" title="Response" tab="2"
{
  "data": {
    "organizationDomains": {
      "data": [
        {
          "createdAt": "2024-01-01T00:00:00.000Z",
          "domain": "domain_example",
          "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY",
          "nameServer": "AwsRoute53",
          "organizationId": "organizationId_01EHWNCE74X7JSDV0X3SZ3KJNY",
          "state": "Failed",
          "subdomain": "subdomain_example",
          "verificationPrefix": "verificationPrefix_example",
          "verificationToken": "verificationToken_example"
        }
      ],
      "listMetadata": {
        "after": "after_example",
        "before": "before_example"
      }
    }
  }
}
```

:::

## Restart domain verification

Restart verification for a domain belonging to the token's organization.

:::code-group

```graphql language="graphql" title="Mutation" tab="1"
mutation ReverifyOrganizationDomain($id: ID!) {
  reverifyOrganizationDomain(id: $id) {
    createdAt
    domain
    id
    nameServer
    organizationId
    state
    subdomain
    verificationPrefix
    verificationToken
  }
}
```

```json language="json" title="Response" tab="2"
{
  "data": {
    "reverifyOrganizationDomain": {
      "createdAt": "2024-01-01T00:00:00.000Z",
      "domain": "domain_example",
      "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "nameServer": "AwsRoute53",
      "organizationId": "organizationId_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "state": "Failed",
      "subdomain": "subdomain_example",
      "verificationPrefix": "verificationPrefix_example",
      "verificationToken": "verificationToken_example"
    }
  }
}
```

:::

### Mutation createOrganizationDomain

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | String! | Yes |  |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | DateTime! |  |
| `domain` | String! | The fully qualified domain name. |
| `id` | ID! |  |
| `nameServer` | DomainVerificationNameServer! | The DNS name server provider detected for the domain. |
| `organizationId` | ID! |  |
| `state` | OrganizationDomainState! | The verification state of an organization domain. |
| `subdomain` | String | The subdomain portion of the domain, if any. |
| `verificationPrefix` | String | The DNS record prefix the customer must add to verify the domain. |
| `verificationToken` | String | The DNS record value the customer must add to verify the domain. |

### Mutation deleteOrganizationDomain

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | ID! | Yes |  |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | DateTime! |  |
| `domain` | String! | The fully qualified domain name. |
| `id` | ID! |  |
| `nameServer` | DomainVerificationNameServer! | The DNS name server provider detected for the domain. |
| `organizationId` | ID! |  |
| `state` | OrganizationDomainState! | The verification state of an organization domain. |
| `subdomain` | String | The subdomain portion of the domain, if any. |
| `verificationPrefix` | String | The DNS record prefix the customer must add to verify the domain. |
| `verificationToken` | String | The DNS record value the customer must add to verify the domain. |

### Query organizationDomain

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | ID! | Yes |  |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | DateTime! |  |
| `domain` | String! | The fully qualified domain name. |
| `id` | ID! |  |
| `nameServer` | DomainVerificationNameServer! | The DNS name server provider detected for the domain. |
| `organizationId` | ID! |  |
| `state` | OrganizationDomainState! | The verification state of an organization domain. |
| `subdomain` | String | The subdomain portion of the domain, if any. |
| `verificationPrefix` | String | The DNS record prefix the customer must add to verify the domain. |
| `verificationToken` | String | The DNS record value the customer must add to verify the domain. |

### Query organizationDomains

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | String | No |  |
| `before` | String | No |  |
| `limit` | Int | No |  |
| `order` | PaginationOrder | No | Enum represents the pagination order. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `data` | [OrganizationDomain!]! | A domain belonging to the organization the token was issued for. |
| `listMetadata` | ListMetadata! |  |

### Mutation reverifyOrganizationDomain

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | ID! | Yes |  |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | DateTime! |  |
| `domain` | String! | The fully qualified domain name. |
| `id` | ID! |  |
| `nameServer` | DomainVerificationNameServer! | The DNS name server provider detected for the domain. |
| `organizationId` | ID! |  |
| `state` | OrganizationDomainState! | The verification state of an organization domain. |
| `subdomain` | String | The subdomain portion of the domain, if any. |
| `verificationPrefix` | String | The DNS record prefix the customer must add to verify the domain. |
| `verificationToken` | String | The DNS record value the customer must add to verify the domain. |