---
type: api
title: Reset the project credentials
description: Retrieve new project credentials, invalidating the previous ones.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-serverless/operation/operation-resetelasticsearchprojectcredentials
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-serverless/operation/operation-resetelasticsearchprojectcredentials
products:
  - Elastic Cloud Serverless
---

# Reset the project credentials

- Server: `https://api.elastic-cloud.com`

## Paths

- `POST` `/api/v1/serverless/projects/elasticsearch/{id}/_reset-credentials`

#### Path parameters

- `id` (string · pattern: ^[a-z0-9]{32}$) — required
  The ID of the project

## Description

Retrieve new project credentials, invalidating the previous ones.

## Authentication

- Api key: `Authorization: <value>`
  API keys are used to authenticate requests to the Elastic Cloud Serverless REST API.
  Generate your secret API key in https://cloud.elastic.co/account/keys
  You must provide the API key for all API requests in the Authorization header as follows:
  
  ```
  "Authorization: ApiKey $API_KEY"
  ```
  
  For example, if you interact with the API using the curl command:
  
  ```
  curl -H "Authorization: ApiKey essu_..." https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch
  ```

## Header parameters

- `If-Match` (string) — optional
  ETag value fetched in a previous GET project request. Used to prevent simultaneous updates

## Responses

#### `200`

The new project credentials.

`application/json`

- `username` (string)
  Basic auth username that can be used to access the Elasticsearch API.
- `password` (string · format: password)
  Basic auth password that can be used to access the Elasticsearch API.
##### Response headers

- `ETag` (string)

#### `404`

Not Found

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `409`

Conflict

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
## Code examples

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${ID}/_reset-credentials" \
  -H "Authorization: ApiKey ${API_KEY}"
```

