Skip to main content

Organizations

Organizations are a container for projects, domains, and KV databases. API access tokens are scoped to access resources within an organization.

Get organization details

GET/v1/organizations/{organizationId}
Get meta information about your organization, passing in your unique ID as a path parameter.
Parameters
NameTypeDescription
organizationId (required)string (uuid)

Organization 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-org",
  "createdAt": "2021-08-01T00:00:00Z",
  "updatedAt": "2021-08-01T00:00:00Z"
}

Get analytics for organization

GET/v1/organizations/{organizationId}/analytics
Get analytics information for an organization.
Parameters
NameTypeDescription
organizationId (required)string (uuid)

Organization ID

since (required)string (date-time)

Start of the time range in RFC3339 format.

Defaults to 24 hours ago.

Note that the maximum allowed time range is 24 hours.

until (required)string (date-time)

End of the time range in RFC3339 format.

Defaults to the current time.

Note that the maximum allowed time range is 24 hours.

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
    ]
  ]
}

List projects for an organization

GET/v1/organizations/{organizationId}/projects
Get a paginated list of Projects for an organization. Links to the first, last, next, and previous pages of results are found in the Link header of the response.
Parameters
NameTypeDescription
pageinteger
limitinteger
organizationId (required)string (uuid)

Organization 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"
  }
]

Create a new project for an organization

POST/v1/organizations/{organizationId}/projects
Create a new project within the given organization. A project is a container for deployments, and can be associated with domains and KV databases.
Parameters
NameTypeDescription
organizationId (required)string (uuid)

Organization ID

Request Body (JSON)
NameTypeDescription
name (nullable)string

The name of the project. If this is null, a random name will be generated.

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"
}

List an organization's KV databases

GET/v1/organizations/{organizationId}/databases
Get a list of KV databases associated with an organization. Links to the first, last, next, and previous pages of results are found in the Link header of the response.
Parameters
NameTypeDescription
pageinteger
limitinteger
organizationId (required)string (uuid)

Organization ID

Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)

A KV database ID

organizationIdstring (uuid)

An organization ID that this KV database belongs to

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

Create a KV database for an organization

POST/v1/organizations/{organizationId}/databases
Create a new KV database associated with an organization.
Parameters
NameTypeDescription
organizationId (required)string (uuid)

Organization ID

Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)

A KV database ID

organizationIdstring (uuid)

An organization ID that this KV database belongs to

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

List an organization's domains

GET/v1/organizations/{organizationId}/domains
Get a list of domains associated with an organization. Links to the first, last, next, and previous pages of results are found in the Link header of the response.
Parameters
NameTypeDescription
pageinteger
limitinteger
organizationId (required)string (uuid)

Organization ID

Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)

The ID of the domain.

organizationIdstring (uuid)

The ID of the organization that the domain is associated with.

domainstring

The domain value.

tokenstring
isValidatedboolean

Whether the domain's ownership is validated or not.

certificatesarray

TLS certificates for the domain.

provisioningStatusundefined
projectIdstring (uuid)

The ID of the project that the domain is associated with.

If the domain is not associated with any project, this field is omitted.

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

These records are used to verify the ownership of the domain.

Add a domain to an organization

POST/v1/organizations/{organizationId}/domains
Add a new domain to the specified organization. Before use, added domain needs to be verified, and TLS certificates for the domain need to be provisioned.
Parameters
NameTypeDescription
organizationId (required)string (uuid)

Organization ID

Request Body (JSON)
NameTypeDescription
domainstring
Responses
Response Type

application/json

Response Properties
NameTypeDescription
idstring (uuid)

The ID of the domain.

organizationIdstring (uuid)

The ID of the organization that the domain is associated with.

domainstring

The domain value.

tokenstring
isValidatedboolean

Whether the domain's ownership is validated or not.

certificatesarray

TLS certificates for the domain.

provisioningStatusundefined
projectIdstring (uuid)

The ID of the project that the domain is associated with.

If the domain is not associated with any project, this field is omitted.

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

These records are used to verify the ownership of the domain.