dots.v2.functions.namespaces.byNamespace_id().keys.byKey_id().put()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.functions.namespaces.byNamespace_id(namespace_id).keys.byKey_id(key_id).put(body: WithKey_PutRequestBody, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithKey_PutResponse>

Description

Updates the name of an access key for a serverless functions namespace.

To update an access key, send a PUT request to /v2/functions/namespaces/{namespace_id}/keys/{key_id}.

Parameters

Path Parameters

namespace_id string required

Example: fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

The ID of the namespace to be managed.

key_id string required

Example: dof-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

The ID of the access key to be managed.

Request Body

name string required

Example: updated-key-name

The new name for the access key.

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.functions.namespaces
    .byNamespace_id("fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").keys
    .byKey_id("dof-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").put({
    name: "updated-key-name",
});

Response Example

Show Response Example
{
  "access_key": {
    "id": "dof_v1-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "updated-key-name",
    "expires_at": "2026-12-19T10:30:00Z",
    "created_at": "2025-12-19T10:30:00Z",
    "updated_at": "2025-12-19T16:00:00Z"
  }
}

More Information

See /v2/functions/namespaces/{namespace_id}/keys/{key_id} 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.