> For the complete documentation index, see [llms.txt](https://docs.nebulablock.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nebulablock.com/api-reference/platform-api/list-workspaces/regenerate-key-pair.md).

# Regenerate Access Keys

Issue a new S3 access key pair for a workspace and invalidate the previous one.

Issue a new S3 access key pair for a workspace and invalidate the previous one. This is the only endpoint that returns the secret key, so capture it from the response.

## HTTP Request

`POST` `{API_URL}/object-storage/regenerate-key-pair`

where `API_URL = https://api.nebulablock.com/api/v1`.

## Body Parameters

| Parameter             | Requirement | Type     | Description                            |
| --------------------- | ----------- | -------- | -------------------------------------- |
| `object_storage_name` | Required    | `string` | The workspace whose keys to regenerate |

## Response Attributes

#### data `dict`

The new credentials:

* **new\_access\_key** `string`: The new access key.
* **new\_secret\_key** `string`: The new secret key.
* **message** `string`: Confirmation from the storage provider.

If the workspace name does not match one of yours, `data` is an empty list and `status` is `failed`.

#### status `string`

`success` or `failed`.

#### message `string`

A description of the result.

> **Important:** The old access key and secret are frozen and deleted as part of this call. Update your `s3cmd` config, SDK clients, and CI secrets before regenerating, not after.

## Example

#### Request

```bash
curl -X POST '{API_URL}/object-storage/regenerate-key-pair' \
-H 'Authorization: Bearer {TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"object_storage_name": "research-datasets"}'
```

#### Response

```json
{
    "data": {
        "message": "New key pair created successfully.",
        "new_access_key": "...",
        "new_secret_key": "..."
    },
    "message": "user object storage AccessKey & SecretKey successfully regenerated",
    "status": "success"
}
```

## See also

* [Create Storage Workspace](/api-reference/platform-api/list-workspaces/create-workspace.md)
* [Object Storage Quickstart](/products/object-storage/quickstart.md)
