---
type: api
title: Set snapshot repository
description: Creates or updates the snapshot repository configuration.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-set-snapshot-repository
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-set-snapshot-repository
products:
  - Elastic Cloud Enterprise
---

# Set snapshot repository

## Paths

- `PUT` `/platform/configuration/snapshots/repositories/{repository_name}`

#### Path parameters

- `repository_name` (string) — required
  The name of the snapshot repository configuration.

## Description

Creates or updates the snapshot repository configuration.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Query string parameters

- `version` (integer) — optional
  Checks for conflicts against the metadata version, then returns the value in the `x-cloud-resource-version` header.

## Request body

The Elasticsearch snapshot repository configuration

`application/json`

- `type` (string) — required
  Repository type, (Currently supported: 's3')
- `settings` (object) — required
  Elasticsearch repository configuration settings JSON. See [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html) for more information

## Response

New snapshot repository config

`application/octet-stream`

- `repository_name` (string)
  Elasticsearch snapshot repository name
- `config` (object)
  Elasticsearch configuration JSON for a snapshot repository
## Code examples

#### curl

```curl
curl -X PUT "${API_URL}/platform/configuration/snapshots/repositories/${REPOSITORY_NAME}" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "string",
    "settings": {}
  }'
```

