# Use a Didomi managed domain

A default URL is assigned to your widget, for example:

```
https://organization.preference-center.org/
```

We recommend using a custom subdomain, such as [`https://company-name.preference-center.org`](https://company-name.preference-center.org) even though we favor usage of your [own domain name](/api-and-platform/widgets/privacy-widgets/deploy-a-widget/use-your-own-domain.md).

## Step 1 - Create a Widget with a subdomain

To create a Widget with your own subdomain, send a **POST** request on `/widgets`.

```json
POST https://api.didomi.io/widgets?organization_id=YOUR_ORG_ID

{
  "domain": "sub",
  /**
   * subdomain_id corresponds to your subdomain and domain name preference-center.org
   * ex: didomi.preference-center.org
   */  
  "subdomain_id": "String",
   /**
   * name and layout_shapes are required values for creation,
   * they are not related to your custom domain configuration
   */
  "name": "String",
  "layout_shape": "smoothed"
}

```

## Step 2 - Publish a widget with your subdomain

Before we can start serving your Preference Center with your own subdomain, we need to create the subdomain in our system. **This setup is** **triggered at deployment time**.

To deploy a Widget, send a **POST** request on `/widgets/deployments`.

```json
POST https://api.didomi.io/widgets/deployments?organization_id=YOUR_ORG_ID

{
  "widget_id": "WIDGET_ID"
}
```

If you struggle with configuring your subdomain, send an email to <support@didomi.io> or to the person you have been in touch with at Didomi to let us know what subdomain you will be using.

If you have configured a [custom domain](/api-and-platform/widgets/privacy-widgets/deploy-a-widget/use-your-own-domain.md) and want to use a subdomain again, send an email to <support@didomi.io>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.didomi.io/api-and-platform/widgets/privacy-widgets/deploy-a-widget/use-your-own-subdomain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
