# Requests and approvals

> The kinds of request, the input each one needs, how approval works and how to follow a request to the end.

Type: Guide. Updated 2 December 2026. Page: https://www.colossium.cloud/docs/requests

## Making a request

`POST /requests` with a `kind`, an optional `project_id` and an `input`, and an `Idempotency-Key` header. The input is checked against the kind before the request is accepted, and a problem is reported field by field, so a request that could never run is refused straight away.

```bash
curl -sS -X POST https://api.colossium.cloud/v1/requests \
  -H "Authorization: Bearer $COLOSSIUM_API_TOKEN" -H "Content-Type: application/json" \
  -H "Idempotency-Key: orders-db-2026-12-02" \
  -d '{"kind":"databases.create","project_id":"3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37","input":{"name":"orders-db","region":"eu"}}'
```

A token needs `resource.write` for most kinds, and `resource.destroy` for every kind ending in `.delete`. A token limited to some projects must name one of them in `project_id`.

## The kinds

| Kind | Needs | What it does | Input |
| --- | --- | --- | --- |
| dns.domain.add | resource.write | Add a domain you own | `hostname`: a domain such as `example.org` |
| dns.record.create | resource.write | Add a DNS record to a domain | `zoneResourceId`: the domain's resource id. `type`: `A`, `AAAA`, `CNAME` or `TXT`. `name`: 1 to 253 characters. `content`: 1 to 2000 characters. `ttl`: 1 to 86400 seconds, default 1 (automatic). `proxied`: true or false, default false |
| dns.record.delete | resource.destroy | Remove a DNS record | `resourceId`: the record's resource id |
| functions.create | resource.write | Publish a function | `name`: lower-case letters, numbers and hyphens, starting with a letter, up to 29 characters. `code`: the function as one module, up to 70,000 characters |
| functions.update | resource.write | Replace a function's code | `resourceId`: the function. `code`: as above |
| functions.delete | resource.destroy | Delete a function | `resourceId`: the function. `confirm`: the function's name, typed out |
| databases.create | resource.write | Create a managed Postgres database | `name`: lower-case letters, numbers and hyphens, starting with a letter, up to 29 characters. `region`: `eu` or `us` |
| databases.delete | resource.destroy | Delete a database | `resourceId`: the database. `confirm`: its name, typed out |
| storage.create | resource.write | Create an object storage bucket | `name`: as for a database. `region`: `eu` or `us` |
| storage.delete | resource.destroy | Delete a bucket | `resourceId`: the bucket. `confirm`: its name, typed out |

`dns.domain.add`: You must own the domain. After it is added, create records for it.

```json
{
  "kind": "dns.domain.add",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "hostname": "example.org"
  }
}
```

`dns.record.create`: The domain must already be one of your resources.

```json
{
  "kind": "dns.record.create",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "zoneResourceId": "$ZONE_ID",
    "type": "CNAME",
    "name": "www",
    "content": "edge.example.org",
    "ttl": 300
  }
}
```

`dns.record.delete`: The id comes from `GET /resources`.

```json
{
  "kind": "dns.record.delete",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "resourceId": "$RECORD_ID"
  }
}
```

`functions.create`: The code is one file with `export default { fetch(request) { ... } }`. It cannot import other code. Never put secrets in it.

```json
{
  "kind": "functions.create",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "name": "hello",
    "code": "export default { fetch() { return new Response(\"hello\") } }"
  }
}
```

`functions.update`: Only one change to a function can be open at a time.

```json
{
  "kind": "functions.update",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "resourceId": "$FUNCTION_ID",
    "code": "export default { fetch() { return new Response(\"v2\") } }"
  }
}
```

`functions.delete`: Cannot be undone.

```json
{
  "kind": "functions.delete",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "resourceId": "$FUNCTION_ID",
    "confirm": "hello"
  }
}
```

`databases.create`: The region is where the data is kept. It is not moved without your instruction. Not available on the Free plan.

```json
{
  "kind": "databases.create",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "name": "orders-db",
    "region": "eu"
  }
}
```

