# Backup

## Method & Permission

| API           | GET   | POST  | PUT | PATCH   | DELETE |
| ------------- | ----- | ----- | --- | ------- | ------ |
| Backup List   | Admin | Admin | -   | -       | -      |
| Backup Detail | Admin | -     | -   | Admin\* | Admin  |

\*Only the `name` and `description` can be updated.

## Backup List

<mark style="color:blue;">`GET`</mark> `{{ base_url }} /organizations/backup/list/{level}/{sid}/{serializer}/`

#### Path Parameters

| Name       | Type   | Description      |
| ---------- | ------ | ---------------- |
| level      | string | organization     |
| sid        | string | organization sid |
| serializer | string |                  |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```yaml
# serializer = name
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 1,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "Test Backup"
        }
    ]
}
# serializer = list
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 1,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "Test Backup",
            "status": "In Progress",
            "versions": xxx,
            "files": xxx,
            "file_size": "xxx bytes",
            "date_created": "2020-02-10T07:32:03.157779Z",
            "change_permission": true
        }
    ]
}
# serializer = detail
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 1,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "Test Backup",
            "description": "",
            "status": "In Progress",
            "versions": 382,
            "files": 21,
            "price": "$xxx",
            "file_size": "xxx bytes",
            "file_path": "xxx",
            "date_created": "2020-02-10T07:32:03.157779Z",
            "change_permission": true
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Backup List

<mark style="color:green;">`POST`</mark> `{{ base_url }} /organizations/backup/list/{level}/{sid}/{serializer}/`

Each POST creates one backup. No form data required.

#### Path Parameters

| Name       | Type   | Description      |
| ---------- | ------ | ---------------- |
| level      | string | organization     |
| sid        | string | organization sid |
| serializer | string |                  |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```yaml
{
    "sid": "xxx",
    "name": "Test Backup",
    "description": "",
    "status": "In Progress",
    "versions": 382,
    "files": 21,
    "price": "$xxx",
    "file_size": "xxx bytes",
    "file_path": "xxx",
    "date_created": "2020-02-10T07:32:03.157779Z",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}

## Backup Detail

<mark style="color:blue;">`GET`</mark> `{{ base_url }} /organizations/backup/detail/{sid}/`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| sid  | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```yaml
{
    "sid": "xxx",
    "name": "Test Backup",
    "description": "",
    "status": "In Progress",
    "versions": 382,
    "files": 21,
    "price": "$xxx",
    "file_size": "xxx bytes",
    "file_path": "xxx",
    "date_created": "2020-02-10T07:32:03.157779Z",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}

## Backup Detail

<mark style="color:red;">`DELETE`</mark> `/organizations/backup/detail/{sid}/`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| sid  | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```
{}
```

{% endtab %}
{% endtabs %}
