# Node snapshot requests

```json metadata
{
  "title": "Node snapshot requests",
  "description": "Node snapshot requests",
  "categories": ["docs","operate","rs"],
  "tableOfContents": {"sections":[{"children":[{"id":"permissions","title":"Permissions"},{"id":"request-get-request","title":"Request {#get-request}"},{"id":"response-get-response","title":"Response {#get-response}"},{"id":"status-codes-get-status-codes","title":"Status codes {#get-status-codes}"}],"id":"get-node-snapshots-get-snapshots","title":"Get node snapshots {#get-snapshots}"},{"children":[{"id":"permissions","title":"Permissions"},{"id":"request-delete-request","title":"Request {#delete-request}"},{"id":"response-delete-response","title":"Response {#delete-response}"}],"id":"delete-node-snapshot-delete-snapshot","title":"Delete node snapshot {#delete-snapshot}"}]}

,
  "codeExamples": []
}
```
| Method | Path | Description |
|--------|------|-------------|
| [GET](#get-snapshots) | `/v1/nodes/{uid}/snapshots` | Get node snapshots |
| [DELETE](#delete-snapshot) | `/v1/nodes/{uid}/snapshots/{snapshot_name}` | Delete a node snapshot |

## Get node snapshots {#get-snapshots}

```sh
GET /v1/nodes/{int: uid}/snapshots
```

Get all cluster node snapshots of the specified node.

### Permissions

| Permission name | Roles |
|-----------------|-------|
| [view_node_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_node_info) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager |

### Request {#get-request}

#### Example HTTP request

```sh
GET /v1/nodes/1/snapshots
```

#### Headers

| Key | Value | Description |
|-----|-------|-------------|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |

#### URL parameters

| Field | Type | Description |
|-------|------|-------------|
| uid | integer | The unique ID of the node requested. |

### Response {#get-response}

Returns an array of node snapshot JSON objects.

#### Example JSON body

```json
[
    {
        "created_time": "2024-01-10 20:55:54",
        "name": "nightly_snapshot_1",
        "node_uid": "1"
    },
    {
        "created_time": "2024-01-11 20:55:54",
        "name": "nightly_snapshot_2",
        "node_uid": "1"
    }
]
```

### Status codes {#get-status-codes}

| Code | Description |
|------|-------------|
| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |
| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Node UID does not exist |

## Delete node snapshot {#delete-snapshot}

```sh
DELETE /v1/nodes/{int: uid}/snapshots/{snapshot_name}
```

Delete a cluster node snapshot. Snapshots created by maintenance mode are not deleted.

### Permissions

| Permission name | Roles |
|-----------------|-------|
| [update_node](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_node) | admin |

### Request {#delete-request}

#### Example HTTP request

```sh
DELETE /v1/nodes/1/snapshots/nightly_snapshot_19
```

#### Request headers

| Key | Value | Description |
|-----|-------|-------------|
| Host | cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |


#### URL parameters

| Field | Type | Description |
|-------|------|-------------|
| uid | integer | The unique ID of the updated node. |
| snapshot_name | string | The unique name of the snapshot to delete. |

### Response {#delete-response}

Returns a JSON object that represents the deleted node snapshot.

#### Example JSON body

```json
{
    "created_time": "2024-01-11 20:55:54",
    "name": "nightly_snapshot_19",
    "node_uid": "1"
}
```

#### Status codes {#delete-status-codes}

| Code | Description |
|------|-------------|
| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |
| [403 Forbidden](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4) | Node snapshot is a maintenance snapshot and cannot be deleted |
| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Node uid does not exist |
| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Snapshot name does not exist for this node uid |

