# Presets

Using presets, you can preconfigure plugin instances so that your team using the UI only has to fill in the fields that are relevant to them.

For instance, you can make a Google DDP connector feed preset and hard set your Google company identifier and the Google platform you are using, so that marketing type users in your organisation only have to fill in the Google segment code to feed each time they want to create a new feed.

{% hint style="info" %}

* Though theorically available for all types of plugins, presets are mostly useful for [feeds](https://developer.mediarithmics.io/advanced-usages/audiences/audience-segment-feed) as they will appear in the UI.
* You need to have the `ORGANISATION_ADMIN` role to create a preset on an organisation
  {% endhint %}

## Create a preset

<mark style="color:green;">`POST`</mark> `https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/presets`

#### Path Parameters

| Name        | Type    | Description                   |
| ----------- | ------- | ----------------------------- |
| version\_id | string  | The ID of the plugin version. |
| plugin\_id  | integer | The ID of the plugin.         |

#### Request Body

| Name             | Type   | Description                                                                                                                                                 |
| ---------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| properties       | array  | An array of the properties as defined with the plugin version. Values can be overriden to provide a default, not editable value. See Property type objects. |
| plugin\_type     | string | The plugin type. For feeds, use `AUDIENCE_SEGMENT_EXTERNAL_FEED`.                                                                                           |
| organisation\_id | string | The ID for the organisation.                                                                                                                                |
| description      | string | Description for the preset.                                                                                                                                 |
| name             | string | Name for the preset.                                                                                                                                        |

{% tabs %}
{% tab title="200 " %}

```
{
    "status":"ok",
    "data":{
        "id":"xxx",
        "name":"Preset name",
        "description":"Preset description",
        "organisation_id":"xxx",
        "plugin_id":"xxx",
        "plugin_version_id":"xxx",
        "plugin_type":"AUDIENCE_SEGMENT_EXTERNAL_FEED",
        "properties":[
            {
                "technical_name":"entity_id",
                "value":{
                    "value":"1234567890"
                },
                "property_type":"STRING"
            },
            {
                "technical_name":"segment_code",
                "value":{
                    "value":null
                },
                "property_type":"STRING"
            }
        ],
        "creation_ts":xxxx,
        "archived":false
    }
}
```

{% endtab %}
{% endtabs %}

## Get presets

<mark style="color:blue;">`GET`</mark> `https://api.mediarithmics.com/v1/plugins.versions.presets`

#### Query Parameters

| Name             | Type   | Description                                                                                                                                                                                                                                                                                    |
| ---------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| organisation\_id | string | The ID of the organisation.                                                                                                                                                                                                                                                                    |
| plugin\_type     | string | <p>Enum<br><code>ACTIVITY\_ANALYZER</code><br><code>DISPLAY\_AD\_RENDERER</code><br><code>AUDIENCE\_SEGMENT\_EXTERNAL\_FEED</code><br><code>EMAIL\_ROUTER</code><br><code>EMAIL\_TEMPLATE\_RENDERER</code><br><code>ATTRIBUTION\_PROCESSOR</code><br><code>SCENARIO\_CUSTOM\_ACTION</code></p> |

{% tabs %}
{% tab title="200 " %}

```
{
    "status":"ok",
    "data":[
        ...
    ],
    "count":4,
    "total":4,
    "first_result":0,
    "max_results":50
}
```

{% endtab %}
{% endtabs %}

## Create a preset

<mark style="color:green;">`POST`</mark> `https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/presets`

#### Path Parameters

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| version\_id | string  | YucKTm0dvtsI |
| plugin\_id  | integer | 3VWsNrLu4v0X |

#### Request Body

| Name             | Type   | Description  |
| ---------------- | ------ | ------------ |
| properties       | array  | jbBHgUW7y4jf |
| plugin\_type     | string | p24lSxZu0cj0 |
| organisation\_id | string | aMOp3qSAFrYU |
| description      | string | wtSaA6imPU5o |
| name             | string | 586uioAI1Tdq |

## Get presets

<mark style="color:blue;">`GET`</mark> `https://api.mediarithmics.com/v1/plugins.versions.presets`

#### Query Parameters

| Name             | Type   | Description  |
| ---------------- | ------ | ------------ |
| organisation\_id | string | I93m6NC4TQcJ |
| plugin\_type     | string | N6tKrTGJkyVe |
