Skip to main content

Projects

Projects are a container for deployments, and can be associated with domains and KV databases in an organization.

Get project details

GET/v1/projects/{projectId}
Get meta information about a project by unique ID.
Parameters
NameTypeDescription
projectId (required)string (uuid)

Project ID

Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)
namestring
createdAtstring (date-time)
updatedAtstring (date-time)
Example
{
  "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  "name": "my-project",
  "createdAt": "2021-08-01T00:00:00Z",
  "updatedAt": "2021-08-01T00:00:00Z"
}

Update project details

PATCH/v1/projects/{projectId}
Update meta information about a project.
Parameters
NameTypeDescription
projectId (required)string (uuid)

Project ID

Request Body (JSON)
NameTypeDescription
namestring
Example Body
{
  "name": "my-project"
}
Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)
namestring
createdAtstring (date-time)
updatedAtstring (date-time)
Example
{
  "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  "name": "my-project",
  "createdAt": "2021-08-01T00:00:00Z",
  "updatedAt": "2021-08-01T00:00:00Z"
}

Delete a project

DELETE/v1/projects/{projectId}
Delete a project by unique ID.
Parameters
NameTypeDescription
projectId (required)string (uuid)

Project ID

Responses
Empty response body

Get project analytics

GET/v1/projects/{projectId}/analytics
Get analytics data for the specified project. The analytics are returned as time series data in 15 minute intervals, with the time field representing the start of the interval.
Parameters
NameTypeDescription
projectId (required)string (uuid)

Project ID

since (required)string (date-time)

Start of the time range in RFC3339 format.

Defaults to 24 hours ago.

until (required)string (date-time)

End of the time range in RFC3339 format.

Defaults to the current time.

Responses
Response Type

application/json

Response Properties
NameTypeDescription
fieldsarray
valuesarray
Example
{
  "fields": [
    {
      "name": "time",
      "type": "time"
    },
    {
      "name": "requestCount",
      "type": "number"
    },
    {
      "name": "cpuSeconds",
      "type": "number"
    },
    {
      "name": "uptimeSeconds",
      "type": "number"
    },
    {
      "name": "maxRssMemoryBytes",
      "type": "number"
    },
    {
      "name": "networkIngressBytes",
      "type": "number"
    },
    {
      "name": "networkEgressBytes",
      "type": "number"
    },
    {
      "name": "kvReadCount",
      "type": "number"
    },
    {
      "name": "kvWriteCount",
      "type": "number"
    },
    {
      "name": "kvReadUnits",
      "type": "number"
    },
    {
      "name": "kvWriteUnits",
      "type": "number"
    }
  ],
  "values": [
    [
      "2023-08-01T00:00:00Z",
      111,
      111,
      111,
      111,
      111,
      111,
      111,
      111,
      111,
      111
    ],
    [
      "2023-08-01T00:15:00Z",
      222,
      222,
      222,
      222,
      222,
      222,
      222,
      222,
      222,
      222
    ],
    [
      "2023-08-01T00:30:00Z",
      333,
      333,
      333,
      333,
      333,
      333,
      333,
      333,
      333,
      333
    ],
    [
      "2023-08-01T00:45:00Z",
      444,
      444,
      444,
      444,
      444,
      444,
      444,
      444,
      444,
      444
    ],
    [
      "2023-08-01T01:00:00Z",
      555,
      555,
      555,
      555,
      555,
      555,
      555,
      555,
      555,
      555
    ]
  ]
}

Get project deployments

GET/v1/projects/{projectId}/deployments
Get a paginated list of deployments belonging to the specified project. The URLs for the next, previous, first, and last page are returned in theLink header of the response if needed.
Parameters
NameTypeDescription
pageinteger
limitinteger
projectId (required)string (uuid)

Project ID

Responses
Response Type

application/json

Response Properties
NameTypeDescription
idundefined
projectIdstring (uuid)
statusundefined
domainsarray
databasesobject

The KV databases that this deployment has access to. Currently, only "default" database is supported.

createdAtstring (date-time)
updatedAtstring (date-time)

Create a project deployment

POST/v1/projects/{projectId}/deployments

Initiate a build process for a new deployment. Note that this process is asynchronous - a successful request to this endpoint API doesn't mean the deployment is ready.

For now, you can track the progress of a build by polling either the build logs for a deployment or the deployment details API endpoints.

Parameters
NameTypeDescription
projectId (required)string (uuid)

Project ID

Request Body (JSON)
NameTypeDescription
entryPointUrlstring

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

importMapUrl (nullable)string

An URL of the import map file.

If null is given, import map auto-discovery logic will be performed, where it looks for Deno's config file (i.e. deno.json or deno.jsonc) which may contain an embedded import map or a path to an import map file. If found, that import map will be used.

If an empty string is given, no import map will be used.

lockFileUrl (nullable)string

An URL of the lock file.

If null is given, lock file auto-discovery logic will be performed, where it looks for Deno's config file (i.e. deno.json or deno.jsonc) which may contain a path to a lock file or boolean value, such as "lock": false or "lock": "my-lock.lock". If a config file is found, the semantics of the lock field is the same as the Deno CLI, so refer to the CLI doc page.

If an empty string is given, no lock file will be used.

compilerOptions (nullable)object
assetsobject
envVarsobject

A dictionary of environment variables to be set in the runtime environment of the deployment.

databases (nullable)object

KV database ID mappings to associate with the deployment.

A key represents a KV database name (e.g. "default"), and a value is a KV database ID.

Currently, only "default" database is supported. If any other database name is specified, that will be rejected.

If not provided, the deployment will be created with no KV database attached.

Example Body
{
  "entryPointUrl": "main.ts",
  "importMapUrl": null,
  "lockFileUrl": null,
  "compilerOptions": null,
  "assets": {
    "main.ts": {
      "kind": "file",
      "content": "Deno.serve((req: Request) => new Response(\"Hello World\"));\n",
      "encoding": "utf-8"
    },
    "images/cat1.png": {
      "kind": "file",
      "content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk",
      "encoding": "base64"
    },
    "images/cat2.png": {
      "kind": "file",
      "gitSha1": "5c4f8729e5c30a91a890e24d7285e89f418c637b"
    },
    "symlink.png": {
      "kind": "symlink",
      "target": "images/cat1.png"
    }
  },
  "envVars": {
    "MY_ENV": "hey"
  },
  "databases": {
    "default": "5b484959-cba2-482d-95ab-ba592784af80"
  }
}
Responses
Response Type

application/json

Response Properties
NameTypeDescription
idundefined
projectIdstring (uuid)
statusundefined
domainsarray
databasesobject

The KV databases that this deployment has access to. Currently, only "default" database is supported.

createdAtstring (date-time)
updatedAtstring (date-time)