`databases.delete`: Cannot be undone once backups expire.

```json
{
  "kind": "databases.delete",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "resourceId": "$DATABASE_ID",
    "confirm": "orders-db"
  }
}
```

`storage.create`: The bucket is made in the region you choose.

```json
{
  "kind": "storage.create",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "name": "assets",
    "region": "eu"
  }
}
```

`storage.delete`: Cannot be undone.

```json
{
  "kind": "storage.delete",
  "project_id": "3f2b8c1e-5d4a-4e7b-9c1d-2a6f8e0b4d37",
  "input": {
    "resourceId": "$BUCKET_ID",
    "confirm": "assets"
  }
}
```

> **Important.** Names are public identifiers. They appear in your console and in the audit log, and a resource name is not treated as protected customer data. **Do not put personal data in a name, a description, a slug or an idempotency key.**

## When the input is wrong

You get `400 invalid_request` with `error.details.problems`, one line per problem, and nothing is queued:

```json
{
  "error": {
    "code": "invalid_request",
    "message": "The input is not valid for this kind of request.",
    "request_id": "req_5c1e9a07b24d6f83a0e1c752",
    "doc_url": "https://docs.colossium.cloud/errors#invalid_request",
    "details": { "problems": ["input.name: Use lower-case letters, numbers and hyphens, starting with a letter. Up to 29 characters."] }
  }
}
```

## Approval, and what to expect

Colossium reviews every request before it runs. After approval a request is either run automatically or carried out by our team, depending on the service. In both cases you follow the same states, and you do not need to know which.

- **Plan on waiting.** A request can be `awaiting_approval` for some time. Give your waiting code a generous timeout (15 minutes is a sensible start) and make it safe to resume.
- **Not every service is available yet.** A request for a service marked planned in the [catalogue](/docs/availability) can be accepted and then not fulfilled. Check before you build on it.
- **Plan limits apply.** A request that would go over your plan's limit for that service is refused with `409 quota_exceeded`, and each organisation can make up to 30 requests an hour (`429 rate_limited`).
- **One delete at a time.** Asking twice to delete the same thing while the first is open is refused.

## Following a request

`GET /requests/{id}` returns the request and its `events`, the progress notes in order. Poll it every few seconds, not faster. Watch `state`, and stop when it is `succeeded`, `failed` or `cancelled`.

```bash
until state=$(curl -sS "https://api.colossium.cloud/v1/requests/$REQUEST_ID" -H "Authorization: Bearer $COLOSSIUM_API_TOKEN" | jq -r .state) \
      && case "$state" in succeeded|failed|cancelled) true;; *) false;; esac; do
  echo "state: $state"; sleep 10
done
echo "final: $state"
```

The [reference client](/docs/client-typescript) does this for you with `requests.waitFor`, slows down when you are near the rate limit, and times out when you tell it to.

On `succeeded`, `resource_id` is the new resource. On `failed`, `failure` says what went wrong in plain words, with no internal detail. Fix the cause and ask again with a **new** idempotency key: the old key still points at the failed request.

## Cancelling

`POST /requests/{id}/cancel` withdraws a request that is `awaiting_approval` or `queued`. One that has started cannot be cancelled, and you get `409 conflict`. Cancelling is recorded in the audit log.

## Deleting things

> **Deletes are permanent.** Deletes cannot be undone. Databases and buckets are removed from the live service at once, and copies in backups are overwritten within 35 days.

Every `.delete` kind needs `confirm`, the name of the thing, typed out. It is checked again when the request runs, so a request with the wrong name fails safely. This is a guard against deleting the wrong thing with a wrong id. Give delete tokens the smallest reach you can: one project, a short expiry and an address limit.

## What goes in `input`

> **Data protection.** The input of a request is stored with the request for as long as the organisation exists, and is visible to everyone in the organisation who can read requests, and to Colossium staff who fulfil it. Send only what the service needs. Never send secrets in an input (for a function, read secrets at run time from where you keep them) and never send personal data that the service does not need.
