Digital Ocean Functions API

[Serverless functions](https://docs.digitalocean.com/products/functions) are blocks of code that run on demand without the need to manage any infrastructure. You can develop functions on your local machine and then deploy them to a namespace using `doctl`, the [official DigitalOcean CLI tool](https://docs.digitalocean.com/reference/doctl). The Serverless Functions API currently only supports creating and managing namespaces.

GitHub OpenAPI
Business capability
IT Infrastructure Management BC-600.50

Operations 13

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v2/functions/namespaces List serverless function namespaces · Get functions namespaces #
Ask an LLM
“Which serverless function namespaces exist in my account?”
“Can I see all my Functions namespaces?”
Tell an agent
List my Functions namespaces.
Show every serverless function namespace.
POST /v2/functions/namespaces Create a serverless function namespace · Create functions namespaces #
Ask an LLM
“How do I create a new namespace for my Functions?”
“Can I name a Functions namespace when I create it?”
Tell an agent
Create a Functions namespace.
Set up a new serverless function namespace.
GET /v2/functions/namespaces/{namespace_id} Get a function namespace · Get functions namespaces by namespace id #
Ask an LLM
“What are the details of one Functions namespace?”
“Can I look up a single Functions namespace by ID?”
Tell an agent
Show Functions namespace {namespace_id}.
Get the details of Functions namespace {namespace_id}.
DELETE /v2/functions/namespaces/{namespace_id} Delete a function namespace · Delete functions namespaces by namespace id #
Ask an LLM
“How do I delete a Functions namespace?”
“Can I remove a Functions namespace I no longer use?”
Tell an agent destructive · confirm first
Delete Functions namespace {namespace_id}.
Remove the Functions namespace {namespace_id}.
GET /v2/functions/namespaces/{namespace_id}/triggers List triggers in a function namespace · Get functions namespaces by namespace id triggers #
Ask an LLM
“Which triggers are set up in a Functions namespace?”
“Can I list the triggers of one Functions namespace?”
Tell an agent
List triggers in Functions namespace {namespace_id}.
Show all triggers for Functions namespace {namespace_id}.
POST /v2/functions/namespaces/{namespace_id}/triggers Create a trigger in a function namespace · Create functions namespaces by namespace id triggers #
Ask an LLM
“How do I add a trigger to a Functions namespace?”
“Can I create a new trigger inside a Functions namespace?”
Tell an agent
Create a trigger in Functions namespace {namespace_id}.
Add a new trigger to Functions namespace {namespace_id}.
GET /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name} Get a trigger in a function namespace · Get functions namespaces by namespace id triggers by trigger name #
Ask an LLM
“What are the details of one trigger in a Functions namespace?”
“Can I look up a single Functions trigger by name?”
Tell an agent
Show trigger {trigger_name} in Functions namespace {namespace_id}.
Get the details of Functions trigger {trigger_name} in {namespace_id}.
PUT /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name} Replace a trigger in a function namespace · Replace functions namespaces by namespace id triggers by trigger name #
Ask an LLM
“How do I update a trigger in a Functions namespace?”
“Can I replace a Functions trigger with a new definition?”
Tell an agent
Replace trigger {trigger_name} in Functions namespace {namespace_id}.
Update Functions trigger {trigger_name} in {namespace_id}.
DELETE /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name} Delete a trigger from a function namespace · Delete functions namespaces by namespace id triggers by trigger name #
Ask an LLM
“How do I remove a trigger from a Functions namespace?”
“Can I delete a Functions trigger by name?”
Tell an agent destructive · confirm first
Delete trigger {trigger_name} from Functions namespace {namespace_id}.
Remove Functions trigger {trigger_name} in {namespace_id}.
GET /v2/functions/namespaces/{namespace_id}/keys List API keys in a function namespace · Get functions namespaces by namespace id keys #
Ask an LLM
“Which API keys are in a Functions namespace?”
“Can I list the keys of one Functions namespace?”
Tell an agent
List API keys in Functions namespace {namespace_id}.
Show all keys for Functions namespace {namespace_id}.
POST /v2/functions/namespaces/{namespace_id}/keys Create an API key in a function namespace · Create functions namespaces by namespace id keys #
Ask an LLM
“How do I generate an API key for a Functions namespace?”
“Can I create a new key inside a Functions namespace?”
Tell an agent
Create an API key in Functions namespace {namespace_id}.
Generate a new key for Functions namespace {namespace_id}.
PUT /v2/functions/namespaces/{namespace_id}/keys/{key_id} Replace an API key in a function namespace · Replace functions namespaces by namespace id keys by key id #
Ask an LLM
“How do I rotate an API key in a Functions namespace?”
“Can I replace a Functions key with a new one?”
Tell an agent
Replace key {key_id} in Functions namespace {namespace_id}.
Rotate Functions key {key_id} in {namespace_id}.
DELETE /v2/functions/namespaces/{namespace_id}/keys/{key_id} Delete an API key from a function namespace · Delete functions namespaces by namespace id keys by key id #
Ask an LLM
“How do I revoke an API key from a Functions namespace?”
“Can I delete a Functions key by ID?”
Tell an agent destructive · confirm first
Delete key {key_id} from Functions namespace {namespace_id}.
Revoke Functions key {key_id} in {namespace_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/digital-ocean:digital-ocean-functions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

digital-ocean-functions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DigitalOcean Functions API
  version: '2.0'
  description: 'Serverless functions are blocks of code that run on demand without the need to manage any infrastructure.

    You can develop functions on your local machine and then deploy them to a namespace using `doctl`, the official DigitalOcean CLI tool.


    The Serverless Functions API currently only supports creating and managing namespaces.'
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: DigitalOcean API Team
    email: api-engineering@digitalocean.com
  termsOfService: https://www.digitalocean.com/legal/terms-of-service-agreement/
servers:
- url: https://api.digitalocean.com
  description: production
security:
- bearer_auth: []
tags:
- name: Functions
  description: 'Serverless functions are blocks of code that run on demand without the need to manage any infrastructure.

    You can develop functions on your local machine and then deploy them to a namespace using `doctl`, the official DigitalOcean CLI tool.


    The Serverless Functions API currently only supports creating and managing namespaces.'
paths:
  /v2/functions/namespaces:
    get:
      $ref: resources/functions/functions_list_namespaces.yml
      tags:
      - Functions
      summary: Get functions namespaces
      x-summary-source: derived
      operationId: getV2FunctionsNamespaces
      x-operation-id-source: derived
    post:
      $ref: resources/functions/functions_create_namespace.yml
      tags:
      - Functions
      summary: Create functions namespaces
      x-summary-source: derived
      operationId: postV2FunctionsNamespaces
      x-operation-id-source: derived
  /v2/functions/namespaces/{namespace_id}:
    get:
      $ref: resources/functions/functions_get_namespace.yml
      tags:
      - Functions
      summary: Get functions namespaces by namespace id
      x-summary-source: derived
      operationId: getV2FunctionsNamespacesByNamespaceId
      x-operation-id-source: derived
    delete:
      $ref: resources/functions/functions_delete_namespace.yml
      tags:
      - Functions
      summary: Delete functions namespaces by namespace id
      x-summary-source: derived
      operationId: deleteV2FunctionsNamespacesByNamespaceId
      x-operation-id-source: derived
  /v2/functions/namespaces/{namespace_id}/triggers:
    get:
      $ref: resources/functions/functions_list_triggers.yml
      tags:
      - Functions
      summary: Get functions namespaces by namespace id triggers
      x-summary-source: derived
      operationId: getV2FunctionsNamespacesByNamespaceIdTriggers
      x-operation-id-source: derived
    post:
      $ref: resources/functions/functions_create_trigger.yml
      tags:
      - Functions
      summary: Create functions namespaces by namespace id triggers
      x-summary-source: derived
      operationId: postV2FunctionsNamespacesByNamespaceIdTriggers
      x-operation-id-source: derived
  /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name}:
    get:
      $ref: resources/functions/functions_get_trigger.yml
      tags:
      - Functions
      summary: Get functions namespaces by namespace id triggers by trigger name
      x-summary-source: derived
      operationId: getV2FunctionsNamespacesByNamespaceIdTriggersByTriggerName
      x-operation-id-source: derived
    put:
      $ref: resources/functions/functions_update_trigger.yml
      tags:
      - Functions
      summary: Replace functions namespaces by namespace id triggers by trigger name
      x-summary-source: derived
      operationId: putV2FunctionsNamespacesByNamespaceIdTriggersByTriggerName
      x-operation-id-source: derived
    delete:
      $ref: resources/functions/functions_delete_trigger.yml
      tags:
      - Functions
      summary: Delete functions namespaces by namespace id triggers by trigger name
      x-summary-source: derived
      operationId: deleteV2FunctionsNamespacesByNamespaceIdTriggersByTriggerName
      x-operation-id-source: derived
  /v2/functions/namespaces/{namespace_id}/keys:
    get:
      $ref: resources/functions/functions_list_keys.yml
      tags:
      - Functions
      summary: Get functions namespaces by namespace id keys
      x-summary-source: derived
      operationId: getV2FunctionsNamespacesByNamespaceIdKeys
      x-operation-id-source: derived
    post:
      $ref: resources/functions/functions_create_key.yml
      tags:
      - Functions
      summary: Create functions namespaces by namespace id keys
      x-summary-source: derived
      operationId: postV2FunctionsNamespacesByNamespaceIdKeys
      x-operation-id-source: derived
  /v2/functions/namespaces/{namespace_id}/keys/{key_id}:
    put:
      $ref: resources/functions/functions_update_key.yml
      tags:
      - Functions
      summary: Replace functions namespaces by namespace id keys by key id
      x-summary-source: derived
      operationId: putV2FunctionsNamespacesByNamespaceIdKeysByKeyId
      x-operation-id-source: derived
    delete:
      $ref: resources/functions/functions_delete_key.yml
      tags:
      - Functions
      summary: Delete functions namespaces by namespace id keys by key id
      x-summary-source: derived
      operationId: deleteV2FunctionsNamespacesByNamespaceIdKeysByKeyId
      x-operation-id-source: derived
