# 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](https://developers.didomi.io/api-and-platform/widgets/privacy-widgets/deploy-a-widget/use-your-own-domain).

## 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](https://developers.didomi.io/api-and-platform/widgets/privacy-widgets/deploy-a-widget/use-your-own-domain) and want to use a subdomain again, send an email to <support@didomi.io>.
