Skip to main content
POST
/
v1
/
functions
/
{slug}
/
deployments
cURL
curl --request POST \
  --url https://9dc2c77e6dbf.ngrok-free.app/v1/functions/{slug}/deployments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "entryPointUrl": "main.ts",
  "importMapUrl": "import_map.json",
  "lockFileUrl": "deno.lock",
  "assets": {
    "main.ts": {
      "kind": "file",
      "content": "Deno.serve((req: Request) => new Response(\"Hello World\"));",
      "encoding": "utf-8"
    },
    "symlink.ts": {
      "kind": "symlink",
      "target": "main.ts"
    }
  }
}'
{
  "id": "abcde12vwxyz",
  "projectId": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  "description": "My deployment",
  "status": "pending",
  "createdAt": "2021-08-01T00:00:00Z",
  "updatedAt": "2021-08-01T00:00:00Z"
}

Authorizations

Authorization
string
header
required

App API key (format: sk_live_app_* or sk_test_app_*) for app-level operations

Path Parameters

slug
string
required

Function slug identifier

Minimum length: 1
Example:

"my-function"

Body

application/json
entryPointUrl
string
required

URL of the entry point of the application. This is the file that will be executed when the deployment is invoked.

Example:

"main.ts"

assets
object
required

A map whose key represents a file path, and the value is an asset that composes the deployment.

Example:
{
"main.ts": {
"kind": "file",
"content": "Deno.serve((req: Request) => new Response(\"Hello World\"));",
"encoding": "utf-8"
},
"symlink.ts": { "kind": "symlink", "target": "main.ts" }
}
importMapUrl
string<uri> | null

URL of the import map file. If null, auto-discovery will be performed. If empty string, no import map will be used.

Example:

"import_map.json"

lockFileUrl
string<uri> | null

URL of the lock file. If null, auto-discovery will be performed. If empty string, no lock file will be used.

Example:

"deno.lock"

Response

Create a new deployment for the function

id
string
required

Deployment ID (not UUID v4)

Example:

"abcde12vwxyz"

projectId
string<uuid>
required

Project UUID

Example:

"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"

description
string | null
required

The description of this deployment

Example:

"My deployment"

status
enum<string>
required

The status of the deployment

Available options:
failed,
pending,
success
Example:

"pending"

createdAt
string<date-time>
required

When the deployment was created

Example:

"2021-08-01T00:00:00Z"

updatedAt
string<date-time>
required

When the deployment was last updated

Example:

"2021-08-01T00:00:00Z"

I