components:
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: '## OAuth Authentication


        In order to interact with the DigitalOcean API, you or your application must

        authenticate.


        The DigitalOcean API handles this through OAuth, an open standard for

        authorization. OAuth allows you to delegate access to your account.

        Scopes can be used to grant full access, read-only access, or access to

        a specific set of endpoints.


        You can generate an OAuth token by visiting the [Apps & API](https://cloud.digitalocean.com/account/api/tokens)

        section of the DigitalOcean control panel for your account.


        An OAuth token functions as a complete authentication request. In effect, it

        acts as a substitute for a username and password pair.


        Because of this, it is absolutely **essential** that you keep your OAuth

        tokens secure. In fact, upon generation, the web interface will only display

        each token a single time in order to prevent the token from being compromised.


        DigitalOcean access tokens begin with an identifiable prefix in order to

        distinguish them from other similar tokens.


        - `dop_v1_` for personal access tokens generated in the control panel

        - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/)

        - `dor_v1_` for OAuth refresh tokens


        ### Scopes


        Scopes act like permissions assigned to an API token. These permissions

        determine what actions the token can perform. You can create API

        tokens that grant read-only access, full access, or limited access to

        specific endpoints by using custom scopes.


        Generally, scopes are designed to match HTTP verbs and common CRUD

        operations (Create, Read, Update, Delete).


        | HTTP Verb | CRUD Operation | Scope |

        |---|---|---|

        | GET | Read | `<resource>:read` |

        | POST | Create | `<resource>:create` |

        | PUT/PATCH | Update | `<resource>:update` |

        | DELETE | Delete | `<resource>:delete` |


        For example, creating a new Droplet by making a `POST` request to the

        `/v2/droplets` endpoint requires the `droplet:create` scope while

        listing Droplets by making a `GET` request to the `/v2/droplets`

        endpoint requires the `droplet:read` scope.


        Each endpoint below specifies which scope is required to access it when

        using custom scopes.


        ### How to Authenticate with OAuth


        In order to make an authenticated request, include a bearer-type

        `Authorization` header containing your OAuth token. All requests must be

        made over HTTPS.


        ### Authenticate with a Bearer Authorization Header


        ```

        curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"

        ```

        '
    inference_bearer_auth:
      type: http
      scheme: bearer
      description: '## OAuth Authentication


        In order to interact with the DigitalOcean API, you or your application must

        authenticate.


        The DigitalOcean API handles this through OAuth, an open standard for

        authorization. OAuth allows you to delegate access to your account.

        Scopes can be used to grant full access, read-only access, or access to

        a specific set of endpoints.


        You can generate an OAuth token by visiting the [Apps & API](https://cloud.digitalocean.com/account/api/tokens)

        section of the DigitalOcean control panel for your account.


        An OAuth token functions as a complete authentication request. In effect, it

        acts as a substitute for a username and password pair.


        Because of this, it is absolutely **essential** that you keep your OAuth

        tokens secure. In fact, upon generation, the web interface will only display

        each token a single time in order to prevent the token from being compromised.


        DigitalOcean access tokens begin with an identifiable prefix in order to

        distinguish them from other similar tokens.


        - `dop_v1_` for personal access tokens generated in the control panel

        - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/)

        - `dor_v1_` for OAuth refresh tokens


        ### Authenticate with a Bearer Authorization Header


        **Serverless Inference:**


        ```

        curl -X POST -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://inference.do-ai.run/v1/chat/completions"

        ```


        **Agent Inference:**


        ```

        curl -X POST -H "Authorization: Bearer $AGENT_ACCESS_KEY" "https://{your-agent-url}.agents.do-ai.run/v1/chat/completions?agent=true"

        ```


        **Note:** Agent Inference APIs use an `agent_access_key` (endpoint access

        key) instead of a DigitalOcean OAuth token. The `agent_access_key` is

        provided when you provision an agent endpoint and is scoped to that

        specific agent. It is not interchangeable with DigitalOcean OAuth tokens

        (`dop_v1_*`, `doo_v1_*`, `dor_v1_*`), which are used with Serverless

        Inference and the control-plane API at `https://api.digitalocean.com`.

        '
