# Update a CIMD Domain API

API documentation for the FusionAuth Update a CIMD Domain API.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

> **PLAN:** This feature requires [an Enterprise plan](https://fusionauth.io/docs/get-started/core-concepts/plans-features.md#enterprise-features).

Available since `1.70.0`

This API is used to update an existing CIMD Domain.

You must specify the Id of the CIMD Domain you are updating on the URI.

The Domain and Tenant of a CIMD domain cannot be changed after creation.

You must specify all of the properties of the CIMD Domain when calling this API with the `PUT` HTTP method. When used with `PUT`, this API doesn't merge the existing CIMD Domain and your new data. It replaces the existing CIMD Domain with your new data.

Utilize the `PATCH` HTTP method to send specific changes to merge into an existing CIMD Domain.

Note

You can't update a CIMD domain's custom OAuth scopes via this API. This prevents you from accidentally removing all the scopes of a CIMD domain. Any value supplied for **domain.scopes** is ignored.

To create, update, or remove a custom OAuth scope on a CIMD domain, call one of these APIs:

*   [Create a CIMD Domain OAuth Scope](https://fusionauth.io/docs/apis/cimd-domain-scopes.md#create-a-cimd-domain-oauth-scope)
*   [Update a CIMD Domain OAuth Scope](https://fusionauth.io/docs/apis/cimd-domain-scopes.md#update-a-cimd-domain-oauth-scope)
*   [Delete a CIMD Domain OAuth Scope](https://fusionauth.io/docs/apis/cimd-domain-scopes.md#delete-a-cimd-domain-oauth-scope)

## Request

[API Key Authentication](https://fusionauth.io/docs/apis/authentication.md#api-key-authentication)

Update a CIMD Domain by Id

`PUT /api/cimd/domain/{cimdDomainId}`

`PATCH /api/cimd/domain/{cimdDomainId}`

Note

For backward compatibility, the `PATCH` method accepts the same media type (specified by a `Content-Type` of `application/json`) and body as the `PUT` request. You can also use the following media types for different behavior:

*   [JSON Patch/RFC 6902](https://www.rfc-editor.org/rfc/rfc6902): `application/json-patch+json`
*   [JSON Merge Patch/RFC 7396](https://www.rfc-editor.org/rfc/rfc7396): `merge-patch+json`

For details, see the [PATCH documentation](https://fusionauth.io/docs/apis.md#the-patch-http-method).

Using a media type of `application/json` merges the provided request parameters into the existing object. As a result, all parameters are optional with `PATCH`: only provide the values you want to change. To remove a value, provide a `null` value. Patching an `Array` appends all values in the new list to the old list.

#### Request Headers

`X-FusionAuth-TenantId`

*   Type: `String`
*   Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See [Making an API request using a Tenant Id](https://fusionauth.io/docs/apis/authentication.md#making-an-api-request-using-a-tenant-id) for additional information.

##### Request Body

`domain.allowLocalhostRedirectUris`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether CIMD clients on this domain may use a `localhost` redirect URI, such as `http://localhost:3334/callback`. The URI must also appear in the client's metadata document **redirect\_uris**. When `false`, FusionAuth rejects any `localhost` redirect URI, but still accepts loopback IP addresses such as `http://127.0.0.1/callback`.

[RFC 8252 Section 7.3](https://datatracker.ietf.org/doc/html/rfc8252#section-7.3) recommends loopback IP addresses over `localhost`, because the name can resolve to an interface other than loopback. Enable this only for CIMD clients that require it.

`domain.authorizedResourceUris`

*   Type: `Array<String>`
*   Optional

The resource URIs that clients registered on this CIMD domain may request using the [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) `resource` parameter.

Every CIMD client must send exactly one `resource` parameter, and FusionAuth rejects the request with `invalid_target` unless it appears in this list. Clients on a domain with an empty list cannot log in.

`domain.consentMode`

*   Type: `String`
*   Optional
*   Defaults to `AlwaysPrompt`

Controls whether a user is prompted to consent to the OAuth scopes requested by this domain's clients.

The possible values are:

*   `AlwaysPrompt` - Always prompt the user for consent.
*   `RememberDecision` - Remember previous consents; only prompt if the choice expires or if the requested or required scopes have changed. The duration of this persisted choice is controlled by the Tenant's **externalIdentifierConfiguration.rememberOAuthScopeConsentChoiceTimeToLiveInSeconds** value.

FusionAuth remembers a decision separately for each client registration and `resource`. Changing the consent mode to `AlwaysPrompt` deletes every remembered decision for the domain's clients.

A value of `NeverPrompt` will be rejected. A CIMD client is always treated as a third-party client, and once a consent decision is skipped entirely there is no way to re-prompt the client's user.

`domain.data`

*   Type: `Object`
*   Optional

An object that can hold any information about the CIMD domain that should be persisted.

`domain.debug`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether FusionAuth writes the standard OAuth debug Event Log entries, such as the authorization code exchange, for this domain's clients. The authorization code exchange entry lists the requested resources. FusionAuth also writes a Debug entry when it creates a client registration, refreshes one after its cache expires, or adds a new resource to an existing one. FusionAuth always writes an Error entry for a failed client registration, whether or not this is enabled. It always writes an Information entry when it rate limits a registration.

`domain.domain`

*   Type: `String`
*   Required
*   Immutable

The origin that CIMD clients register from, given as `scheme://host[:port]`. FusionAuth normalizes this value before storing it and uses it to validate the `client_id` URL presented on an OAuth request.

Use the literal value `*` to accept registrations from any origin. A Tenant may contain either a single `*` domain or any number of exact-match domains, but never both.

The origin must use `https`, and its host must contain at least one `.`. A path, query string, fragment, or user info component is not permitted, and neither are IP addresses or single-label hosts such as `localhost`. Subdomain wildcards such as `https://*.example.com` are not supported.

This value cannot be changed after creation. A PUT request must still include the current value, which FusionAuth validates but does not change.

`domain.gracePeriodInSeconds`

*   Type: `Integer`
*   Optional
*   Defaults to `0`

How long, in seconds, FusionAuth will continue to honor an expired cached metadata document when a re-fetch of that document fails. Must be greater than or equal to `0`.

`domain.jwtPopulateLambdaId`

*   Type: `UUID`
*   Optional

The unique Id of the lambda used to populate the claims of the access token and Id token issued to this domain's clients. A single lambda is applied to both tokens. The lambda must be a JWT populate lambda.

`domain.maxCacheTtlInSeconds`

*   Type: `Integer`
*   Optional
*   Defaults to `86400`

The ceiling, in seconds, applied to the `Cache-Control: max-age` value returned when fetching a client's metadata document. When the document specifies a smaller value, that smaller value is used instead. The `Expires` header is not honored.

Must be at least `900`, the non-configurable 15 minute minimum cache duration.

`domain.name`

*   Type: `String`
*   Optional
*   Defaults to `the value of domain.domain`

The name of the CIMD domain, used to identify it in the FusionAuth admin UI. Leave this blank to default to the value of **domain.domain**.

`domain.providedScopePolicy.address.enabled`

*   Type: `Boolean`
*   Optional
*   Defaults to `true`

Whether the `address` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when a client requests it.

`domain.providedScopePolicy.address.required`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether consent to the `address` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.email.enabled`

*   Type: `Boolean`
*   Optional
*   Defaults to `true`

Whether the `email` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when a client requests it.

`domain.providedScopePolicy.email.required`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether consent to the `email` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.phone.enabled`

*   Type: `Boolean`
*   Optional
*   Defaults to `true`

Whether the `phone` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when a client requests it.

`domain.providedScopePolicy.phone.required`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether consent to the `phone` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.profile.enabled`

*   Type: `Boolean`
*   Optional
*   Defaults to `true`

Whether the `profile` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when a client requests it.

`domain.providedScopePolicy.profile.required`

*   Type: `Boolean`
*   Optional
*   Defaults to `false`

Whether consent to the `profile` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.registrationLambdaId`

*   Type: `UUID`
*   Optional

The unique Id of the [CIMD Client Registration Lambda](https://fusionauth.io/docs/extend/code/lambdas/cimd-client-registration.md) used to accept, reject, or modify a client registration for this domain. The lambda must be a CIMD Client Registration lambda. When this is not set, no registration lambda runs and every client from this origin is allowed to register.

When **domain.domain** is `*`, a registration lambda is the only way to filter which clients may register.

Note

A CIMD domain always belongs to exactly one Tenant; there is no universal CIMD domain.

Example Request JSON

```json
{
  "domain": {
    "name": "Claude",
    "domain": "https://claude.ai",
    "allowLocalhostRedirectUris": false,
    "authorizedResourceUris": [
      "https://mcp.example.com"
    ],
    "consentMode": "RememberDecision",
    "debug": true,
    "gracePeriodInSeconds": 600,
    "maxCacheTtlInSeconds": 43200,
    "jwtPopulateLambdaId": "6f3c9a12-4b7d-4e58-8c21-9a5b7e3d1f60",
    "providedScopePolicy": {
      "address": {
        "enabled": false,
        "required": false
      },
      "email": {
        "enabled": true,
        "required": true
      },
      "phone": {
        "enabled": false,
        "required": false
      },
      "profile": {
        "enabled": true,
        "required": false
      }
    },
    "registrationLambdaId": "b3a4f2d1-8c5e-4a7b-9f16-2d8e5c1a7b34"
  }
}
```

## Response

The response for this API contains the new information for the CIMD domain that was updated.

*Response Codes*

| Code | Description |
| --- | --- |
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain an [Errors](https://fusionauth.io/docs/apis/errors.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See [Authentication](https://fusionauth.io/docs/apis/authentication.md). |
| 404 | The object you are trying to update doesn't exist. The response will be empty. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |

### Response Body

`domain.allowLocalhostRedirectUris`

*   Type: `Boolean`

Whether CIMD clients on this domain may use a `localhost` redirect URI, such as `http://localhost:3334/callback`. The URI must also appear in the client's metadata document **redirect\_uris**. When `false`, FusionAuth rejects any `localhost` redirect URI, but still accepts loopback IP addresses such as `http://127.0.0.1/callback`.

[RFC 8252 Section 7.3](https://datatracker.ietf.org/doc/html/rfc8252#section-7.3) recommends loopback IP addresses over `localhost`, because the name can resolve to an interface other than loopback. Enable this only for CIMD clients that require it.

`domain.authorizedResourceUris`

*   Type: `Array<String>`

The resource URIs that clients registered on this CIMD domain may request using the [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) `resource` parameter.

Every CIMD client must send exactly one `resource` parameter, and FusionAuth rejects the request with `invalid_target` unless it appears in this list. Clients on a domain with an empty list cannot log in.

`domain.consentMode`

*   Type: `String`

Controls whether a user is prompted to consent to the OAuth scopes requested by this domain's clients.

The possible values are:

*   `AlwaysPrompt` - Always prompt the user for consent.
*   `RememberDecision` - Remember previous consents; only prompt if the choice expires or if the requested or required scopes have changed. The duration of this persisted choice is controlled by the Tenant's **externalIdentifierConfiguration.rememberOAuthScopeConsentChoiceTimeToLiveInSeconds** value.

`NeverPrompt` is not a valid value for a CIMD domain. CIMD clients are always treated as third-party clients, so consent can never be granted implicitly.

`domain.data`

*   Type: `Object`

An object that can hold any information about the CIMD domain that should be persisted.

`domain.debug`

*   Type: `Boolean`

Whether FusionAuth writes the standard OAuth debug Event Log entries, such as the authorization code exchange, for this domain's clients. The authorization code exchange entry lists the requested resources. FusionAuth also writes a Debug entry when it creates a client registration, refreshes one after its cache expires, or adds a new resource to an existing one. FusionAuth always writes an Error entry for a failed client registration, whether or not this is enabled. It always writes an Information entry when it rate limits a registration.

`domain.domain`

*   Type: `String`

The normalized origin that CIMD clients register from, in the form `scheme://host[:port]`, or the literal `*` to accept registrations from any origin.

FusionAuth uses this value to validate the `client_id` URL presented on an OAuth request.

`domain.gracePeriodInSeconds`

*   Type: `Integer`

How long, in seconds, FusionAuth will continue to honor an expired cached metadata document when a re-fetch of that document fails.

`domain.id`

*   Type: `UUID`

The unique Id of the CIMD domain.

`domain.insertInstant`

*   Type: `Long`

The [instant](https://fusionauth.io/docs/reference/data-types.md#instants) that the CIMD domain was added to the FusionAuth database.

`domain.jwtPopulateLambdaId`

*   Type: `UUID`

The unique Id of the lambda used to populate the claims of the access token and Id token issued to this domain's clients.

`domain.lastUpdateInstant`

*   Type: `Long`

The [instant](https://fusionauth.io/docs/reference/data-types.md#instants) that the CIMD domain was last updated in the FusionAuth database.

`domain.maxCacheTtlInSeconds`

*   Type: `Integer`

The ceiling, in seconds, applied to the `Cache-Control: max-age` value returned when fetching a client's metadata document. When the document specifies a smaller value, that smaller value is used. The `Expires` header is not honored.

Always at least `900`, the non-configurable 15 minute minimum cache duration.

`domain.name`

*   Type: `String`

The name of the CIMD domain, used to identify it in the FusionAuth admin UI. When not provided on create, this defaults to the value of **domain.domain**.

`domain.providedScopePolicy.address.enabled`

*   Type: `Boolean`

Whether the `address` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when requested.

`domain.providedScopePolicy.address.required`

*   Type: `Boolean`

Whether consent to the `address` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.email.enabled`

*   Type: `Boolean`

Whether the `email` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when requested.

`domain.providedScopePolicy.email.required`

*   Type: `Boolean`

Whether consent to the `email` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.phone.enabled`

*   Type: `Boolean`

Whether the `phone` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when requested.

`domain.providedScopePolicy.phone.required`

*   Type: `Boolean`

Whether consent to the `phone` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.providedScopePolicy.profile.enabled`

*   Type: `Boolean`

Whether the `profile` OAuth scope provided by FusionAuth is enabled for this CIMD domain. A disabled scope is treated as an unknown scope when requested.

`domain.providedScopePolicy.profile.required`

*   Type: `Boolean`

Whether consent to the `profile` OAuth scope provided by FusionAuth is required for this CIMD domain when present on the OAuth request.

`domain.registrationLambdaId`

*   Type: `UUID`

The unique Id of the [CIMD Client Registration Lambda](https://fusionauth.io/docs/extend/code/lambdas/cimd-client-registration.md) used to accept, reject, or modify a client registration for this domain. When this is not set, no registration lambda runs.

`domain.scopes`

*   Type: `Array`

The custom OAuth scopes defined on this CIMD domain. Manage these using the [CIMD Domain OAuth Scope APIs](https://fusionauth.io/docs/apis/cimd-domain-scopes.md).

`domain.scopes[x].data`

*   Type: `Object`

An object that can hold any information about the OAuth scope that should be persisted.

`domain.scopes[x].defaultConsentDetail`

*   Type: `String`

The default detail to display on the OAuth consent screen if one cannot be found in the theme.

`domain.scopes[x].defaultConsentMessage`

*   Type: `String`

The default message to display on the OAuth consent screen if one cannot be found in the theme.

`domain.scopes[x].description`

*   Type: `String`

A description of the OAuth scope for internal use.

`domain.scopes[x].id`

*   Type: `UUID`

The unique Id of the OAuth scope.

`domain.scopes[x].insertInstant`

*   Type: `Long`

The [instant](https://fusionauth.io/docs/reference/data-types.md#instants) that the OAuth scope was added to the FusionAuth database.

`domain.scopes[x].lastUpdateInstant`

*   Type: `Long`

The [instant](https://fusionauth.io/docs/reference/data-types.md#instants) that the OAuth scope was updated in the FusionAuth database.

`domain.scopes[x].name`

*   Type: `String`

The name of the OAuth scope. This is the value that will be used to request the scope in OAuth workflows.

`domain.scopes[x].required`

*   Type: `Boolean`

Determines if the OAuth scope is required when requested in an OAuth workflow.

`domain.tenantId`

*   Type: `UUID`

The unique Id of the Tenant that this CIMD domain belongs to.

Example Response JSON

```json
{
  "domain": {
    "id": "e9fdb985-9173-4e01-9d73-ac2d60d1dc8e",
    "name": "Claude",
    "domain": "https://claude.ai",
    "tenantId": "30663132-6464-6665-3032-326466613934",
    "allowLocalhostRedirectUris": false,
    "authorizedResourceUris": [
      "https://mcp.example.com"
    ],
    "consentMode": "AlwaysPrompt",
    "debug": false,
    "gracePeriodInSeconds": 300,
    "insertInstant": 1595361142909,
    "lastUpdateInstant": 1595361143101,
    "maxCacheTtlInSeconds": 86400,
    "providedScopePolicy": {
      "address": {
        "enabled": false,
        "required": false
      },
      "email": {
        "enabled": true,
        "required": true
      },
      "phone": {
        "enabled": false,
        "required": false
      },
      "profile": {
        "enabled": true,
        "required": false
      }
    },
    "registrationLambdaId": "b3a4f2d1-8c5e-4a7b-9f16-2d8e5c1a7b34",
    "scopes": [
      {
        "id": "d7a1c3e5-2b48-4f96-8e07-5c1a9b3d6f82",
        "name": "reports:read",
        "defaultConsentMessage": "View your reports",
        "defaultConsentDetail": "Grants read-only access to your saved reports.",
        "description": "Read access to the reporting API.",
        "insertInstant": 1595361143050,
        "lastUpdateInstant": 1595361143050,
        "required": false
      }
    ]
  }
}
```
---

## Other pages in Cimd Domains

> For the full index of this section, see [Apis](https://fusionauth.io/docs/llms-apis.txt).

- [Create a CIMD Domain API](https://fusionauth.io/docs/apis/cimd-domains/create-a-cimd-domain.md): API documentation for the FusionAuth Create a CIMD Domain API.
- [Delete a CIMD Domain API](https://fusionauth.io/docs/apis/cimd-domains/delete-a-cimd-domain.md): API documentation for the FusionAuth Delete a CIMD Domain API.
- [CIMD Domain API](https://fusionauth.io/docs/apis/cimd-domains.md): Learn about the APIs for creating, retrieving, updating and deleting CIMD domains.
- [Retrieve a CIMD Domain API](https://fusionauth.io/docs/apis/cimd-domains/retrieve-a-cimd-domain.md): API documentation for the FusionAuth Retrieve a CIMD Domain API.
- [Search for CIMD Domains API](https://fusionauth.io/docs/apis/cimd-domains/search-for-cimd-domains.md): API documentation for the FusionAuth Search for CIMD Domains API.
