allternit-cloud-api and are served at https://api.allternit.com. The OpenAPI file is cmd/allternit-cloud-api/openapi/account-projects.yaml.
A person with no computer can still make projects (chat, code, design) and bots (bot). They are saved to the account, so every device lists them. Files and runs still need a computer.
How it works with a computer
- A phone or browser with no computer creates the project here, with an id it picks (a UUID).
- When one of the person’s computers connects,
allternit-api(account_sync.rs) pulls the rows no computer has adopted yet. It creates its own project under the same id, then callsPOST /api/v1/account-projects/{id}/adopted. The first computer adopts. - After that the computer’s copy wins. A rename or a new description or instructions on the computer is copied back here, and a project deleted on the computer is deleted here.
- A delete made here while the computer is offline is a tombstone (
deleted_at). The computer deletes its copy on its next pull.
cowork/projects list and this list hold the same id for an adopted project. Treat a 404 from these routes as an empty list (a cloud-api that does not have them yet).
The computer pulls on boot, every 5 minutes, and within a minute of pairing.
Auth
- A signed-in Clerk session. API tokens (
alt_…,allternit_*) get 403. - A paired runtime’s signed request (
x-allternit-runtime-id,x-allternit-runtime-ts,x-allternit-runtime-sig), the same scheme as the runtime presence heartbeat. It acts as the computer’s owner and may adopt only for itself.
The project object
On the computer, an adopted project’s
metadata also carries accountProject.kind, so clients can tell a bot from a code project in the cowork/projects list.
List
GET /api/v1/account-projects
Answers
{"projects": [ ... ]}, newest change first, at most 500.
Create
POST /api/v1/account-projects
id is optional. Answers 201 with the project. Sending an id that already exists for you answers 200 with the stored row and changes nothing, so a retried offline create is safe. An id that belongs to someone else is 409.
Get, update, delete
GET /api/v1/account-projects/{id}answers the project, tombstones included.PATCH /api/v1/account-projects/{id}takes any ofkind,title,description,instructions,metadata. A nulldescriptionorinstructionsclears it.metadatamerges by top-level key, and a key set to null is removed. A tombstoned project is 404.DELETE /api/v1/account-projects/{id}setsdeleted_atand answers 204. Deleting again is also 204. Deleting abotproject also deletes its plan threads in the same transaction; other kinds keep theirs.
Adopt
POST /api/v1/account-projects/{id}/adopted with {"computer_id": "rt_…"}.
computer_id is the runtime id of one of your computers. The first computer wins: the same computer again answers 200, another computer answers 409. A runtime-signed call for a different computer is 403.
Plan chats in a project
plan_threads has a nullable project_id column (migration 149) so a no-computer chat can belong to an account project, such as a chat-only bot.
POST /api/v1/plan-threadstakes an optionalproject_id. It must be your own project that is not deleted, otherwise 400.GET /api/v1/plan-threads?project_id=<uuid>lists only that project’s threads.- Every thread summary and detail carries
project_id(null when none). - Neither route needs a computer. See Plan chat store.
Deploy note
Migrationcmd/allternit-cloud-api/migrations_pg/149_account_projects.sql is additive. Production runs cloud-api with ALLTERNIT_SKIP_MIGRATIONS=1; deploy-contabo.sh applies the file with psql before the binary swap. The account erase deletes every row (account_projects in account_erase.rs).