.do
Resources

Functions

Serverless function management

Deploy and manage serverless functions.

Endpoints

List Functions

GET /:namespace/functions

Get Function

GET /:namespace/functions/:id

Deploy Function

POST /:namespace/functions

Body:

{
  "name": "process-order",
  "code": "export default async (req) => { ... }",
  "runtime": "node",
  "memory": 256
}

Update Function

PUT /:namespace/functions/:id

Delete Function

DELETE /:namespace/functions/:id

Invoke Function

POST /:namespace/functions/:id/invoke

Body:

{
  "orderId": "order_123",
  "items": [...]
}

SDK

import { $ } from 'sdk.do'

const client = $('acme.com')

// Deploy
const fn = await client.Function.create({
  name: 'process-order',
  code: 'export default async (req) => { ... }',
  runtime: 'node',
  memory: 256
})

// Invoke
const result = await client.Function.invoke('fn_123', {
  orderId: 'order_123',
  items: [...]
})

// List
const functions = await client.Function.list()

// Delete
await client.Function.delete('fn_123')