{"openapi":"3.1.0","info":{"title":"Dojo API","version":"1","description":"Everything Dojo's pages do, for scripts and agents. Sign in with an API key as `Authorization: Bearer fb_…`. Paying and accepting the terms happen at a link a route answers, for a person to open."},"servers":[{"url":"https://dojo.frogbot.ai"}],"security":[{"apiKey":[]}],"tags":[{"name":"Sign-in"},{"name":"Workspaces"},{"name":"Projects"},{"name":"Apps"},{"name":"Templates"},{"name":"Sharing"},{"name":"Deployments"},{"name":"Environment variables"},{"name":"Domains"},{"name":"Data"},{"name":"Billing"},{"name":"API keys"}],"paths":{"/api/cli/device/code":{"post":{"tags":["Sign-in"],"summary":"Start a device sign-in","description":"RFC 8628. Show the person `verification_uri_complete`, then poll `/api/cli/device/token`. Errors use the RFC's `{ error }` shape.","operationId":"post/api/cli/device/code","x-access":"Anyone","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"device_name":{"type":"string"}},"required":["client_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string"},"verification_uri":{"type":"string"},"verification_uri_complete":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}},"required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"]}}}}}}},"/api/cli/device/token":{"post":{"tags":["Sign-in"],"summary":"Collect the API key a device sign-in made","description":"RFC 8628 polling: `authorization_pending` until the person approves, then the key. Use it as `Authorization: Bearer <key>`.","operationId":"post/api/cli/device/token","x-access":"Anyone with the device code","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string"},"device_code":{"type":"string"},"client_id":{"type":"string"}},"required":["grant_type","device_code","client_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]}},"required":["access_token","token_type"]}}}}}}},"/api/workspaces":{"get":{"tags":["Workspaces"],"summary":"List workspaces","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Workspaces"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"post":{"tags":["Workspaces"],"summary":"Create a workspace","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Workspaces"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}":{"get":{"tags":["Workspaces"],"summary":"Read a workspace","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Workspaces"],"summary":"Update a workspace","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Workspaces"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/members":{"get":{"tags":["Workspaces"],"summary":"List members","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Members"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"post":{"tags":["Workspaces"],"summary":"Create a member","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Members"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Members"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/members/{id}":{"get":{"tags":["Workspaces"],"summary":"Read a member","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The member's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Members"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Workspaces"],"summary":"Update a member","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Members"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The member's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Members"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Workspaces"],"summary":"Delete a member","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The member's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Members"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/members/{member}/role":{"post":{"tags":["Workspaces"],"summary":"Change a workspace member's role","description":"Makes the member a `viewer`, `editor` or `admin`. Nobody is made `owner` this way, and the Owner's own role doesn't change: the Owner hands ownership over with `POST /api/workspaces/:id/owner`.","operationId":"post/api/workspaces/:id/members/:member/role","x-access":"Workspace Owner and Admins","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}},{"name":"member","in":"path","required":true,"description":"The member row's id, from `GET /api/members/workspace/:id`.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["viewer","editor","admin"]}},"required":["role"]},"example":{"role":"editor"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"role":{"type":"string","enum":["viewer","editor","admin"]}},"required":["id","email","role"]}},"required":["member"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/members/{member}":{"delete":{"tags":["Workspaces"],"summary":"Remove a workspace member","description":"Removes the member from the workspace: they lose its apps, and app and project lists only they managed pass to the caller. Their API keys for the workspace are revoked. The Owner is never removed.","operationId":"delete/api/workspaces/:id/members/:member","x-access":"Workspace Owner and Admins","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}},{"name":"member","in":"path","required":true,"description":"The member row's id, from `GET /api/members/workspace/:id`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"}},"required":["removed"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/leave":{"post":{"tags":["Workspaces"],"summary":"Leave a workspace","description":"Removes the caller from the workspace. The Owner can't leave until they hand ownership over with `POST /api/workspaces/:id/owner`, and the only member deletes the workspace instead.","operationId":"post/api/workspaces/:id/leave","x-access":"Workspace members","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean"}},"required":["left"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/owner":{"post":{"tags":["Workspaces"],"summary":"Hand over workspace ownership","description":"Makes the member the workspace's Owner at once, and the Owner an Admin. The new Owner must have signed in. Only the Owner pays for the workspace, changes its plan and deletes it, so hand it over before leaving. No billing details move: the workspace keeps its plan and card.","operationId":"post/api/workspaces/:id/owner","x-access":"The workspace Owner","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","description":"A document id."}},"required":["memberId"]},"example":{"memberId":"6650f1a2b3c4d5e6f7a8b9c0"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","description":"A document id."},"previous":{"type":"string","description":"A document id."}},"required":["owner","previous"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/delete":{"post":{"tags":["Workspaces"],"summary":"Delete a workspace","description":"Deletes the workspace for good, with its projects, members, API keys, saved templates, MCP connections and AI balance, and cancels its Dojo plan. It must hold no apps, Trash included. `name` must be the workspace's name.","operationId":"post/api/workspaces/:id/delete","x-access":"The workspace Owner","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/activity":{"get":{"tags":["Workspaces"],"summary":"List activity","description":"Who deployed, changed or invited what in a workspace in the last 90 days, newest first, 50 to a page, as its Activity tab shows it. `people` and `apps` are the filters' choices; pass a choice's `value` back as `person` or `app`. A workspace without Business answers `403` with a link to its Billing page.","operationId":"get/api/workspaces/:id/activity","x-access":"The workspace's Admins, on Business","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}},{"name":"app","in":"query","required":false,"description":"Only this app's entries: its id.","schema":{"type":"string"}},{"name":"person","in":"query","required":false,"description":"Only this person's entries: a `value` from `people`, such as `u:<user id>`.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"The page, from 1.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string"},"event":{"type":"string"},"text":{"type":"string"}},"required":["id","at","event","text"]}},"page":{"type":"integer"},"totalPages":{"type":"integer"},"people":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"apps":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}}},"required":["workspace","entries","page","totalPages","people","apps"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/members/workspace/{workspace}":{"get":{"tags":["Workspaces"],"summary":"List a workspace's members","description":"Everyone in the workspace, the Owner and Admins first, with the caller's own role and the other workspaces they're in, as the Members page shows it.","operationId":"get/api/members/workspace/:workspace","x-access":"Workspace members","parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]}},"role":{"anyOf":[{"type":"string","enum":["viewer","editor","admin","owner"]},{"type":"null"}]},"canManage":{"type":"boolean"},"canHandOver":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["viewer","editor","admin","owner"]},"invited":{"type":"boolean"},"you":{"type":"boolean"}},"required":["id","email","name","role","invited","you"]}}},"required":["workspace","workspaces","role","canManage","canHandOver","members"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/members/workspace/{workspace}/invite":{"post":{"tags":["Workspaces"],"summary":"Invite people to a workspace","description":"Adds each address at the role given, `viewer` unless one is named, and emails them. Addresses already in the workspace come back in `existing` by name. Nobody is invited as `owner`: the Owner hands ownership over with `POST /api/workspaces/:id/owner`.","operationId":"post/api/members/workspace/:workspace/invite","x-access":"Workspace admins","parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"string","description":"Addresses separated by commas, spaces or new lines."},"role":{"type":"string","enum":["viewer","editor","admin"]}},"required":["emails"]},"example":{"emails":"dana@example.com","role":"editor"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"string"}},"existing":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"string"}}},"required":["created","existing","failed"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects":{"get":{"tags":["Projects"],"summary":"List projects","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Projects"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"post":{"tags":["Projects"],"summary":"Create a project","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Projects"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Projects"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}":{"get":{"tags":["Projects"],"summary":"Read a project","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Projects"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Projects"],"summary":"Update a project","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Projects"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Projects"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Projects"],"summary":"Delete a project","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Projects"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/project-shares":{"get":{"tags":["Projects"],"summary":"List project shares","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/ProjectShares"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/project-shares/{id}":{"get":{"tags":["Projects"],"summary":"Read a project share","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The project share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectShares"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Projects"],"summary":"Update a project share","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectShares"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The project share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/ProjectShares"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Projects"],"summary":"Delete a project share","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The project share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/ProjectShares"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/sharing":{"get":{"tags":["Projects"],"summary":"List a project's people","description":"Who gets the project's apps, and at what level.","operationId":"get/api/projects/:id/sharing","x-access":"Project owners and workspace admins","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["project"]},"name":{"type":"string"},"url":{"type":"string"},"workspaceSharing":{"type":"boolean"},"shares":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"level":{"type":"string","enum":["use","editor","owner"]},"invited":{"type":"boolean"},"guest":{"type":"boolean"},"you":{"type":"boolean"}},"required":["id","email","level","invited","guest","you"]}}},"required":["kind","name","url","workspaceSharing","shares"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/invite":{"post":{"tags":["Projects"],"summary":"Share a project with people","description":"Adds each address to the project's list, which reaches every app in it. Needs Business features on the workspace.","operationId":"post/api/projects/:id/invite","x-access":"Project owners and workspace admins","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"string"},"level":{"type":"string","enum":["use","editor","owner"]}},"required":["emails"]},"example":{"emails":"dana@example.com","level":"editor"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"string"}},"existing":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"string"}}},"required":["created","existing","failed"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/sharing/me":{"delete":{"tags":["Projects"],"summary":"Leave a project","description":"Removes the caller from the project's list.","operationId":"delete/api/projects/:id/sharing/me","x-access":"Anyone on the project's list","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"}},"required":["removed"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/danger":{"get":{"tags":["Projects"],"summary":"Read a project's Danger zone","description":"What the caller may do with the project: move it, leave its list or delete it once it's empty. The default project has none.","operationId":"get/api/projects/:id/danger","x-access":"The project's people and its workspace's Admins","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["app","project"]},"name":{"type":"string"},"canManage":{"type":"boolean"},"canLeave":{"type":"boolean"},"onlyAdmin":{"type":"boolean"},"hasApps":{"type":"boolean"},"workspace":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]}},"handover":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","email","expiresAt"]},{"type":"null"}]}},"required":["kind","name","canManage","canLeave","onlyAdmin","hasApps","workspace","targets","handover"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/move":{"post":{"tags":["Projects"],"summary":"Move a project to another workspace","description":"Moves the project and its apps at once into `workspace`, which the caller must admin, in one transaction. Into a workspace without Business features its apps join that workspace's default project and its people get the same access on each app. Admins from outside that workspace become Editors.","operationId":"post/api/projects/:id/move","x-access":"Project admins who admin the other workspace","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."}},"required":["workspace"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"moved":{"type":"array","items":{"type":"string","description":"A document id."}}},"required":["moved"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/projects/{id}/handover":{"post":{"tags":["Projects"],"summary":"Hand a project over to someone else","description":"Emails `email` a link to accept the project and its apps into a workspace they admin, which then pays for them. One waits per project, for 7 days.","operationId":"post/api/projects/:id/handover","x-access":"Project admins","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"handover":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","email","expiresAt"]},"sent":{"type":"boolean"}},"required":["handover","sent"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps":{"get":{"tags":["Apps"],"summary":"List apps","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Apps"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"post":{"tags":["Apps"],"summary":"Create an app","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Apps"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Apps"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}":{"get":{"tags":["Apps"],"summary":"Read an app","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Apps"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Apps"],"summary":"Update an app","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Apps"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Apps"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Apps"],"summary":"Delete an app","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/Apps"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/cli":{"get":{"tags":["Apps"],"summary":"Read an app","description":"The app's address, place in the hierarchy, status and live deployment, by slug or id, with the caller's level.","operationId":"get/api/apps/:app/cli","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"description":"`1` adds the app's `secret` to an owner's reply; an editor's has none, and an app staff removed answers 403.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"slug":{"type":"string"},"name":{"type":"string"},"workspace":{"type":"string","description":"A document id."},"project":{"anyOf":[{"type":"string","description":"A document id."},{"type":"null"}]},"url":{"type":"string","description":"`https://<slug>.frogbot.app`."},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The custom domain saved on the app; `GET /api/apps/{app}/domain` says whether it is live."},"status":{"type":"string","enum":["removed","paused","live","deploying","failed","not_deployed"]},"deployment":{"anyOf":[{"type":"string","description":"A document id."},{"type":"null"}],"description":"The live deployment."},"started":{"type":"boolean"},"level":{"type":"string","enum":["editor","owner"]},"secret":{"type":"string","description":"The app's `FROGBOT_SECRET`, only for an owner who asks with `?secret=1`, so a pulled copy keeps its connections and sign-ins (platform-28 D3)."}},"required":["id","slug","name","workspace","project","url","domain","status","deployment","started","level"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/logs":{"get":{"tags":["Apps"],"summary":"Read a running app's logs","description":"Oldest first, with stored environment variable values shown as `••••`. Pass `next` back as `after` for newer lines.","operationId":"get/api/apps/:app/logs","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"The `next` of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"message":{"type":"string"}},"required":["at","message"]}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["lines","next"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/usage":{"get":{"tags":["Apps"],"summary":"Read an app's AI spend and its process","description":"Dollars of provider cost this UTC month, by day and by model, the workspace's prepaid AI balance, and the app's process and storage. AI is paused while the balance is $0 or less.","operationId":"get/api/apps/:app/usage","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string"},"spentUSD":{"type":"number"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"requests":{"type":"integer"},"costUSD":{"type":"number"}},"required":["day","requests","costUSD"]}},"models":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"requests":{"type":"integer"},"costUSD":{"type":"number"}},"required":["model","requests","costUSD"]}},"workspace":{"type":"string"},"metered":{"type":"boolean"},"balanceUSD":{"anyOf":[{"type":"number"},{"type":"null"}]},"paused":{"type":"boolean"},"canManageFunds":{"type":"boolean"},"autoRecharge":{"type":"boolean"},"thresholdUSD":{"type":"integer"},"amountUSD":{"type":"integer"},"hasSavedCard":{"type":"boolean"},"process":{"anyOf":[{"type":"object","properties":{"size":{"type":"string"},"state":{"type":"string","enum":["starting","passing","failing","stopped","not-deployed"]},"storage":{"anyOf":[{"type":"object","properties":{"sizeGb":{"type":"number"},"usedPercent":{"type":"number"}},"required":["sizeGb","usedPercent"]},{"type":"null"}]}},"required":["size","state","storage"]},{"type":"null"}]}},"required":["month","spentUSD","days","models","workspace","metered","balanceUSD","paused","canManageFunds","autoRecharge","thresholdUSD","amountUSD","hasSavedCard","process"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/preview":{"get":{"tags":["Apps"],"summary":"Read an app's free preview","description":"The preview's window and the workspace's free minutes left this month, or `null` for an app that isn't a preview.","operationId":"get/api/apps/:app/preview","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["live","ended"]},"startedAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"deleteAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"keep":{"type":"boolean"},"minutesLeft":{"type":"integer"}},"required":["state","startedAt","endsAt","deleteAt","keep","minutesLeft"]},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["preview","url"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/preview/stop":{"post":{"tags":["Apps"],"summary":"Stop an app's free preview","description":"Ends the window now and stops the app; the minutes it used count, and Keep it still works for 7 days. 409 when it already ended or is not a preview.","operationId":"post/api/apps/:app/preview/stop","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["live","ended"]},"startedAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"deleteAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"keep":{"type":"boolean"},"minutesLeft":{"type":"integer"}},"required":["state","startedAt","endsAt","deleteAt","keep","minutesLeft"]},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["preview","url"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/preview/keep":{"post":{"tags":["Apps"],"summary":"Keep a free preview","description":"Makes the preview a paid app with no redeploy. When the workspace already pays for a free app it happens now; otherwise `url` is the page that buys one more app at the workspace's plan (Pro with none), and the preview becomes that app once it's paid.","operationId":"post/api/apps/:app/preview/keep","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["live","ended"]},"startedAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"deleteAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"keep":{"type":"boolean"},"minutesLeft":{"type":"integer"}},"required":["state","startedAt","endsAt","deleteAt","keep","minutesLeft"]},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["preview","url"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/danger":{"get":{"tags":["Apps"],"summary":"Read an app's Danger zone","description":"What the caller may do with the app: move it, leave it or delete it, the workspaces it can move into at once, and any handover waiting.","operationId":"get/api/apps/:id/danger","x-access":"Anyone with access to the app","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["app","project"]},"name":{"type":"string"},"canManage":{"type":"boolean"},"canLeave":{"type":"boolean"},"onlyAdmin":{"type":"boolean"},"hasApps":{"type":"boolean"},"workspace":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]}},"handover":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","email","expiresAt"]},{"type":"null"}]}},"required":["kind","name","canManage","canLeave","onlyAdmin","hasApps","workspace","targets","handover"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/trash":{"post":{"tags":["Apps"],"summary":"Move an app to Trash","description":"Stops the app and keeps it in Trash for 30 days, with its address, data and files; then it is deleted for good. It holds no paid app while there.","operationId":"post/api/apps/:id/trash","x-access":"App admins","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deletedAt":{"type":"string","format":"date-time"},"purgeAt":{"type":"string","format":"date-time"}},"required":["deletedAt","purgeAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/restore":{"post":{"tags":["Apps"],"summary":"Restore an app from Trash","description":"Takes the app out of Trash. One that had gone live needs a paid app free in its workspace, as a first deploy does; otherwise it stays in Trash and the 402 carries the page that pays for one in `data.url`.","operationId":"post/api/apps/:id/restore","x-access":"App admins","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"type":"boolean"}},"required":["restored"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"402":{"description":"`payment_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/delete-permanently":{"post":{"tags":["Apps"],"summary":"Delete an app for good","description":"Deletes the app, in Trash or not, with its data, files and address, which no app can use again. `name` must be the app's name.","operationId":"post/api/apps/:id/delete-permanently","x-access":"App admins","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/move":{"post":{"tags":["Apps"],"summary":"Move an app to another workspace","description":"Moves the app at once into `workspace`, which the caller must admin. It keeps running at its address, everyone keeps their access (Admins from outside that workspace as Editors), and that workspace pays for it from then on. Refused during a build, for an app in Trash or taken down, and when the workspace has no paid app free, with the page that pays for one in `data.url`.","operationId":"post/api/apps/:id/move","x-access":"App admins who admin the other workspace","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."}},"required":["workspace"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"moved":{"type":"array","items":{"type":"string","description":"A document id."}}},"required":["moved"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/handover":{"post":{"tags":["Apps"],"summary":"Hand an app over to someone else","description":"Emails `email` a link to accept the app into a workspace they admin, which then pays for it. It lists who keeps access. One waits per app, for 7 days, until it's accepted or cancelled.","operationId":"post/api/apps/:id/handover","x-access":"App admins","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"handover":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","email","expiresAt"]},"sent":{"type":"boolean"}},"required":["handover","sent"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/stop":{"post":{"tags":["Apps"],"summary":"Stop an app","description":"Visitors get the paused page until the app is started again, and scheduled wakes skip it. It keeps its paid app, address, data and files, and a deploy goes live without starting it. Stopping a stopped app changes nothing.","operationId":"post/api/apps/:app/stop","x-access":"App admins","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"stopped":{"type":"boolean"},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["stopped","stoppedAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/start":{"post":{"tags":["Apps"],"summary":"Start a stopped app","description":"The app answers visitors again and its scheduled wakes resume. Starting an app that is not stopped changes nothing. An app in Trash is refused (409); restore it first.","operationId":"post/api/apps/:app/start","x-access":"App admins","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"stopped":{"type":"boolean"},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["stopped","stoppedAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/restart":{"post":{"tags":["Apps"],"summary":"Restart an app","description":"Restarts the running app on its current version and environment variables. Refused for an app that is stopped, has never gone live, or is a free preview past its window.","operationId":"post/api/apps/:app/restart","x-access":"App admins","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"restarted":{"type":"boolean"}},"required":["restarted"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/handovers/{id}/details":{"get":{"tags":["Apps"],"summary":"Read a handover","description":"What a handover moves, its state, the workspaces the recipient can accept it into, and who keeps access.","operationId":"get/api/handovers/:id/details","x-access":"Its recipient, its sender, and the new workspace’s Admins","parameters":[{"name":"id","in":"path","required":true,"description":"The handover's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"kind":{"type":"string","enum":["app","project"]},"name":{"type":"string"},"sender":{"type":"string"},"fromWorkspace":{"type":"string"},"email":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["pending","accepted","cancelled","expired"]},"recipient":{"type":"boolean"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]}},"toWorkspace":{"anyOf":[{"type":"string"},{"type":"null"}]},"people":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"level":{"type":"string","enum":["use","editor","owner"]}},"required":["email","level"]}},"canRemove":{"type":"boolean"}},"required":["id","kind","name","sender","fromWorkspace","email","expiresAt","status","recipient","workspaces","toWorkspace","people","canRemove"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/handovers/{id}/accept":{"post":{"tags":["Apps"],"summary":"Accept a handover","description":"Moves the app or project into `workspace`, which the recipient must admin, and accepts its bill there. Everyone keeps their access, Admins from outside that workspace as Editors, and the recipient becomes an Admin. Refused once cancelled or after 7 days, and as a move is.","operationId":"post/api/handovers/:id/accept","x-access":"Its recipient","parameters":[{"name":"id","in":"path","required":true,"description":"The handover's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."}},"required":["workspace"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"moved":{"type":"array","items":{"type":"string","description":"A document id."}}},"required":["moved"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/handovers/{id}/cancel":{"post":{"tags":["Apps"],"summary":"Cancel or decline a handover","description":"Cancels a handover still waiting: its sender and the app’s or project’s Admins cancel it, its recipient declines it.","operationId":"post/api/handovers/:id/cancel","x-access":"Its sender, its recipient, and the Admins of what it moves","parameters":[{"name":"id","in":"path","required":true,"description":"The handover's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"}},"required":["cancelled"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/handovers/{id}/remove-access":{"post":{"tags":["Apps"],"summary":"Remove everyone outside the new workspace","description":"After a handover, removes everyone outside the new workspace from the moved apps’ and project’s lists, in one call (D2).","operationId":"post/api/handovers/:id/remove-access","x-access":"Admins of the workspace it moved into","parameters":[{"name":"id","in":"path","required":true,"description":"The handover's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"integer"}},"required":["removed"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/trash":{"get":{"tags":["Apps"],"summary":"List apps in Trash","description":"The apps in Trash the caller is an Admin of, latest first, each with the time it will be deleted for good.","operationId":"get/api/trash","x-access":"Signed-in people","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"slug":{"type":"string"},"workspace":{"type":"string"},"deletedAt":{"type":"string","format":"date-time"},"purgeAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","workspace","deletedAt","purgeAt"]}}},"required":["apps"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/templates":{"get":{"tags":["Templates"],"summary":"List templates","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Templates"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/templates/{id}":{"get":{"tags":["Templates"],"summary":"Read a template","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The template's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Templates"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/template":{"post":{"tags":["Templates"],"summary":"Save an app as a template","description":"Copies the live version's code, never its keys or data, into a template every member of the workspace can use. Saving again replaces it. Everyone in this workspace gets this app's whole code, including values written into it. Keys and data are not included.","operationId":"post/api/apps/:app/template","x-access":"App editors and owners, on Business","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["name","summary"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"replaced":{"type":"boolean"}},"required":["id","replaced"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"get":{"tags":["Templates"],"summary":"Read an app's template","description":"Whether the app can be saved as a template now, and the one saved from it before. Without Business, `upgrade` holds the billing link for the Owner or `askAdmin`.","operationId":"get/api/apps/:app/template","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"live":{"type":"boolean"},"business":{"type":"boolean"},"upgrade":{"type":"object"},"template":{"anyOf":[{"type":"object"},{"type":"null"}],"description":"The template saved from this app."}},"required":["live","business","upgrade","template"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/templates/{id}/offer":{"get":{"tags":["Templates"],"summary":"Price a template's new app","description":"`paid` takes a paid app the workspace has free, at `price` a month; `preview` starts as a free 6-hour preview; `pay` needs one more paid app first, at `upgrade`; `included` is not billed.","operationId":"get/api/templates/:id/offer","x-access":"Members of the workspace","parameters":[{"name":"id","in":"path","required":true,"description":"The template's id.","schema":{"type":"string"}},{"name":"workspace","in":"query","required":true,"description":"The workspace to add the app to.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["included","paid","preview","pay"]},"price":{"anyOf":[{"type":"integer"},{"type":"null"}]},"workspaceName":{"type":"string"},"upgrade":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The page that pays for one more app, on `pay`."}},"required":["kind","price","workspaceName"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/templates/{id}/use":{"post":{"tags":["Templates"],"summary":"Use a template","description":"Creates the app with you as its Admin and queues its first build. With no paid app free and no free preview left it answers 402 with the page that pays for one more in `data.url`; a taken name is 409 with `data.code: name_taken`.","operationId":"post/api/templates/:id/use","x-access":"Members of the workspace","parameters":[{"name":"id","in":"path","required":true,"description":"The template's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."},"name":{"type":"string"},"slug":{"type":"string"}},"required":["workspace","name","slug"]},"example":{"workspace":"6720f1…","name":"Acme helpdesk","slug":"acme-helpdesk"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"deploymentId":{"type":"string","description":"A document id."}},"required":["app","deploymentId"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"402":{"description":"`payment_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/templates/{id}/screenshot":{"put":{"tags":["Templates"],"summary":"Replace a template's image","description":"The body is the image itself: PNG, JPEG or WebP, up to 2 MB.","operationId":"put/api/templates/:id/screenshot","x-access":"Whoever may edit the template","parameters":[{"name":"id","in":"path","required":true,"description":"The template's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","contentEncoding":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"screenshot":{"type":"string"}},"required":["screenshot"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"413":{"description":"`too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"get":{"tags":["Templates"],"summary":"Get a template's image","operationId":"get/api/templates/:id/screenshot","x-access":"Whoever may see the template","parameters":[{"name":"id","in":"path","required":true,"description":"The template's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The image as uploaded.","content":{"image/png":{"schema":{}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/app-shares":{"get":{"tags":["Sharing"],"summary":"List app shares","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/AppShares"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/app-shares/{id}":{"get":{"tags":["Sharing"],"summary":"Read an app share","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The app share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppShares"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["Sharing"],"summary":"Update an app share","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppShares"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The app share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/AppShares"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Sharing"],"summary":"Delete an app share","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The app share's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/AppShares"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/sharing":{"get":{"tags":["Sharing"],"summary":"List an app's people","description":"Who has the app and at what level, as the share dialog shows it.","operationId":"get/api/apps/:id/sharing","x-access":"App owners","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string","enum":["private","workspace"]},"workspaceSharing":{"type":"boolean"},"workspaceAdmins":{"type":"array","items":{"type":"string"},"description":"The workspace's Admins' addresses: Admin of every app in it, whatever `shares` says."},"shares":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"email":{"type":"string"},"level":{"type":"string","enum":["use","editor","owner"]},"invited":{"type":"boolean"},"guest":{"type":"boolean","description":"Outside the app's workspace: at most an Editor, and badged Guest."},"you":{"type":"boolean"}},"required":["id","email","level","invited","guest","you"]}}},"required":["name","slug","url","visibility","workspaceSharing","workspaceAdmins","shares"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/invite":{"post":{"tags":["Sharing"],"summary":"Share an app with people","description":"Adds each address at the level given and emails them. Addresses already on the app are left as they are.","operationId":"post/api/apps/:id/invite","x-access":"App owners","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"string","description":"Addresses separated by commas, spaces or new lines."},"level":{"type":"string","enum":["use","editor","owner"]}},"required":["emails"]},"example":{"emails":"dana@example.com","level":"use"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"string"}},"existing":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"string"}}},"required":["created","existing","failed"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/sharing/me":{"delete":{"tags":["Sharing"],"summary":"Leave an app","description":"Removes the caller's own access. The last owner can't leave.","operationId":"delete/api/apps/:id/sharing/me","x-access":"Anyone on the app","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"}},"required":["removed"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{id}/request-access":{"post":{"tags":["Sharing"],"summary":"Ask for access to an app","description":"Emails the app's owners a link that opens the share dialog with the caller filled in. Once a day per app.","operationId":"post/api/apps/:id/request-access","x-access":"Signed-in people without access","parameters":[{"name":"id","in":"path","required":true,"description":"The app's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":500}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"integer"}},"required":["sent"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/shared":{"get":{"tags":["Sharing"],"summary":"List apps shared with you","description":"Apps the caller has access to in workspaces they aren't a member of, by name, with the caller's level.","operationId":"get/api/shared","x-access":"Signed-in people","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"url":{"type":"string"},"workspace":{"type":"string"},"level":{"type":"string","enum":["use","editor","owner"]}},"required":["id","name","url","workspace","level"]}}},"required":["apps"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments":{"get":{"tags":["Deployments"],"summary":"List deployments","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Deployments"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments/{id}":{"get":{"tags":["Deployments"],"summary":"Read a deployment","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The deployment's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployments"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/deployments":{"post":{"tags":["Deployments"],"summary":"Deploy a new version","description":"Uploads the source archive `frogbot deploy` makes, with sealed environment variables, and queues its build. Follow the build at `GET /api/deployments/{id}/logs`. A first deploy past what the workspace pays for answers 402 with the link a person pays at in `data.url`. A source that can never build (no lockfile, Bun, no FrogBot, not a .tar.gz) answers 422 `invalid_source` with what to fix before deploying again.","operationId":"post/api/apps/:app/deployments","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"source":{"type":"string","contentEncoding":"binary","description":"The app as a .tar.gz."},"keys":{"type":"string","description":"Environment variables sealed to `GET /api/cli/sealing-key`, as JSON."},"data":{"type":"string","description":"`true` on a first deploy that brings its database; `replace`, from an owner, swaps the live data for the one uploaded with `replace: true`."}},"required":["source"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deploymentId":{"type":"string","description":"A document id."},"keys":{"type":"object"}},"required":["deploymentId"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"402":{"description":"`payment_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"413":{"description":"`too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"`invalid_source`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"get":{"tags":["Deployments"],"summary":"List an app's deployments","description":"Newest first, 20 a page, with each version's status, who started it, its build and start times, and which one is live. `inFlight` is true while any version is queued, building or starting.","operationId":"get/api/apps/:app/deployments","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"The page, from 1.","schema":{"type":"integer"}},{"name":"deployment","in":"query","required":false,"description":"Without `page`, return the page that lists this deployment.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"status":{"type":"string","enum":["queued","building","starting","live","previous","failed","cancelled","replaced"]},"current":{"type":"boolean","description":"The version the app runs now."},"startedBy":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The starter's name, else email."},"createdAt":{"type":"string","format":"date-time"},"buildMs":{"anyOf":[{"type":"integer"},{"type":"null"}]},"startMs":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"rollbackOf":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","createdAt"]},{"type":"null"}]},"canRollBack":{"type":"boolean"}},"required":["id","status","current","startedBy","createdAt","buildMs","startMs","error","rollbackOf","canRollBack"]}},"page":{"type":"integer"},"totalPages":{"type":"integer"},"inFlight":{"type":"boolean"}},"required":["rows","page","totalPages","inFlight"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/deployments/source-uploads":{"post":{"tags":["Deployments"],"summary":"Start uploading an app's source","description":"Signs an upload of the app as a .tar.gz, at most 100 MB, straight into storage: one URL to PUT the whole archive to, or for one over 64 MB, URLs to PUT each `partSize` slice to, in order, keeping each answer's ETag. The URLs last 15 minutes. Then deploy it with `POST /api/apps/{app}/deployments/from-upload`. Environment variables are set with the environment-variable routes, not here.","operationId":"post/api/apps/:app/deployments/source-uploads","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"size":{"type":"integer"}},"required":["size"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"put":{"type":"string"},"uploadId":{"type":"string"},"partSize":{"type":"integer"},"parts":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string"}},"required":["key","expiresAt"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"402":{"description":"`payment_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"413":{"description":"`too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/deployments/from-upload":{"post":{"tags":["Deployments"],"summary":"Deploy an uploaded source","description":"Queues the build of an archive uploaded with `POST /api/apps/{app}/deployments/source-uploads`. For a multipart upload, send its `uploadId` and each part's number and ETag to finish it first. The archive is checked as `frogbot share` checks one: a source that can never build (no lockfile, Bun, no FrogBot, not a .tar.gz) answers 422 `invalid_source` and is deleted. Read the build with `GET /api/deployments/{id}/log-lines`.","operationId":"post/api/apps/:app/deployments/from-upload","x-access":"App editors and owners; owners only with `data: replace`","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"uploadId":{"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"partNumber":{"type":"integer"},"etag":{"type":"string"}},"required":["partNumber","etag"]}},"data":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["replace"]}],"description":"`true` on a first deploy that brings its database (uploaded with the data upload routes); `replace`, from an owner, swaps the live data for the one uploaded with `replace: true`."}},"required":["key"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deploymentId":{"type":"string","description":"A document id."}},"required":["deploymentId"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"402":{"description":"`payment_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"413":{"description":"`too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"`invalid_source`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/source":{"get":{"tags":["Deployments"],"summary":"Download the live version's source","description":"The archive `frogbot pull` unpacks.","operationId":"get/api/apps/:app/source","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The source as a .tar.gz.","content":{"application/gzip":{"schema":{}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/source-link":{"get":{"tags":["Deployments"],"summary":"Get a link to download an app's source","description":"A link to the live version's source as a .tar.gz, the archive `frogbot pull` unpacks. It works for 10 minutes without signing in.","operationId":"get/api/apps/:app/source-link","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","description":"When the link stops working."}},"required":["url","expiresAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/deployments/{id}/rollback":{"post":{"tags":["Deployments"],"summary":"Roll back to an earlier version","description":"Starts a new deployment with an earlier live version's image and source, without a build. The app keeps today's data and environment variables; if the version can't start, the current one keeps running. Follow it with `GET /api/apps/{app}/deployments`. 409 when the version never went live, is already live, or another version is starting.","operationId":"post/api/apps/:app/deployments/:id/rollback","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The deployment to roll back to.","schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deploymentId":{"type":"string","description":"A document id."}},"required":["deploymentId"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/repo":{"get":{"tags":["Deployments"],"summary":"Read an app's repo link","description":"The repo and branch whose pushes deploy the app, or `null`. `needs-reconnect` means Dojo lost access and pushes deploy nothing until an Admin connects it again.","operationId":"get/api/apps/:app/repo","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string"},"instanceURL":{"type":"string"},"repoID":{"type":"string"},"repoName":{"type":"string"},"branch":{"type":"string"},"folder":{"type":"string"},"status":{"type":"string","enum":["active","needs-reconnect"]}},"required":["provider","instanceURL","repoID","repoName","branch","folder","status"]},{"type":"null"}]}},"required":["repo"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"put":{"tags":["Deployments"],"summary":"Connect a repo","description":"Links the app to a repo, branch and folder and adds Dojo's webhook to the repo, so each push to the branch deploys. Connecting again replaces the link and reconnects one that needs it. The branch defaults to the repo's default branch, the folder to the root.","operationId":"put/api/apps/:app/repo","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"instanceURL":{"type":"string"},"repoID":{"type":"string"},"branch":{"type":"string"},"folder":{"type":"string"},"credential":{"type":"string","description":"A GitLab access token, stored encrypted and never returned; for GitHub, the signed repo list Connect GitHub hands back."},"grant":{"type":"string","description":"The grant a provider's sign-in returned, in place of `credential`; spent on connect."}},"required":["provider","repoID"]},"example":{"provider":"github","repoID":"123","folder":"apps/web"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string"},"instanceURL":{"type":"string"},"repoID":{"type":"string"},"repoName":{"type":"string"},"branch":{"type":"string"},"folder":{"type":"string"},"status":{"type":"string","enum":["active","needs-reconnect"]}},"required":["provider","instanceURL","repoID","repoName","branch","folder","status"]},{"type":"null"}]}},"required":["repo"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"delete":{"tags":["Deployments"],"summary":"Disconnect a repo","description":"Removes the link and Dojo's webhook from the repo. Pushes stop deploying; deployments already made stay.","operationId":"delete/api/apps/:app/repo","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"null"}},"required":["repo"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/repo/repos":{"get":{"tags":["Deployments"],"summary":"List the repos a sign-in can connect","description":"After an Admin signs in with a Git provider, the repos they can connect: on GitLab, the projects where they're a Maintainer or Owner. Pass the `grant` the sign-in returned; it lasts 10 minutes.","operationId":"get/api/apps/:app/repo/repos","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"provider","in":"query","required":true,"description":"The Git provider, such as `gitlab`.","schema":{"type":"string"}},{"name":"grant","in":"query","required":true,"description":"The grant the sign-in returned to the app page.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"defaultBranch":{"type":"string"}},"required":["id","name","defaultBranch"]}}},"required":["repos"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/repo/github/link":{"get":{"tags":["Deployments"],"summary":"Get a link to connect GitHub","description":"A link for a person to open: the app's Deployments tab, where they sign in to GitHub and pick the repo. Agents can't connect GitHub themselves, because Dojo checks with the person's own GitHub sign-in that they can see the installation.","operationId":"get/api/apps/:app/repo/github/link","x-access":"The app's Admins","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments/failed":{"get":{"tags":["Deployments"],"summary":"List failed deploys","description":"Newest first, at most 20, across every app the caller may deploy: builds that failed and versions that built but didn't go live.","operationId":"get/api/deployments/failed","x-access":"App editors and owners","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"app":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"kind":{"type":"string","enum":["build","runtime"]},"startedBy":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The starter's name; their email for the app's owners."},"at":{"type":"string","format":"date-time"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The error's first line."}},"required":["id","app","kind","startedBy","at","message"]}}},"required":["docs"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments/{id}/logs":{"get":{"tags":["Deployments"],"summary":"Follow a deployment's build log","description":"Server-sent events, one per line; send `Last-Event-ID` to carry on after a dropped connection.","operationId":"get/api/deployments/:id/logs","x-access":"App editors and owners","parameters":[{"name":"id","in":"path","required":true,"description":"The deployment's id.","schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"The last line seen.","schema":{"type":"string"}}],"responses":{"200":{"description":"Lines, then the result.","content":{"text/event-stream":{"schema":{}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments/{id}/log-lines":{"get":{"tags":["Deployments"],"summary":"Read a deployment's build log","description":"The build log so far, a page at a time, with the status. Call again with `after` set to the `next` it answered for newer lines; `more` is true while lines are waiting or the deployment is still building or starting. A failed build carries its `error`, and a live one its `url`.","operationId":"get/api/deployments/:id/log-lines","x-access":"App editors and owners","parameters":[{"name":"id","in":"path","required":true,"description":"The deployment's id.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"The last line number already read; 0 or none from the start.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer"},"line":{"type":"string"}},"required":["seq","line"]}},"status":{"type":"string"},"next":{"type":"integer"},"more":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"}},"required":["lines","status","next","more"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/deployments/{id}/cancel":{"post":{"tags":["Deployments"],"summary":"Cancel a deployment","description":"Stops a deployment that is queued or building: it ends as `cancelled`, never goes live, sends no email and leaves the app as it was. A deployment already built, failed or cancelled is refused.","operationId":"post/api/deployments/:id/cancel","x-access":"App admins","parameters":[{"name":"id","in":"path","required":true,"description":"The deployment's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["cancelled"]},"finishedAt":{"type":"string","format":"date-time"}},"required":["status","finishedAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/cli/sealing-key":{"get":{"tags":["Deployments"],"summary":"Get the key environment variables are sealed to","description":"An X25519 public key; `frogbot deploy` seals values to it so they travel encrypted.","operationId":"get/api/cli/sealing-key","x-access":"Signed-in people","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"keyId":{"type":"string"},"publicKey":{"type":"string"}},"required":["keyId","publicKey"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/keys":{"get":{"tags":["Environment variables"],"summary":"List an app's environment variables","description":"Names with masked values, the salt `frogbot deploy` fingerprints values with, and the latest version's failed start, if any.","operationId":"get/api/apps/:app/keys","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"salt":{"type":"string"},"keys":{"type":"array","items":{"type":"object"}},"failedBoot":{"anyOf":[{"type":"object","properties":{"deployment":{"type":"string","description":"A document id."},"error":{"type":"string"},"tail":{"type":"array","items":{"type":"string"}}},"required":["deployment","error","tail"]},{"type":"null"}]}},"required":["salt","keys","failedBoot"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"put":{"tags":["Environment variables"],"summary":"Set or remove an app's environment variables","description":"One restart for the whole change. `null` removes a variable. When the latest version failed to start, it starts again with the new values.","operationId":"put/api/apps/:app/keys","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"required":["values"]},"example":{"values":{"STRIPE_KEY":"sk_live_…","OLD_KEY":null}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"string"}},"retrying":{"type":"boolean"}},"required":["changed","retrying"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/domain":{"get":{"tags":["Domains"],"summary":"Check an app's custom domain","description":"The DNS record to add, and whether the domain is `waiting` for it, `pending` a certificate or `live`.","operationId":"get/api/apps/:app/domain","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"record":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","description":"The CNAME target."}},"required":["name","target"]},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["waiting","pending","live","offline"]},{"type":"null"}]}},"required":["domain","record","status"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"put":{"tags":["Domains"],"summary":"Set or remove an app's custom domain","operationId":"put/api/apps/:app/domain","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["domain"]},"example":{"domain":"deals.example.com"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"record":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","description":"The CNAME target."}},"required":["name","target"]},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["waiting","pending","live","offline"]},{"type":"null"}]}},"required":["domain","record","status"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/data-uploads":{"post":{"tags":["Data"],"summary":"Start uploading an app's data","description":"Signs uploads straight into the app's storage: one URL for a small file, parts for a large one. Files already there at the same size come back `done`. Once the app has started, only its owners may bring data, with `replace: true`.","operationId":"post/api/apps/:app/data-uploads","x-access":"App editors and owners; owners only with `replace`","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objects":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"size":{"type":"integer"}},"required":["key","size"]}},"replace":{"type":"boolean"}},"required":["objects"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"objects":{"type":"array","items":{"type":"object"}}},"required":["objects"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/data-uploads/complete":{"post":{"tags":["Data"],"summary":"Finish an app's large uploads","operationId":"post/api/apps/:app/data-uploads/complete","x-access":"App editors and owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"uploads":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"uploadId":{"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"partNumber":{"type":"integer"},"etag":{"type":"string"}},"required":["partNumber","etag"]}}},"required":["key","uploadId","parts"]}},"replace":{"type":"boolean"}},"required":["uploads"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"completed":{"type":"integer"}},"required":["completed"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/data":{"get":{"tags":["Data"],"summary":"Download an app's data","description":"A zip of the live database, cleaned of jobs, locks and sessions, as `frogbot.db`, and every uploaded file under `<collection slug>/`. `frogbot pull --data` unpacks it.","operationId":"get/api/apps/:app/data","x-access":"App owners, or anyone with a link from `GET /api/apps/{app}/data-link`","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}},{"name":"token","in":"query","required":false,"description":"The token in a data link, in place of a sign-in. An expired or tampered one, or one for another app, answers 401.","schema":{"type":"string"}}],"responses":{"200":{"description":"The data as a .zip.","content":{"application/zip":{"schema":{}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"502":{"description":"`upstream_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"507":{"description":"`insufficient_storage`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/apps/{app}/data-link":{"get":{"tags":["Data"],"summary":"Get a link to download an app's data","description":"A link to the app's data as a zip, the same as `GET /api/apps/{app}/data`. It works for 10 minutes without signing in, for this app only.","operationId":"get/api/apps/:app/data-link","x-access":"App owners","parameters":[{"name":"app","in":"path","required":true,"description":"The app's slug, such as `deals`, or its id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","description":"When the link stops working."}},"required":["url","expiresAt"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/billing":{"get":{"tags":["Billing"],"summary":"Read a workspace's plan","description":"The plan, whether it is paid up, and how many apps are live against how many it pays for, as Dojo last stored them.","operationId":"get/api/workspaces/:id/billing","x-access":"Workspace admins","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["none","pro","business","platform"]},"state":{"type":"string","enum":["none","active","past_due","cancelling","stopped"]},"liveApps":{"type":"integer"},"paidApps":{"type":"integer"},"periodEnd":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["plan","state","liveApps","paidApps","periodEnd"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/billing/checkout":{"post":{"tags":["Billing"],"summary":"Get the link that pays for apps","description":"With a JSON body, answers `{ url }` for a person to open: Stripe Checkout for a workspace with no plan, or a page confirming the new quantity for one that pays. Paying and accepting the terms happen there.","operationId":"post/api/billing/checkout","x-access":"Workspace admins","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."},"apps":{"type":"integer"},"plan":{"type":"string","enum":["pro","business"]}},"required":["workspace"]},"example":{"workspace":"6720f1…","apps":2,"plan":"pro"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/billing/portal":{"post":{"tags":["Billing"],"summary":"Get the link to manage billing","description":"Stripe's portal for cards, invoices and cancelling, for a person to open.","operationId":"post/api/billing/portal","x-access":"Workspace admins","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."}},"required":["workspace"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/billing/ai-checkout":{"post":{"tags":["Billing"],"summary":"Get the link that adds AI funds","description":"Stripe Checkout for 10–1000 whole dollars of AI funds, with a processing fee of 4.6% + $0.31 on top. The amount, never the fee, is added to the workspace's AI balance once Stripe says it is paid. `app` picks which app's Usage tab Stripe returns to.","operationId":"post/api/billing/ai-checkout","x-access":"Workspace admins and Dojo staff","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."},"amount":{"type":"integer"},"app":{"type":"string","description":"A document id."}},"required":["workspace","amount"]},"example":{"workspace":"6720f1…","amount":20}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/billing/ai-auto-recharge":{"post":{"tags":["Billing"],"summary":"Turn AI auto-recharge on or off","description":"When on, Dojo charges the card the last top-up saved `amountUSD` plus the processing fee of 4.6% + $0.31 whenever the AI balance drops under `thresholdUSD` ($20 under $5 until set). Omitted numbers keep their values. Whole dollars. Add $10 to $1,000 each time; the threshold is at least $1 and below the amount, so one recharge always lifts the balance over it. A declined charge turns it off and emails the workspace's admins. Saving while the balance is under the threshold charges at once; if Stripe can't be reached, the answer is 503 and nothing changes. Only a person signed in to Dojo in the browser can change it: an API key, the CLI or an MCP connection gets 403 with a link to the Usage tab, and reads the setting with `GET /api/billing/ai`.","operationId":"post/api/billing/ai-auto-recharge","x-access":"The workspace Owner and Dojo staff, in the browser only","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"string","description":"A document id."},"on":{"type":"boolean"},"thresholdUSD":{"type":"integer"},"amountUSD":{"type":"integer"},"app":{"type":"string","description":"A document id."}},"required":["workspace","on"]},"example":{"workspace":"6720f1…","on":true,"thresholdUSD":10,"amountUSD":50}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"autoRecharge":{"type":"boolean"},"thresholdUSD":{"type":"integer"},"amountUSD":{"type":"integer"},"feeUSD":{"type":"number"},"totalUSD":{"type":"number"},"balanceUSD":{"type":"number"}},"required":["autoRecharge","thresholdUSD","amountUSD","feeUSD","totalUSD","balanceUSD"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/billing/ai":{"get":{"tags":["Billing"],"summary":"Read the workspace's AI funds and auto-recharge","description":"The prepaid AI balance, whether auto-recharge is on, and its numbers: when the balance drops under `thresholdUSD`, Dojo charges the saved card `amountUSD` plus a processing fee of 4.6% + $0.31 (`feeUSD`), `totalUSD` in all, and adds `amountUSD` to the balance. Whole dollars. Add $10 to $1,000 each time; the threshold is at least $1 and below the amount, so one recharge always lifts the balance over it. Only a person in Dojo's browser app changes these; keys and MCP read them.","operationId":"get/api/billing/ai","x-access":"Members of the workspace and Dojo staff","parameters":[{"name":"workspace","in":"query","required":true,"description":"The workspace to read.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"autoRecharge":{"type":"boolean"},"thresholdUSD":{"type":"integer"},"amountUSD":{"type":"integer"},"feeUSD":{"type":"number"},"totalUSD":{"type":"number"},"balanceUSD":{"type":"number"}},"required":["autoRecharge","thresholdUSD","amountUSD","feeUSD","totalUSD","balanceUSD"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"`conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys","x-access":"Whoever its access rules allow","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"where","in":"query","description":"Payload's query syntax, such as `where[name][equals]=Deals`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDocs","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeys"}}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/api-keys/{id}":{"get":{"tags":["API keys"],"summary":"Read an API key","x-access":"Whoever its access rules allow","parameters":[{"name":"id","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeys"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}},"patch":{"tags":["API keys"],"summary":"Update an API key","x-access":"Whoever its access rules allow","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeys"}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"$ref":"#/components/schemas/ApiKeys"},"message":{"type":"string"}}}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/api-keys":{"get":{"tags":["API keys"],"summary":"List a workspace's API keys","description":"Live keys made for this workspace, newest first, never their tokens. Members get their own; workspace Admins get everyone’s, with who made each. `made` counts the live keys a revoke would also take.","operationId":"get/api/workspaces/:id/api-keys","x-access":"Workspace members","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"admin":{"type":"boolean"},"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"prefix":{"type":"string"},"madeWith":{"anyOf":[{"type":"string"},{"type":"null"}]},"madeBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"mine":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"made":{"type":"integer"}},"required":["id","name","prefix","madeWith","madeBy","mine","createdAt","expiresAt","lastUsedAt","made"]}}},"required":["workspace","admin","keys"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/workspaces/{id}/api-keys/{key}/revoke":{"post":{"tags":["API keys"],"summary":"Revoke a workspace's API key","description":"The key stops working at once, and so do the keys it made unless the body is `{ \"cascade\": false }`. Its maker and the workspace’s Admins may revoke it.","operationId":"post/api/workspaces/:id/api-keys/:key/revoke","x-access":"The key's maker and workspace Admins","parameters":[{"name":"id","in":"path","required":true,"description":"The workspace's id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cascade":{"type":"boolean"}},"required":[]},"example":{"cascade":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"revokedAt":{"type":"string","format":"date-time"}},"required":["id","revokedAt"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/mcp-connections/{id}/disconnect":{"post":{"tags":["API keys"],"summary":"Disconnect an agent","description":"Ends an MCP connection: its tokens stop working at once. The API keys it made are revoked too unless the body is `{ \"cascade\": false }`. Find connections in `GET /api/api-keys/devices`. A request made with a workspace key or an MCP connection can’t disconnect one.","operationId":"post/api/mcp-connections/:id/disconnect","x-access":"The person who connected it","parameters":[{"name":"id","in":"path","required":true,"description":"The connection's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cascade":{"type":"boolean"}},"required":[]},"example":{"cascade":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"revokedAt":{"type":"string","format":"date-time"},"keysRevoked":{"type":"integer"}},"required":["id","revokedAt","keysRevoked"]}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}},"/api/api-keys/mint":{"post":{"tags":["API keys"],"summary":"Make an API key","description":"Answers the key's token once; store it. Needs a browser sign-in or a key with `canMint`; a key made by a key records it as `mintedBy`, expires no later than it, and stays in its workspace. `expiresAt` is a future day such as `2027-02-07` or a date and time with a zone; leave it out and the key works until it's revoked. `data.canMint` lets the new key make keys too, and only a sign-in that may make keys can give it. `data.workspace` keeps the new key to one workspace you're in; a workspace key or an agent can only name its own. Errors use the plugin's own `{ error }` shape: `401`, `403` (\"session required\") and `404`.","operationId":"post/api/api-keys/mint","x-access":"Signed-in people, from a browser session or a key with canMint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"expiresAt":{"type":"string"},"data":{"type":"object","properties":{"canMint":{"type":"boolean","description":"Whether the new key can make keys too."},"workspace":{"type":"string","description":"The one workspace the new key works in: the workspace's id."}},"required":[]}},"required":["name"]},"example":{"name":"GitHub Actions deploy","expiresAt":"2027-02-07","data":{"workspace":"6650f1c2a4b5c6d7e8f90123"}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"prefix":{"type":"string"},"token":{"type":"string"}},"required":["id","prefix","token"]}}}}}}},"/api/api-keys/{id}/revoke":{"post":{"tags":["API keys"],"summary":"Revoke an API key","description":"The key stops working at once, and so do the keys it made unless the body is `{ \"cascade\": false }`. `frogbot logout` revokes its own key this way and keeps the keys it made. Errors use the plugin's own `{ error }` shape: `401`, `403` (\"session required\") and `404`.","operationId":"post/api/api-keys/:id/revoke","x-access":"The key's owner","parameters":[{"name":"id","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cascade":{"type":"boolean"}},"required":[]},"example":{"cascade":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"revokedAt":{"type":"string"}},"required":["id"]}}}}}}},"/api/api-keys/{id}/minted-count":{"get":{"tags":["API keys"],"summary":"Count the keys an API key made","description":"How many keys a revoke of this key would also revoke. Errors use the plugin's own `{ error }` shape: `401`, `403` (\"session required\") and `404`.","operationId":"get/api/api-keys/:id/minted-count","x-access":"The key's owner","parameters":[{"name":"id","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}}}}}}},"/api/api-keys/{id}/rotate":{"post":{"tags":["API keys"],"summary":"Replace an API key","description":"Revokes the key and answers a new token with the same name. Needs a browser sign-in or a key with `canMint`. Errors use the plugin's own `{ error }` shape: `401`, `403` (\"session required\") and `404`.","operationId":"post/api/api-keys/:id/rotate","x-access":"The key's owner, from a browser session or a key with canMint","parameters":[{"name":"id","in":"path","required":true,"description":"The API key's id.","schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"prefix":{"type":"string"},"token":{"type":"string"}},"required":["id","prefix","token"]}}}}}}},"/api/api-keys/devices":{"get":{"tags":["API keys"],"summary":"List your signed-in devices","description":"Your live keys with no workspace: CLI sign-ins and keys made before workspace keys, newest first. They reach every workspace you are in. Sign one out with `POST /api/api-keys/{id}/revoke`. `connections` lists the agents connected over MCP, each to one workspace; disconnect one with `POST /api/mcp-connections/{id}/disconnect`. A request made with a workspace key or an MCP connection gets none.","operationId":"get/api/api-keys/devices","x-access":"Signed-in people","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"devices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"made":{"type":"integer"}},"required":["id","name","prefix","createdAt","expiresAt","lastUsedAt","made"]}},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"client":{"type":"string"},"verified":{"type":"boolean"},"workspace":{"type":"object","properties":{"id":{"type":"string","description":"A document id."},"name":{"type":"string"}},"required":["id","name"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"made":{"type":"integer"}},"required":["id","client","verified","workspace","createdAt","expiresAt","made"]}}},"required":["devices","connections"]}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from `frogbot deploy`'s sign-in, `/api/cli/device/token`, or the API keys page."}},"schemas":{"Errors":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"code":{"type":"string"},"url":{"type":"string","description":"Where a person takes the next step, such as paying."}}}}}}}},"PaginatedDocs":{"type":"object","properties":{"docs":{"type":"array"},"totalDocs":{"type":"integer"},"limit":{"type":"integer"},"totalPages":{"type":"integer"},"page":{"type":"integer"},"pagingCounter":{"type":"integer"},"hasPrevPage":{"type":"boolean"},"hasNextPage":{"type":"boolean"},"prevPage":{"type":["integer","null"]},"nextPage":{"type":["integer","null"]}}},"Workspaces":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"personalOf":{"type":"string","description":"The id of a users document."},"businessFeatures":{"type":"boolean","description":"Business features: sharing apps with everyone in the workspace, and projects with their own people. On with Business or Platform access."},"platformAccess":{"type":"boolean","description":"Never billed, with every Business feature: FrogBot staff, Trend, test workspaces and Enterprise contracts. Only Dojo staff can see or change it."},"plan":{"type":"string","enum":["none","pro","business"]},"subscriptionStatus":{"type":"string"},"paidApps":{"type":"number"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAt":{"type":"string","format":"date-time"},"stripeCustomerId":{"type":"string"},"stripeSubscriptionId":{"type":"string"},"stoppedEmailSentAt":{"type":"string","format":"date-time"},"aiBalanceUSD":{"type":"number"},"aiAutoRecharge":{"type":"boolean"},"aiRechargeThresholdUSD":{"type":"number"},"aiRechargeAmountUSD":{"type":"number"},"previewMonth":{"type":"string"},"previewMinutes":{"type":"number"},"previewApps":{"type":"number"},"activity":{"type":"string"}}},"Members":{"type":"object","properties":{"id":{"type":"string"},"workspace":{"type":"string","description":"The id of a workspaces document."},"email":{"type":"string","format":"email"},"user":{"type":"string","description":"The id of a users document."},"role":{"type":"string","enum":["viewer","editor","admin","owner"]}}},"Projects":{"type":"object","properties":{"id":{"type":"string"},"workspace":{"type":"string","description":"The id of a workspaces document."},"name":{"type":"string"},"isDefault":{"type":"boolean","description":"Every workspace has one default project. It can be renamed, but it can't be deleted."},"createdBy":{"type":"string","description":"The id of a users document."}}},"ProjectShares":{"type":"object","properties":{"id":{"type":"string"},"project":{"type":"string","description":"The id of a projects document."},"email":{"type":"string","format":"email"},"level":{"type":"string","enum":["use","editor","owner"]},"invitedBy":{"type":"string","description":"The id of a users document."}}},"Apps":{"type":"object","properties":{"id":{"type":"string"},"workspace":{"type":"string","description":"The id of a workspaces document."},"name":{"type":"string"},"slug":{"type":"string"},"createdBy":{"type":"string","description":"The id of a users document."},"project":{"type":"string","description":"The id of a projects document."},"visibility":{"type":"string","enum":["private","workspace","public"]},"startedAt":{"type":"string","format":"date-time"},"removed":{"type":"boolean","description":"Takes the app down: it shows a removed page, scheduled wakes stop and deploys are refused. Untick to undo. Only Dojo staff can change it."},"stoppedAt":{"type":"string","format":"date-time"},"runtime":{"type":"object","properties":{"provider":{"type":"string"},"app":{"type":"string"},"database":{"type":"string","enum":["sqlite","dojo","own"]},"databaseProject":{"type":"string"},"databaseBytes":{"type":"number"},"volume":{"type":"string"},"volumeSizeGb":{"type":"number"},"machine":{"type":"string"},"image":{"type":"string"},"healthCheck":{"type":"string","enum":["http","tcp"]},"deployment":{"type":"string","description":"The id of a deployments document."},"secretsVersion":{"type":"number"},"schedules":{},"nextWakeAt":{"type":"string","format":"date-time"},"wakeAttempt":{"type":"number"},"lastWakeAt":{"type":"string","format":"date-time"},"lastWakeStatus":{"type":"string","enum":["ok","retrying","failed"]},"lastWakeError":{"type":"string"},"wakeFailures":{"type":"number"},"wakeAlertedAt":{"type":"string","format":"date-time"},"storageAlertedAt":{"type":"string","format":"date-time"},"egressMonth":{"type":"string"},"egressBytes":{"type":"number"},"egressCountedAt":{"type":"string","format":"date-time"},"egressAlertedMonth":{"type":"string"}}},"preview":{"type":"object","properties":{"startedAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"keep":{"type":"boolean"}}},"domain":{"type":"string"},"domainLiveAt":{"type":"string","format":"date-time"},"deployable":{"type":"boolean"},"activity":{"type":"string"}}},"Templates":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"summary":{"type":"string","description":"One line on the card."},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 8, lowercase."},"workspace":{"type":"string","description":"The id of a workspaces document."},"savedBy":{"type":"string","description":"The id of a users document."},"screenshot":{"type":"string"},"editable":{"type":"boolean"}}},"AppShares":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string","description":"The id of a apps document."},"email":{"type":"string","format":"email"},"level":{"type":"string","enum":["use","editor","owner"]},"invitedBy":{"type":"string","description":"The id of a users document."}}},"Deployments":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string","description":"The id of a apps document."},"status":{"type":"string","enum":["queued","building","ready","failed","cancelled"]},"startedBy":{"type":"string","description":"The id of a users document."},"source":{"type":"string"},"upload":{"type":"string"},"data":{"type":"boolean"},"replaceData":{"type":"boolean"},"queuedAt":{"type":"string","format":"date-time"},"buildStartedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","format":"date-time"},"imageRef":{"type":"string"},"healthRoute":{"type":"boolean"},"adapter":{"type":"string"},"syncSchema":{"type":"boolean"},"error":{"type":"string"},"logTail":{},"builder":{},"runtimeStatus":{"type":"string","enum":["starting","live","failed","superseded"]},"snapshot":{"type":"string"},"restorePoint":{},"liveAt":{"type":"string","format":"date-time"},"rollbackOf":{"type":"string","description":"The id of a deployments document."},"runtimeError":{"type":"string"},"trigger":{"type":"string","enum":["share","git"]},"provider":{"type":"string"},"instanceURL":{"type":"string"},"repoID":{"type":"string"},"commit":{"type":"string"},"message":{"type":"string"},"author":{"type":"string"},"branch":{"type":"string"},"runtimeLogTail":{}}},"ApiKeys":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"owner":{"type":"string","description":"The id of a users document."},"prefix":{"type":"string"},"lastUsedAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time","description":"The key stops working at this time. Empty when it never expires."},"canMint":{"type":"boolean","description":"Requests made with this key can mint and rotate keys no broader than it."},"mintedBy":{"type":"string","description":"The key that minted this one. Empty when a signed-in session did."},"totalCostUSD":{"type":"number"},"workspace":{"type":"string","description":"The one workspace this key works in. Empty for a CLI sign-in, which works in all of its owner's."},"mcpConnection":{"type":"string","description":"The MCP connection that made this key. Disconnecting it revokes the key unless the person unchecks that."},"firmwareKeyId":{"type":"string"},"legacyScheme":{"type":"string","enum":["sha256-hex","firmware"]},"models":{"type":"array","items":{"type":"string","enum":["bedrock/us.anthropic.claude-fable-5","bedrock/us.anthropic.claude-fable-5-1","bedrock/us.anthropic.claude-fable-5-2","bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0","bedrock/us.anthropic.claude-haiku-5-5","bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0","bedrock/us.anthropic.claude-opus-4-6-v1","bedrock/us.anthropic.claude-opus-4-7","bedrock/us.anthropic.claude-opus-4-8","bedrock/us.anthropic.claude-opus-5","bedrock/us.anthropic.claude-opus-5-5","bedrock/us.anthropic.claude-sonnet-4-6","bedrock/us.anthropic.claude-sonnet-5","bedrock/us.anthropic.claude-sonnet-5-5","fireworks-compat/accounts/fireworks/models/deepseek-r1-0528","fireworks-compat/accounts/fireworks/models/deepseek-v4-pro-0813","fireworks-compat/accounts/fireworks/models/glm-5p2","fireworks-compat/accounts/fireworks/models/gpt-oss-120b","fireworks-compat/accounts/fireworks/models/gpt-oss-20b","fireworks-compat/accounts/fireworks/models/kimi-k2-thinking","fireworks-compat/accounts/fireworks/models/kimi-k2p6","fireworks-compat/accounts/fireworks/models/kimi-k2p7-code","fireworks-compat/accounts/fireworks/models/qwen3p7-plus","fireworks/accounts/fireworks/models/deepseek-v4p1-flash","fireworks/accounts/fireworks/models/deepseek-v4p1-flash-1017","fireworks/accounts/fireworks/models/ember-1","fireworks/accounts/fireworks/models/glm-5p3","fireworks/accounts/fireworks/models/glm-5p3-flash","fireworks/accounts/fireworks/models/kimi-k3","fireworks/accounts/fireworks/models/kimi-k3p1-pro","fireworks/accounts/fireworks/models/minimax-m3","fireworks/accounts/fireworks/models/minimax-m3p1-flash","fireworks/accounts/fireworks/models/muse-spark-open","fireworks/accounts/fireworks/models/qwen3p8-2p4t-a95b","fireworks/accounts/fireworks/models/qwen3p8-max","fireworks/accounts/fireworks/routers/deepseek-flash-latest","fireworks/accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot","fireworks/accounts/fireworks/routers/deepseek-v4p1-flash-1017-ultrafast","fireworks/accounts/fireworks/routers/deepseek-v4p1-flash-spot","fireworks/accounts/fireworks/routers/glm-5p3-fast","fireworks/accounts/fireworks/routers/glm-5p3-spot","fireworks/accounts/fireworks/routers/glm-fast-latest","fireworks/accounts/fireworks/routers/glm-flash-latest","fireworks/accounts/fireworks/routers/glm-latest","fireworks/accounts/fireworks/routers/kimi-fast-latest","fireworks/accounts/fireworks/routers/kimi-k3-fast","fireworks/accounts/fireworks/routers/kimi-k3-spot","fireworks/accounts/fireworks/routers/kimi-latest","fireworks/accounts/fireworks/routers/minimax-latest","fireworks/accounts/fireworks/routers/qwen-max-latest","google-compat/text-embedding-004","google/deep-research-max-preview-04-2026","google/deep-research-preview-04-2026","google/gemini-2.5-computer-use-preview-10-2025","google/gemini-2.5-flash","google/gemini-2.5-flash-lite","google/gemini-2.5-flash-preview-tts","google/gemini-2.5-pro","google/gemini-2.5-pro-preview-tts","google/gemini-3-flash-preview","google/gemini-3-pro-image","google/gemini-3.1-flash-image","google/gemini-3.1-flash-lite","google/gemini-3.1-flash-lite-image","google/gemini-3.1-flash-live-preview","google/gemini-3.1-flash-tts-preview","google/gemini-3.1-pro-preview","google/gemini-3.1-pro-preview-customtools","google/gemini-3.5-flash","google/gemini-3.5-flash-lite","google/gemini-3.5-live-translate-preview","google/gemini-3.5-transcribe","google/gemini-3.6-flash","google/gemini-3.7-flash","google/gemini-3.8-flash","google/gemini-4-argon","google/gemini-4-carbon","google/gemini-4-hydrogen","google/gemini-embedding-001","google/gemini-embedding-2","google/gemini-flash-latest","google/gemini-flash-lite-latest","google/gemini-omni-flash-preview","google/gemini-pro-latest","google/gemma-4-26b-a4b-it","google/gemma-4-31b-it","google/lyria-3-clip-preview","google/lyria-3-pro-preview","openai/gpt-4.1","openai/gpt-4.1-mini","openai/gpt-4o","openai/gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","openai/gpt-4o-mini","openai/gpt-4o-mini-transcribe","openai/gpt-4o-transcribe","openai/gpt-5","openai/gpt-5-mini","openai/gpt-5-nano","openai/gpt-5-pro","openai/gpt-5.1","openai/gpt-5.2","openai/gpt-5.2-pro","openai/gpt-5.3-codex","openai/gpt-5.3-codex-spark","openai/gpt-5.4","openai/gpt-5.4-mini","openai/gpt-5.4-nano","openai/gpt-5.4-pro","openai/gpt-5.5","openai/gpt-5.5-pro","openai/gpt-5.6","openai/gpt-5.6-luna","openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-astra","openai/gpt-6-luna","openai/gpt-6-sol","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-daybreak-blue-latest","openai/gpt-daybreak-red-latest","openai/gpt-image-2","openai/gpt-realtime-2.1","openai/o3","openai/o3-pro","openai/text-embedding-3-large","openai/text-embedding-3-small","openai/text-embedding-ada-002","openai/whisper-1","voyage-compat/voyage-4","voyage-compat/voyage-4-large","voyage-compat/voyage-4-lite","voyage-compat/voyage-code-2","voyage-compat/voyage-code-3","voyage-compat/voyage-context-3","voyage-compat/voyage-finance-2","voyage-compat/voyage-law-2","voyage/voyage-3","voyage/voyage-3-lite","voyage/voyage-code-3","xai-compat/grok-4-1-fast-non-reasoning","xai-compat/grok-4-1-fast-reasoning","xai-compat/grok-code-fast-1","xai/grok-4.20-0309-non-reasoning","xai/grok-4.20-0309-reasoning","xai/grok-4.20-multi-agent-0309","xai/grok-4.3","xai/grok-4.5","xai/grok-4.6","xai/grok-4.7","xai/grok-build-0.1","xai/grok-imagine-image","xai/grok-imagine-video","xai/grok-imagine-video-1.5","xai/grok-imagine-video-1.5-lite"]}},"monthlyBudget":{"type":"number"},"spendCounter":{"type":"string","description":"The id of a plugin-ai-policy-spend document."},"spendThisPeriodUSD":{"type":"number"}}}}}}