dots.v2.spaces.keys.byAccess_key().patch()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.spaces.keys.byAccess_key(access_key).patch(body: Key, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithAccess_keyPatchResponse>

Description

To update Spaces Access Key, send a PUT or PATCH request to /v2/spaces/keys/{access_key}. At the moment, you cannot convert a fullaccess key to a scoped key or vice versa. You can only update the name of the key.

Parameters

Path Parameters

access_key string required

Example: DOACCESSKEYEXAMPLE

The access key's ID.

Request Body

name string optional

Example: my-access-key

The access key's name.

grants array of objects optional

The list of permissions for the access key.

Default: []

Show child properties
bucket string required

Example: my-bucket

The name of the bucket.

permission string required

Example: read

The permission to grant to the user. Possible values are read, readwrite, fullaccess, or an empty string.

accessKey string optional read-only

Example: DOACCESSKEYEXAMPLE

The Access Key ID used to access a bucket.

createdAt string optional read-only

Example: 2018-07-19T15:04:16Z

The date and time the key was created.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.spaces.keys
    .byAccess_key("DOACCESSKEYEXAMPLE").patch({
    name: "new-key-name",
});

Response Example

Show Response Example
{
  "key": {
    "name": "new-key-name",
    "access_key": "DOACCESSKEYEXAMPLE",
    "grants": [
      {
        "bucket": "my-bucket",
        "permission": "read"
      }
    ],
    "created_at": "2018-07-19T15:04:16Z"
  }
}

More Information

See /v2/spaces/keys/{access_key} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.