API Ryoma: admin
Service-to-service endpoints for Tara (scope admin, never for users)
This page is generated from
openapi.yamlbynpm run gen, so do not edit it by hand. Authentication is described on the overview page.
/v1/admin/orgs/{org}/exportExport the data of one organization (Tara service, scope admin)
Streams everything Ryoma stores about the organization: projects, the copy of tasks, weekly Flow and AI cost, and sessions (login, start and end time, cost, models, task keys). Ryoma does not store prompt content, so there is none. Only the Tara service account (a Tara token with scope admin) is accepted; a valid token without that scope gets 403 and a missing or invalid token gets 401. orgId is the organization id (the data key); {org} is the slug and is only echoed in the file. Formats: json is one object {org, exportedAt, projects[], tasks[], flowWeekly[], aiWeekly[], sessions[]}; ndjson is one line per row, {"kind": "projects|tasks|flowWeekly|aiWeekly|sessions", "data": {...}}, then a final line {"kind": "end"}: a reader that does not see it knows the stream was cut.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
org | path | string | yes | |
orgId | query | string | yes | |
format | query | json | ndjson |
Responses
| Code | Description | Type |
|---|---|---|
| 200 | The export, streamed | application/json · object |
| 400 | Invalid parameters | application/problem+json · object |
| 401 | Missing or invalid token | application/problem+json · object |
| 403 | Forbidden | application/problem+json · object |
Example response
{}Call with curl
curl "https://ryoma.phillipcli.cloud/v1/admin/orgs/<org>/export?orgId=string" \
-H "Authorization: Bearer $TARA_TOKEN"/v1/admin/users/{login}/eraseReplace the login of a deleted Tara user with a pseudonym (Tara service, scope admin)
Replaces login with replacement (deleted-<8 hex>) in PostgreSQL (directory of users, sessions, user quotas and their breaches) and ClickHouse (every table with a user column or a forge.user attribute, by mutation), and blanks the name and email in the directory. Totals, costs and counts of the organizations stay. Safe to repeat: a second call changes nothing and returns zero rows. Only the service token of Tara (scope admin) is accepted.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
login | path | string | yes |
Body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
replacement | string | yes |
Responses
| Code | Description | Type |
|---|---|---|
| 200 | Rows changed | application/json · object |
| 400 | Invalid parameters | application/problem+json · object |
| 401 | Missing or invalid token | application/problem+json · object |
| 403 | Forbidden | application/problem+json · object |
Example response
{
"login": "string",
"org": "string",
"orgId": "string",
"rows": {},
"total": 0
}Call with curl
curl -X POST "https://ryoma.phillipcli.cloud/v1/admin/users/<login>/erase" \
-H "Authorization: Bearer $TARA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"replacement":"string"}'/v1/admin/orgs/{org}Delete every row of one organization in PostgreSQL and ClickHouse (Tara service, scope admin)
Deletes by orgId (the data key; {org} is the slug, only echoed): every PostgreSQL table with an org_id column and every ClickHouse table (org_id column, or the forge.org_id attribute of the raw OpenTelemetry tables), and forgets the caches of the organization. Safe to repeat: a second call returns zero rows. Only the service token of Tara (scope admin) is accepted.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
org | path | string | yes | |
orgId | query | string (uuid) | yes |
Responses
| Code | Description | Type |
|---|---|---|
| 200 | Rows deleted | application/json · object |
| 400 | Invalid parameters | application/problem+json · object |
| 401 | Missing or invalid token | application/problem+json · object |
| 403 | Forbidden | application/problem+json · object |
Example response
{
"login": "string",
"org": "string",
"orgId": "string",
"rows": {},
"total": 0
}Call with curl
curl -X DELETE "https://ryoma.phillipcli.cloud/v1/admin/orgs/<org>?orgId=string" \
-H "Authorization: Bearer $TARA_TOKEN"