namespace_access_keys
Creates, updates, deletes, gets or lists a namespace_access_keys resource.
Overview
| Name | namespace_access_keys |
| Type | Resource |
| Id | digitalocean.serverless.namespace_access_keys |
Fields
The following fields are returned by SELECT queries:
- functions_access_key_list
A JSON response containing a list of access keys for the namespace.
| Name | Datatype | Description |
|---|---|---|
id | string | The access key's unique identifier with prefix 'dof_v1_'. (example: dof_v1_d79e8aeb42e5476893c7d4c59a166264) |
name | string | The access key's name. (example: my-function-access-key) |
created_at | string (date-time) | The date and time the key was created. (example: 2025-12-19T10:30:00Z) |
expires_at | string (date-time) | When the key expires (null for non-expiring keys). (example: 2026-12-19T10:30:00Z) |
updated_at | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
functions_access_key_list | select | namespace_id | Lists 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_create | insert | namespace_id, name | 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. | |
functions_access_key_update | replace | namespace_id, key_id, name | 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}. | |
functions_access_key_delete | delete | namespace_id, key_id | 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}. |
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.
| Name | Datatype | Description |
|---|---|---|
key_id | string | The ID of the access key to be managed. (example: dof-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) |
namespace_id | string | The ID of the namespace to be managed. (example: fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) |
SELECT examples
- functions_access_key_list
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
- functions_access_key_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: namespace_access_keys
props:
- name: namespace_id
value: "{{ namespace_id }}"
description: Required parameter for the namespace_access_keys resource.
- name: name
value: "{{ name }}"
description: |
The access key's name.
- name: expires_in
value: "{{ expires_in }}"
description: |
The duration after which the access key expires, specified as a human-readable duration string in the format `<int>h` (hours) or `<int>d` (days). Minimum value is `1h`. If omitted, the key will never expire.
REPLACE examples
- functions_access_key_update
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
- functions_access_key_delete
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
;