# Snapshots ## Retrieve `client.gpuDroplets.snapshots.retrieve(number | stringsnapshotID, RequestOptionsoptions?): SnapshotRetrieveResponse` **get** `/v2/snapshots/{snapshot_id}` To retrieve information about a snapshot, send a GET request to `/v2/snapshots/$SNAPSHOT_ID`. The response will be a JSON object with a key called `snapshot`. The value of this will be an snapshot object containing the standard snapshot attributes. ### Parameters - `snapshotID: number | string` The ID of a Droplet snapshot. - `number` - `string` ### Returns - `SnapshotRetrieveResponse` - `snapshot?: Snapshots` - `id: string` The unique identifier for the snapshot. - `created_at: string` A time value given in ISO8601 combined date and time format that represents when the snapshot was created. - `min_disk_size: number` The minimum size in GB required for a volume or Droplet to use this snapshot. - `name: string` A human-readable name for the snapshot. - `regions: Array` An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshot = await client.gpuDroplets.snapshots.retrieve(6372321); console.log(snapshot.snapshot); ``` ## List `client.gpuDroplets.snapshots.list(SnapshotListParamsquery?, RequestOptionsoptions?): SnapshotListResponse` **get** `/v2/snapshots` To list all of the snapshots available on your account, send a GET request to `/v2/snapshots`. The response will be a JSON object with a key called `snapshots`. This will be set to an array of `snapshot` objects, each of which will contain the standard snapshot attributes. ### Filtering Results by Resource Type It's possible to request filtered results by including certain query parameters. #### List Droplet Snapshots To retrieve only snapshots based on Droplets, include the `resource_type` query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`. #### List Volume Snapshots To retrieve only snapshots based on volumes, include the `resource_type` query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. ### Parameters - `query: SnapshotListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page - `resource_type?: "droplet" | "volume"` Used to filter snapshots by a resource type. - `"droplet"` - `"volume"` ### Returns - `SnapshotListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `links?: PageLinks` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` - `snapshots?: Array` - `id: string` The unique identifier for the snapshot. - `created_at: string` A time value given in ISO8601 combined date and time format that represents when the snapshot was created. - `min_disk_size: number` The minimum size in GB required for a volume or Droplet to use this snapshot. - `name: string` A human-readable name for the snapshot. - `regions: Array` An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshots = await client.gpuDroplets.snapshots.list(); console.log(snapshots.meta); ``` ## Delete `client.gpuDroplets.snapshots.delete(number | stringsnapshotID, RequestOptionsoptions?): void` **delete** `/v2/snapshots/{snapshot_id}` Both Droplet and volume snapshots are managed through the `/v2/snapshots/` endpoint. To delete a snapshot, send a DELETE request to `/v2/snapshots/$SNAPSHOT_ID`. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. ### Parameters - `snapshotID: number | string` The ID of a Droplet snapshot. - `number` - `string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.snapshots.delete(6372321); ```