x-tagGroups:
- name: Public APIs
  tags:
  - Public APIs Introduction
  - 1-Click Applications
  - Account
  - Actions
  - Add-Ons
  - Action Gateway
  - Action Gateway Data Plane
  - Agent Platform API
  - Apps
  - Billing
  - Block Storage
  - Block Storage Actions
  - BYOIP Prefixes
  - CDN Endpoints
  - Certificates
  - Container Registry
  - Container Registries
  - Databases
  - Dedicated Inference
  - Domain Records
  - Domains
  - Droplet Actions
  - Droplets
  - Droplet Autoscale Pools
  - Firewalls
  - Floating IP Actions
  - Floating IPs
  - Functions
  - Harness Runtime
  - Image Actions
  - Images
  - Insights
  - Kubernetes
  - Load Balancers
  - MicroVMs [Public Preview]
  - Monitoring
  - NFS
  - NFS Actions
  - Organizations
  - Partner Network Connect
  - Project Resources
  - Projects
  - Regions
  - Reserved IP Actions
  - Reserved IPs
  - Reserved IPv6
  - Reserved IPv6 Actions
  - Security
  - Signals
  - Sizes
  - Snapshots
  - Spaces Keys
  - SSH Keys
  - Tags
  - Uptime
  - Vector Databases
  - VPC NAT Gateways
  - VPC Peerings
  - VPC Routes [Public Preview]
  - VPC Subnets [Public Preview]
  - VPCs
- name: Inference APIs
  tags:
  - Inference Introduction
  - Agent Inference
  - Batch Inference
  - Embeddings
  - Serverless Inference