# Bunker

## Create a Bunker

<mark style="color:green;">`POST`</mark> [`https://api.mediarithmics.com/v1/bunkers`](https://api.mediarithmics.com/v1/bunkers)

**Body parameters**

| Name              | Type   | Description                                          |
| ----------------- | ------ | ---------------------------------------------------- |
| `organisation_id` | number | ID of the organisation in which to create the bunker |
| `name`            | string | Name of the bunker                                   |

**Response**

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

```json
{
    "status": "ok",
    "data": {
        "id": "3",
        "organisation_id": "1581",
        "name": "Data collab bunker",
        "created_by": "3594",
        "created_ts": 1716834629587,
        "last_modified_by": null,
        "last_modified_ts": null,
        "archived": false,
        "archived_by": null,
        "archived_ts": null
    }
}
```

{% endtab %}
{% endtabs %}

## List all Bunkers

<mark style="color:blue;">`GET`</mark> [`https://api.mediarithmics.com/v1/bunkers?organisation_id=:organisation_id`](https://api.mediarithmics.com/v1/bunkers)

**Query string Parameters**

| Name              | Type   | Description                                                 |
| ----------------- | ------ | ----------------------------------------------------------- |
| `organisation_id` | number | ID of the organisation for which the bunkers will be listed |

**Response**

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

```json
{
    "status": "ok",
    "data": [
        {
            "id": "1",
            "organisation_id": "1581",
            "name": "Data collab bunker",
            "created_by": "3594",
            "created_ts": 1715005383130,
            "last_modified_by": null,
            "last_modified_ts": null,
            "archived": false,
            "archived_by": null,
            "archived_ts": null
        }
    ],
    "count": 1,
    "total": 1,
    "first_result": 0,
    "max_results": 2147483647
}
```

{% endtab %}
{% endtabs %}

## Get a Bunker

<mark style="color:blue;">`GET`</mark> [`https://api.mediarithmics.com/v1/bunkers/:bunker_id`](https://api.mediarithmics.com/v1/bunkers)

**Path parameters**

| Name        | Type   | Description                  |
| ----------- | ------ | ---------------------------- |
| `bunker_id` | number | ID of the bunker to retrieve |

**Response**

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

```json
{
    "status": "ok",
    "data": {
        "id": "2",
        "organisation_id": "1581",
        "name": "Data collab bunker",
        "created_by": "3594",
        "created_ts": 1715005383130,
        "last_modified_by": null,
        "last_modified_ts": null,
        "archived": false,
        "archived_by": null,
        "archived_ts": null
    }
}
```

{% endtab %}
{% endtabs %}

## Edit a Bunker

<mark style="color:orange;">`PUT`</mark> [`https://api.mediarithmics.com/v1/bunkers/:bunker_id`](https://api.mediarithmics.com/v1/bunkers)

**Body parameters**

| Name   | Type   | Description            |
| ------ | ------ | ---------------------- |
| `name` | string | New name of the bunker |

**Response**

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

```json
{
    "status": "ok",
    "data": {
        "id": "2",
        "organisation_id": "1581",
        "name": "Hop bunker",
        "created_by": "3594",
        "created_ts": 1715005383130,
        "last_modified_by": "3594",
        "last_modified_ts": 1716836604776,
        "archived": false,
        "archived_by": null,
        "archived_ts": null
    }
}
```

{% endtab %}
{% endtabs %}
