# Update Specification Group Endpoint

<p class="callout warning">This endpoint is only available if `aerocargo/specifications` is installed.</p>

## Structure

### Specification Group

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td><td>**Version**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the specification group</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`name`</td><td>string</td><td>The name for the specification group</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`sort`</td><td>int</td><td>The sort for the specification group</td><td>No</td><td>`>=1.0.0`</td></tr><tr><td>`fields`</td><td>array</td><td>An array of [Field](https://support.aerocommerce.com/books/api/page/update-specification-group-endpoint/update-specification-group-endpoint#bkmrk-field) objects</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`media`</td><td>array</td><td>An array of [Media](https://support.aerocommerce.com/books/api/page/update-specification-group-endpoint/update-specification-group-endpoint#bkmrk-media) objects</td><td>No</td><td>`>=0.3.2`</td></tr><tr><td>`settings`</td><td>object</td><td>A [Settings](https://support.aerocommerce.com/books/api/page/update-specification-group-endpoint/update-specification-group-endpoint#bkmrk-settings) object with grouped key-value pairs</td><td>No</td><td>`>=1.0.0`</td></tr></tbody></table>

### Field

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col><col style="width: 20.0238%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td><td>**Version**  
</td></tr><tr><td>`name`</td><td>string</td><td>The name of the field</td><td>Yes</td><td>`>=0.1.0`</td></tr><tr><td>`presets`</td><td>array</td><td>An array of strings to use as preset options</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`default`</td><td>string</td><td>The default value for the field, note: \_p:0 means the first preset</td><td>Yes</td><td>`>=0.1.0`</td></tr><tr><td>`prefix`</td><td>string</td><td>The prefix for the field</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`suffix`</td><td>string</td><td>The suffix for the field</td><td>No</td><td>`>=0.1.0`</td></tr><tr><td>`sort`</td><td>int</td><td>The sort for the field</td><td>No</td><td>`>=1.0.0`</td></tr><tr><td>`media`</td><td>array</td><td>An array of [Media](https://support.aerocommerce.com/books/api/page/update-specification-group-endpoint/update-specification-group-endpoint#bkmrk-media) objects</td><td>No</td><td>`>=1.0.0`</td></tr><tr><td>`settings`</td><td>object</td><td>A [Settings](https://support.aerocommerce.com/books/api/page/update-specification-group-endpoint/update-specification-group-endpoint#bkmrk-settings) object with grouped key-value pairs</td><td>No</td><td>`>=1.0.0`</td></tr></tbody></table>

### Media

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the media</td><td>`*`</td></tr><tr><td>`source`</td><td>string</td><td>The source of the media, e.g. test.png</td><td>`*`</td></tr></tbody></table>

`*` At least one must be present.

### Settings

Settings are grouped as key-value pairs.

- Use "\_" for ungrouped settings.
- Each group contains its own object of key-value pairs.

```json
{
    "settings": {
        "_": {
            "no_group": "value"
        },
        "group": {
            "key": "value"
        }
    }
}
```

## Example Request

```
PUT /api/specification-groups/{id}
```

```json
{
    "name": "API Test",
    "fields": [
        {
            "id": 1,
            "name": "Field 1 Updated",
            "presets": ["D", "E", "F"],
            "default": "G"
        }
    ]
}
```

## Example Response

```json
{
    "specificationGroup": {
        "id": 1
    }
}
```