Create a new team within the user's tenant.
Authorized for tenant admins (JWT) or a service API key carrying write:teams
(which is itself mintable only by a tenant admin, see api_keys.py). Always
creates the team in the caller's own tenant (get_tenant_context).
Send Authorization: Bearer <token>. The token is either a Clerk session JWT or a SmartMemory API key (prefix sm_live_, sm_test_, or legacy sk_).
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/memory/teams" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"team_id": "string",
"name": "string",
"description": "string",
"data_classification": "string",
"cost_center": "string",
"member_count": 0,
"created_at": "2019-08-24T14:15:22Z",
"is_system": false,
"is_default": false,
"user_role": "string",
"read_only": false
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Create Registry
Create a new ontology registry. Requires authentication and operates on user-scoped data.
Create Workspace
Create an independent Workspace: shared with an initial same-tenant Team, or private to the caller. WS-MGMT-4: the transition service decides authority (``create``: tenant admin, never an agent), writes the row and its audit row. The initial Team is checked after authority and before the write, so a non-admin still gets 403 before a missing Team's 404. WS-POLICY-10 B (OWNER D-0147): with no ``team_id`` the authority is ``create_private`` (any member acting as themselves, with agents, service principals and bound keys refused) and the row is exactly ``team_access={}``, ``user_access={caller: admin}``, the caller's tenant and owner, ``is_personal=False``. Nobody else can see it. WS-POLICY-5-FU-1 (review M1, L1): a ``template``/``privacy`` create writes the settings row FIRST, inside the lifecycle's ``before_write`` (after authority and the Team check, before the Mongo insert). The workspace row therefore never exists without its settings: a seed failure writes no workspace and no lifecycle audit row (503), and a crash after the seed leaves only a settings row no workspace id reaches. When the insert does not apply, the settings row is erased again (a left-over one is logged at ERROR and is unreachable: the id is a fresh uuid4).