Skip to main content

namespace_access_keys

Creates, updates, deletes, gets or lists a namespace_access_keys resource.

Overview

Namenamespace_access_keys
TypeResource
Iddigitalocean.serverless.namespace_access_keys

Fields

The following fields are returned by SELECT queries:

A JSON response containing a list of access keys for the namespace.

NameDatatypeDescription
idstringThe access key's unique identifier with prefix 'dof_v1_'. (example: dof_v1_d79e8aeb42e5476893c7d4c59a166264)
namestringThe access key's name. (example: my-function-access-key)
created_atstring (date-time)The date and time the key was created. (example: 2025-12-19T10:30:00Z)
expires_atstring (date-time)When the key expires (null for non-expiring keys). (example: 2026-12-19T10:30:00Z)
updated_atstring (date-time)The date and time the key was last updated. (example: 2025-12-19T10:30:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
functions_access_key_listselectnamespace_idLists all access keys for a serverless functions namespace.

To list access keys, send a GET request to /v2/functions/namespaces/{namespace_id}/keys.
functions_access_key_createinsertnamespace_id, nameCreates a new access key for a serverless functions namespace.
The access key can be used to authenticate requests to the namespace's functions.
The secret key is only returned once upon creation.

To create an access key, send a POST request to /v2/functions/namespaces/{namespace_id}/keys.
functions_access_key_updatereplacenamespace_id, key_id, nameUpdates 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}.
functions_access_key_deletedeletenamespace_id, key_idDeletes an access key for a serverless functions namespace.

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

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
key_idstringThe ID of the access key to be managed. (example: dof-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
namespace_idstringThe ID of the namespace to be managed. (example: fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

SELECT examples

Lists all access keys for a serverless functions namespace.

To list access keys, send a GET request to /v2/functions/namespaces/{namespace_id}/keys.

SELECT
id,
name,
created_at,
expires_at,
updated_at
FROM digitalocean.serverless.namespace_access_keys
WHERE namespace_id = '{{ namespace_id }}' -- required
;

INSERT examples

Creates a new access key for a serverless functions namespace.
The access key can be used to authenticate requests to the namespace's functions.
The secret key is only returned once upon creation.

To create an access key, send a POST request to /v2/functions/namespaces/{namespace_id}/keys.

INSERT INTO digitalocean.serverless.namespace_access_keys (
name,
expires_in,
namespace_id
)
SELECT
'{{ name }}' /* required */,
'{{ expires_in }}',
'{{ namespace_id }}'
RETURNING
access_key
;

REPLACE examples

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}.

REPLACE digitalocean.serverless.namespace_access_keys
SET
name = '{{ name }}'
WHERE
namespace_id = '{{ namespace_id }}' --required
AND key_id = '{{ key_id }}' --required
AND name = '{{ name }}' --required
RETURNING
access_key;

DELETE examples

Deletes an access key for a serverless functions namespace.

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

DELETE FROM digitalocean.serverless.namespace_access_keys
WHERE namespace_id = '{{ namespace_id }}' --required
AND key_id = '{{ key_id }}' --required
;