# Deploy a Widget

## Deploy a widget

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"
}
```

Note that if you have added metadata to a [purpose](/api-and-platform/data-manager/purposes.md), a [preference](/api-and-platform/data-manager/preferences-library.md#create-a-preference) or a [preference\_value](/api-and-platform/data-manager/preferences-library.md#create-a-preference), they will be available in the remote [widget configuration](#get-remote-widget-configuration) in case you are using our [APIs](/api-and-platform/consents.md) or [Headless widgets](/api-and-platform/widgets/privacy-widgets/headless-widgets.md).

## Get all deployments

To list all deployments, send a **GET** request on `/widgets/deployments`.

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

[
  {
    "id": "String",
    "created_at": "Date",
    "updated_at": "Date",
    "organization_id": "String",
    "widget_id": "String",
    "config": {}
    "deployment_id": "String",
  }
]
```

Optional query parameters:

* `$limit`: number of max results to return
* `$skip`: Number of results to skip
* `$sort`: represents sorting options. Accepts date properties to sort (`created_at`, `updated_at`) as keys and -1 or 1 for sort direction as value.
  * `$sort[created_at]=1` or `-1`
  * `$sort[updated_at]=1` or `-1`
* `widget_id`: To filter deployments by widget ID

## Get a deployment

To find a deployment, send a **GET** request on `/widgets/deployments/{id}`.

```json
GET https://api.didomi.io/widgets/deployments/{id}?organization_id=YOUR_ORG_ID

{
  "id": "String",
  "created_at": "Date",
  "updated_at": "Date",
  "organization_id": "String",
  "widget_id": "String",
  "config": {}            
  "deployment_id": "String",
}
```

### Get `remote` widget configuration

A remote widget is a embeddable widget that has been deployed. Although the configuration object is generally used by our SDK to render the widget, you can use the endpoint below to re-build your own widget while relying on Widget engine.

*\** `api_key` *and* `widget_id` *are both accessible in Didomi Console, in the widget edit page.*

```url
https://pmp-sdk.privacy-center.org/configs/{{api_key}}/containers/{{widget_id}}.json
```

This way of fetching widget configuration is the most reliable provided by Didomi.\
Remote widgets configuration is stored in a S3 Standard Bucket which is design for 99.99% availability.


---

# 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.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.
