Skip to content
Management API Reference

[Alpha] Deploy a worker

post/v2/projects/{ref}/workers/{name}/deploy

Creates the worker if it does not exist, building from a context staged through the uploads endpoint. The build runs asynchronously: this answers 202 and the worker reaches build_state active or failed later.

OAuth scopes

  • edge_functions:write

The fine-grained token must include the following permissions to access this endpoint:

  • workers_write

Path parameters

  • ref
    Required
    string

    Project ref

  • name
    Required
    string

Body

  • data
    Required
    object

Response codes

  • 202
  • 401
  • 403
  • 429

Response (202)

{
"data": {
"type": "project_worker",
"id": "hello-world",
"attributes": {
"spec": {
"runtime": "node",
"size": "2gb-1vcpu",
"exposure": "public",
"instances": 1
},
"build_state": "building",
"secret_generation": "lorem",
"state_reason": "lorem",
"image_version": "lorem",
"deleting": true,
"instances": {
"declared": -9007199254740991,
"live": -9007199254740991,
"ready": -9007199254740991,
"stale": -9007199254740991
},
"instances_error": "lorem"
}
}
}