{"openapi":"3.1.0","info":{"title":"Agent Native CRM","version":"1.0.0","description":"The one place where work done by many agents becomes a record: what happened, who did it, on what basis, and where every deal stands now. Read `GET /v1/skill` first."},"servers":[{"url":"https://agentnativecrm.com/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key issued to a principal."}}},"tags":[{"name":"Meta"},{"name":"Identity"},{"name":"Workspace"},{"name":"Principals"},{"name":"Companies"},{"name":"People"},{"name":"Deals"},{"name":"Activities"},{"name":"Tasks"},{"name":"Lists"},{"name":"Schema"},{"name":"Custom objects"},{"name":"Views"}],"paths":{"/health":{"get":{"operationId":"health","summary":"Liveness probe","tags":["Meta"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"ok":{"type":"boolean"},"environment":{"type":"string"}},"required":["ok","environment"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"security":[]}},"/workspaces":{"post":{"operationId":"createWorkspace","summary":"Create a workspace and become its owner","description":"Open: takes no Authorization header, because you do not have a key yet. Returns the workspace, your principal, and a key that works immediately. A workspace whose only principal is an agent is valid. New workspaces start on the unverified plan, capped at 200 records and 4,000 activities until a human claims a principal.","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":1,"maxLength":48},"owner":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"type":{"default":"agent","type":"string","enum":["human","agent"]},"password":{"type":"string","minLength":8,"maxLength":128}},"required":["name","email"]},"key_name":{"default":"owner","type":"string","minLength":1,"maxLength":32}},"required":["name","owner"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"workspace":{"$ref":"#/definitions/Workspace"},"principal":{"$ref":"#/definitions/Principal"},"key":{"$ref":"#/definitions/IssuedKey"}},"required":["workspace","principal","key"],"definitions":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"owner_principal_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","slug","name","plan","owner_principal_id","created_at"]},"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]},"IssuedKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"Shown once, at creation. Only a hash is stored."},"prefix":{"type":"string"},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","key","prefix","expires_at","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"security":[]}},"/me":{"get":{"operationId":"getMe","summary":"Who you are and which workspace you are in","tags":["Identity"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"principal":{"$ref":"#/definitions/Principal"},"workspace":{"$ref":"#/definitions/Workspace"},"auth_method":{"type":"string","enum":["api_key","session"]}},"required":["principal","workspace","auth_method"],"definitions":{"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"owner_principal_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","slug","name","plan","owner_principal_id","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Record and activity counts against the plan's caps","tags":["Workspace"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Usage","definitions":{"Usage":{"type":"object","properties":{"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"records":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"activities":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]}},"required":["plan","records","activities"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/workspace":{"get":{"operationId":"getWorkspace","summary":"The current workspace","tags":["Workspace"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Workspace","definitions":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"owner_principal_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","slug","name","plan","owner_principal_id","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateWorkspace","summary":"Rename the workspace or change its slug","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":1,"maxLength":48}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Workspace","definitions":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"owner_principal_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","slug","name","plan","owner_principal_id","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals":{"get":{"operationId":"listPrincipals","summary":"Everyone who can act in this workspace","description":"Agents carry their `profile` -- what they are for and the capability keys they declare -- or `null` when nobody has described them yet. Humans have no `profile` field at all.","tags":["Principals"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/PrincipalWithProfile"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"PrincipalWithProfile":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"profile":{"anyOf":[{"$ref":"#/definitions/AgentProfile"},{"type":"null"}]}},"required":["id","type","role","name","email","status","created_at","updated_at"]},"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"post":{"operationId":"createPrincipal","summary":"Add a human or an agent","description":"Agents authenticate only by API key and cannot have a password. Humans may be given one so they can sign in to the dashboard. No invitation email is sent: this product never sends on any channel. Email is the natural key, so this upserts -- an account that already exists joins this workspace at the role you asked for and comes back 200 with created: false, needing no claim link. Send `profile` for an agent to describe it in the same call; it needs a description and at least one capability, and it is refused for a human.","tags":["Principals"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"password":{"type":"string","minLength":8,"maxLength":128},"profile":{"allOf":[{"$ref":"#/definitions/AgentProfileWrite"}]}},"required":["name","email","type","role"],"definitions":{"AgentProfileWrite":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":280},"capabilities":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/definitions/CapabilityDeclaration"}},"instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"limitations":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"runtime":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["description","capabilities"]},"CapabilityDeclaration":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280}},"required":["key"]}]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/CreatedPrincipal","definitions":{"CreatedPrincipal":{"type":"object","properties":{"created":{"type":"boolean","description":"false when an account with this email already existed and joined instead."},"principal":{"$ref":"#/definitions/Principal"}},"required":["created","principal"]},"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}":{"get":{"operationId":"getPrincipal","summary":"Fetch one principal","description":"An agent comes back with its `profile`; a human has no such field.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/PrincipalWithProfile","definitions":{"PrincipalWithProfile":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"profile":{"anyOf":[{"$ref":"#/definitions/AgentProfile"},{"type":"null"}]}},"required":["id","type","role","name","email","status","created_at","updated_at"]},"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updatePrincipal","summary":"Rename, re-role or archive a principal","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"status":{"type":"string","enum":["active","archived"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Principal","definitions":{"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"delete":{"operationId":"removePrincipal","summary":"Remove a principal from this workspace","description":"Takes them off the roster and deletes the keys this workspace issued them. The person is not deleted and everything they wrote stays attributed to them -- archive instead when the work should stand but the access should not. The owner cannot be removed; transfer ownership first.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/profile":{"get":{"operationId":"getAgentProfile","summary":"What one agent says it is for","description":"The structured profile: display name, one-sentence description, declared capability keys, the scope it works to and the limits at which it hands back. `404` when the principal is not in this workspace, `409` when it is a human, and `null` when it is an agent nobody has described yet.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"$ref":"#/definitions/AgentProfile"},{"type":"null"}],"definitions":{"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"put":{"operationId":"setAgentProfile","summary":"Describe an agent, or replace its description","description":"Owners and admins may describe any agent; an agent may always describe itself, because the thing that knows what it can now do is the thing whose tools changed. A description and at least one capability are required. Capability keys are normalised to lowercase dotted segments -- `Lead Qualify`, `lead-qualify` and `lead.qualify` are one key, not three -- and any key the workspace has not seen joins its vocabulary with the label you sent. The list you send is the whole of what this agent claims: a capability you stop mentioning is one it no longer offers. This changes nothing about identity, role or keys, and grants no permission whatsoever.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/AgentProfileWrite","definitions":{"AgentProfileWrite":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":280},"capabilities":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/definitions/CapabilityDeclaration"}},"instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"limitations":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"runtime":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["description","capabilities"]},"CapabilityDeclaration":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280}},"required":["key"]}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/AgentProfile","definitions":{"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateAgentProfile","summary":"Change part of an agent's profile","description":"Leaves out what you do not send. `capabilities` is still replaced wholesale when present, because a partial capability list has no meaning. Refused with `404` for an agent that has no profile yet -- `PUT` one first.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/AgentProfilePatch","definitions":{"AgentProfilePatch":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":280},"capabilities":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/definitions/CapabilityDeclaration"}},"instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"limitations":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"runtime":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}},"CapabilityDeclaration":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280}},"required":["key"]}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/AgentProfile","definitions":{"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/keys":{"get":{"operationId":"listKeys","summary":"A principal's keys, without the secrets","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"start":{"type":["string","null"]},"prefix":{"type":["string","null"]},"enabled":{"type":"boolean"},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","start","prefix","enabled","expires_at","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"post":{"operationId":"issueKey","summary":"Issue an API key","description":"The key is shown once, here. Only a salted hash is stored.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32},"expires_at":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/IssuedKey","definitions":{"IssuedKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"Shown once, at creation. Only a hash is stored."},"prefix":{"type":"string"},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","key","prefix","expires_at","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/keys/{key_id}":{"delete":{"operationId":"revokeKey","summary":"Revoke a key","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/workspace/transfer":{"post":{"operationId":"transferOwnership","summary":"Hand the workspace to another principal","description":"Owner only. The outgoing owner becomes an admin rather than losing access. An agent may receive it: a workspace whose only principal is an agent is valid.","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"principal_id":{"type":"string","minLength":1}},"required":["principal_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Principal","definitions":{"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/reset":{"post":{"operationId":"resetPrincipalPassword","summary":"Mint a password reset link for a human principal","description":"The same one-time link an invite is, for somebody who already has a password and cannot get in. Shown once, valid seven days, and we do not send it -- deliver it on the channel you have. Refused for a principal who has never set a password: invite them instead.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/IssuedClaim","definitions":{"IssuedClaim":{"type":"object","properties":{"token":{"type":"string","description":"Shown once, here. Only a hash is stored."},"expires_at":{"type":"string"},"path":{"type":"string","description":"Where to send the human. Relative, so it is right on whatever origin serves this."}},"required":["token","expires_at","path"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/invite":{"post":{"operationId":"invitePrincipal","summary":"Mint a claim link for a human principal","description":"Returns a one-time link, shown once, that lets a human set a password and take possession of this principal. Valid for seven days. We do not send it -- you have the channel, so delivering it is your job. Issuing again supersedes any outstanding link. Claiming moves an unverified workspace to the free plan.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/IssuedClaim","definitions":{"IssuedClaim":{"type":"object","properties":{"token":{"type":"string","description":"Shown once, here. Only a hash is stored."},"expires_at":{"type":"string"},"path":{"type":"string","description":"Where to send the human. Relative, so it is right on whatever origin serves this."}},"required":["token","expires_at","path"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/principals/{id}/rekey":{"post":{"operationId":"rekeyPrincipal","summary":"Mint a one-time code that re-keys an agent that lost its key","description":"For an agent that is already in this workspace but has no usable key. Returns a code it spends on `POST /v1/agents/claim`, exactly as a new agent would. Spending it revokes every key this principal still holds and issues one, so the identity, its role and its timeline all survive and the missing credential stops working. Agents only -- a human takes possession with `POST /principals/{id}/invite`. Valid for 24 hours, works once, and issuing another supersedes any code still outstanding for this principal.","tags":["Principals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/SetupCode","definitions":{"SetupCode":{"type":"object","properties":{"code":{"type":"string","description":"Shown once, here. Only a hash is stored."},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"expires_at":{"type":"string"},"principal_id":{"description":"The agent this code re-keys, or null for a code that mints a new one.","type":["string","null"]},"principal_name":{"type":["string","null"]}},"required":["code","role","expires_at","principal_id","principal_name"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/agents":{"get":{"operationId":"listAgents","summary":"Who can do this? The agent roster, filtered by capability","description":"Every agent in this workspace with the profile it declared, or `null` where nobody has described it yet. Pass `capability` as one key or a comma-separated list to ask who can do something: `?capability=outreach.draft` finds the drafters, and `?capability=lead.qualify,research.enrich&match=all` finds only the agents that do both. `match` defaults to `any`. Keys are normalised the same way they are on the way in, so filtering is not sensitive to how you typed it. An agent with no profile never matches a capability filter: not having said it can do the job is not the same as being able to. Discovery only -- what an agent may actually do is its role.","tags":["Agents"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"capability","in":"query","required":false,"schema":{"type":"string"}},{"name":"match","in":"query","required":false,"schema":{"type":"string","enum":["any","all"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Agent"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Agent":{"type":"object","properties":{"principal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"status":{"type":"string"}},"required":["id","name","email","role","status"]},"profile":{"anyOf":[{"$ref":"#/definitions/AgentProfile"},{"type":"null"}]}},"required":["principal","profile"]},"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/capabilities":{"get":{"operationId":"listCapabilities","summary":"The capability vocabulary this workspace uses","description":"Every capability key known here, with its label and how many agents declare it. Read this before declaring your own profile: reusing a key that already means what you mean is what makes capability-filtered discovery work. Every workspace starts with a starter vocabulary and may add any key beside it.","tags":["Agents"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CapabilityUsage"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"CapabilityUsage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"agents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many agents in this workspace declare this key."}},"required":["key","label","description","agents"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/agents/setup-code":{"post":{"operationId":"createSetupCode","summary":"Mint a one-time code an agent can exchange for its own key","description":"For handing to an agent that has no key yet. It spends the code on `POST /v1/agents/claim`, which creates its principal and returns a key. Valid for 24 hours, works once, and issuing another supersedes any outstanding code. `role` defaults to `agent` and cannot be `owner`.","tags":["Principals"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"role":{"type":"string","enum":["owner","admin","agent","reviewer"]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/SetupCode","definitions":{"SetupCode":{"type":"object","properties":{"code":{"type":"string","description":"Shown once, here. Only a hash is stored."},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"expires_at":{"type":"string"},"principal_id":{"description":"The agent this code re-keys, or null for a code that mints a new one.","type":["string","null"]},"principal_name":{"type":["string","null"]}},"required":["code","role","expires_at","principal_id","principal_name"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/agents/claim":{"post":{"operationId":"claimSetupCode","summary":"Exchange a setup code for a key of your own","description":"Open: takes no Authorization header, because the code is the credential. Name yourself and you get back the workspace, your principal and a key that works immediately. The key is shown once. The code is spent, so a second attempt with it fails. A re-key code already knows whose it is: `name` is ignored, the principal you get back is the one you already were, and `rekeyed` comes back true. Send `profile` to introduce yourself in the same call -- what you are for and the capability keys you offer -- so the workspace can route work to you from the moment you arrive.","tags":["Principals"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":120},"profile":{"allOf":[{"$ref":"#/definitions/AgentProfileWrite"}]}},"required":["code"],"definitions":{"AgentProfileWrite":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":280},"capabilities":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/definitions/CapabilityDeclaration"}},"instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"limitations":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"runtime":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["description","capabilities"]},"CapabilityDeclaration":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280}},"required":["key"]}]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"workspace":{"$ref":"#/definitions/Workspace"},"principal":{"$ref":"#/definitions/Principal"},"key":{"$ref":"#/definitions/IssuedKey"},"rekeyed":{"type":"boolean"},"profile":{"anyOf":[{"$ref":"#/definitions/AgentProfile"},{"type":"null"}]}},"required":["workspace","principal","key","rekeyed","profile"],"definitions":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["unverified","free","pro","scale","enterprise"]},"owner_principal_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","slug","name","plan","owner_principal_id","created_at"]},"Principal":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["human","agent"]},"role":{"type":"string","enum":["owner","admin","agent","reviewer"]},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","role","name","email","status","created_at","updated_at"]},"IssuedKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"Shown once, at creation. Only a hash is stored."},"prefix":{"type":"string"},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","key","prefix","expires_at","created_at"]},"AgentProfile":{"type":"object","properties":{"principal_id":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"$ref":"#/definitions/Capability"}},"capability_keys":{"type":"array","items":{"type":"string"},"description":"The same capabilities as bare keys, in declaration order, for routing."},"instructions":{"type":["string","null"]},"limitations":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"runtime":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["principal_id","display_name","description","capabilities","capability_keys","instructions","limitations","avatar_url","runtime","created_at","updated_at","updated_by"]},"Capability":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"security":[]}},"/companies":{"post":{"operationId":"upsertCompany","summary":"Create or update a company by its natural key","description":"Matches on the natural key. Returns 201 with `created: true` for a new record, 200 with `created: false` for an existing one. Only the attributes you send are written; anything that changes emits an `enriched` activity carrying the diff, your `source` and your `confidence`.","tags":["Companies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/UpsertResponse","definitions":{"UpsertResponse":{"type":"object","properties":{"created":{"type":"boolean"},"record":{"$ref":"#/definitions/Record"},"activity_id":{"type":["string","null"]}},"required":["created","record","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listCompanies","summary":"List company records","tags":["Companies"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Record"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/companies/{id}":{"get":{"operationId":"getCompany","summary":"Fetch one company","tags":["Companies"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Record","definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateCompany","summary":"Correct a company","description":"A patch is another activity and wins because it is later. Field edits emit `field_changed`; a status move emits `status_changed`, or `do_not_contact` when that is the new status.","tags":["Companies"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/PatchResponse","definitions":{"PatchResponse":{"type":"object","properties":{"record":{"$ref":"#/definitions/Record"},"changes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"from":{},"to":{}},"required":["from","to"]}},"activity_id":{"type":["string","null"]}},"required":["record","changes","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/companies/{id}/activities":{"get":{"operationId":"listCompanyActivities","summary":"The timeline for one company","tags":["Companies"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/companies/{id}/people":{"get":{"operationId":"listCompanyPeople","summary":"People at a company","tags":["Companies"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Record"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/companies/{id}/deals":{"get":{"operationId":"listCompanyDeals","summary":"Deals with a company","tags":["Companies"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Deal"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/people":{"post":{"operationId":"upsertPerson","summary":"Create or update a person by its natural key","description":"Matches on the natural key. Returns 201 with `created: true` for a new record, 200 with `created: false` for an existing one. Only the attributes you send are written; anything that changes emits an `enriched` activity carrying the diff, your `source` and your `confidence`.","tags":["People"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/UpsertResponse","definitions":{"UpsertResponse":{"type":"object","properties":{"created":{"type":"boolean"},"record":{"$ref":"#/definitions/Record"},"activity_id":{"type":["string","null"]}},"required":["created","record","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listPeople","summary":"List person records","tags":["People"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Record"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/people/{id}":{"get":{"operationId":"getPerson","summary":"Fetch one person","tags":["People"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Record","definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updatePerson","summary":"Correct a person","description":"A patch is another activity and wins because it is later. Field edits emit `field_changed`; a status move emits `status_changed`, or `do_not_contact` when that is the new status.","tags":["People"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/PatchResponse","definitions":{"PatchResponse":{"type":"object","properties":{"record":{"$ref":"#/definitions/Record"},"changes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"from":{},"to":{}},"required":["from","to"]}},"activity_id":{"type":["string","null"]}},"required":["record","changes","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/people/{id}/activities":{"get":{"operationId":"listPersonActivities","summary":"The timeline for one person","tags":["People"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/activities":{"post":{"operationId":"createActivity","summary":"Append a fact to the timeline","description":"Activities are never updated or deleted. Point at exactly one record, use a type the workspace knows, and say where the fact came from.","tags":["Activities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"data":{}},"required":["type","target"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Activity","definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listActivities","summary":"Read the timeline","tags":["Activities"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}},{"name":"actor_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"record","in":"query","required":false,"schema":{"description":"`company:<id>`, `person:<id>`, `<object>:<id>`","type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/deals":{"post":{"operationId":"createDeal","summary":"Open a deal","description":"Opens at the first stage of its pipeline. Omit `pipeline` for the one every workspace starts with.","tags":["Deals"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"pipeline":{"type":"string","minLength":1,"maxLength":48},"name":{"type":"string","minLength":1,"maxLength":200},"company_id":{"type":["string","null"]},"contacts":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"stage":{"type":"string","minLength":1,"maxLength":64},"value":{"type":["number","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Deal","definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listDeals","summary":"List deals","tags":["Deals"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"stage","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","won","lost"]}},{"name":"company_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"owner_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Deal"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/deals/{id}":{"get":{"operationId":"getDeal","summary":"Fetch one deal","tags":["Deals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Deal","definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateDeal","summary":"Edit a deal's attributes or contacts","description":"`stage`, `status` and `lost_reason` are not patchable: they are events, so they go through `/stage` and `/close` where an activity is written to explain them.","tags":["Deals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"contacts":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Deal","definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/deals/{id}/stage":{"post":{"operationId":"changeDealStage","summary":"Move a deal to a stage","description":"Emits `stage_changed` with `from` and `to`.","tags":["Deals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"stage":{"type":"string","minLength":1,"maxLength":64},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["stage"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Deal","definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/deals/{id}/close":{"post":{"operationId":"closeDeal","summary":"Win or lose a deal","description":"`lost` requires `lost_reason`. Sets the status, the stage and `closed_at`.","tags":["Deals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"type":"string","enum":["won","lost"]},"lost_reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"stage":{"type":"string","minLength":1,"maxLength":64}},"required":["status"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Deal","definitions":{"Deal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company_id":{"type":["string","null"]},"stage":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"expected_close":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lost_reason":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"string"}}},"required":["id","name","company_id","stage","value","currency","expected_close","owner_id","status","lost_reason","closed_at","contacts"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/deals/{id}/activities":{"get":{"operationId":"listDealActivities","summary":"The timeline for one deal","tags":["Deals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/feature-requests":{"post":{"operationId":"createFeatureRequest","summary":"Ask for a product capability that does not exist yet","description":"Use this for a gap in Agent Native CRM itself -- an API, MCP tool, dashboard capability, integration or data-model change. It is not a CRM task. The request starts as submitted and remains visible to the principal that created it.","tags":["Feature requests"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":10000},"surface":{"type":"string","enum":["api","mcp","dashboard","integration","data_model","other"]}},"required":["title","description"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/FeatureRequest","definitions":{"FeatureRequest":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"requested_by":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"surface":{"type":"string","enum":["api","mcp","dashboard","integration","data_model","other"]},"status":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]},"response_note":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","requested_by","title","description","surface","status","response_note","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listFeatureRequests","summary":"Read feature requests and their current status","description":"Agents see only requests they submitted. Workspace owners and admins see the whole workspace queue so they can triage it.","tags":["Feature requests"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/FeatureRequest"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"FeatureRequest":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"requested_by":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"surface":{"type":"string","enum":["api","mcp","dashboard","integration","data_model","other"]},"status":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]},"response_note":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","requested_by","title","description","surface","status","response_note","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/feature-requests/{id}":{"get":{"operationId":"getFeatureRequest","summary":"Read one feature request and its current status","tags":["Feature requests"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/FeatureRequest","definitions":{"FeatureRequest":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"requested_by":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"surface":{"type":"string","enum":["api","mcp","dashboard","integration","data_model","other"]},"status":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]},"response_note":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","requested_by","title","description","surface","status","response_note","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateFeatureRequest","summary":"Triage a feature request","description":"Workspace owners and admins may change status and leave a response for the requesting agent. The requesting agent can read the result but cannot change it.","tags":["Feature requests"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]},"response_note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/FeatureRequest","definitions":{"FeatureRequest":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"requested_by":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"surface":{"type":"string","enum":["api","mcp","dashboard","integration","data_model","other"]},"status":{"type":"string","enum":["submitted","reviewing","planned","in_progress","shipped","declined"]},"response_note":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","requested_by","title","description","surface","status","response_note","created_at","updated_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks":{"post":{"operationId":"createTask","summary":"Queue work for a principal, or for whoever claims it first","description":"Leave `assignee_id` out to put the task on the workspace queue. A record marked `do_not_contact` cannot be given a task on `email`, `linkedin`, `whatsapp` or `call`; that returns 409 `do_not_contact`. For contact channels, put the reviewable message in `payload`: email uses `to`, optional `cc`/`bcc`, `subject`, and `body`; LinkedIn and WhatsApp use `to` and `body`; calls use `to` and `talking_points`. A follow-up is a new task whose `parent_task_id` is the immediately preceding touch. Email follow-ups may omit unchanged `to` and `subject` values. To hand work to another agent, add `required_capabilities`, a `handoff_note` and an `expected_output`. The assignee must declare every required key or you get 422 naming the missing ones; `capability_override: true` assigns anyway and the mismatch stays visible on the task. `follow_on_of` chains the next job of a multi-agent workflow -- a different edge from `parent_task_id`, which stays the message thread.","tags":["Tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"required_capabilities":{"anyOf":[{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"description":"Capability keys, normalised the way `GET /v1/capabilities` reports them"},{"type":"null"}]},"handoff_note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"expected_output":{},"capability_override":{"type":"boolean"},"title":{"type":"string","minLength":1,"maxLength":200},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"allOf":[{"$ref":"#/definitions/TaskPayload"}]},"due_at":{"type":["string","null"]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["title","channel"],"definitions":{"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listTasks","summary":"Find work","description":"`capability=lead.qualify,outreach.draft` finds the work asking for any of those keys, which is how an agent finds jobs it is actually for. `follow_on_of` lists the tasks chained after one job. Unclaimed work is `unassigned=true&status=open`; work somebody took and never finished is `status=claimed` with an old `claimed_at`.","tags":["Tasks"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"assignee","in":"query","required":false,"schema":{"description":"`me` or a principal id","type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","claimed","done","failed","cancelled"]}},{"name":"due_before","in":"query","required":false,"schema":{"type":"string"}},{"name":"unassigned","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"capability","in":"query","required":false,"schema":{"description":"One key or a comma-separated list","type":"string"}},{"name":"follow_on_of","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Task"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}":{"get":{"operationId":"getTask","summary":"Fetch one task","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateTask","summary":"Edit a task while it is still open","description":"Also how a supervisor corrects a brief that came back as `missing_context`: `handoff_note`, `expected_output` and `required_capabilities` are all editable, and the requirement is re-checked against whoever holds the task.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"required_capabilities":{"anyOf":[{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"description":"Capability keys, normalised the way `GET /v1/capabilities` reports them"},{"type":"null"}]},"handoff_note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"expected_output":{},"capability_override":{"type":"boolean"},"title":{"type":"string","minLength":1,"maxLength":200},"assignee_id":{"type":["string","null"]},"due_at":{"type":["string","null"]},"payload":{"allOf":[{"$ref":"#/definitions/TaskPayload"}]}},"definitions":{"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/chain":{"get":{"operationId":"getTaskChain","summary":"Who is responsible for this task, and everything that has happened to it","description":"The whole chain: creator, delegator, current assignee, claimant, the handoff note and expected output, every delegation, claim, reassignment, return and close in order, and the tasks chained after this one through `follow_on_of`. Ids and reasons only -- nothing here exposes a key or a credential.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/TaskChain","definitions":{"TaskChain":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string"},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"history":{"type":"array","items":{"$ref":"#/definitions/TaskAssignment"}},"follow_ons":{"type":"array","items":{"$ref":"#/definitions/Task"}}},"required":["task_id","status","created_by","delegated_by","assignee_id","claimed_by","required_capabilities","handoff_note","expected_output","capability_override","returned_count","parent_task_id","follow_on_of","history","follow_ons"]},"TaskAssignment":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["created","delegated","claimed","reassigned","released","returned","completed","failed","cancelled"]},"actor_id":{"type":"string"},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"reason":{"type":["string","null"]},"note":{"type":["string","null"]},"capability_match":{"anyOf":[{"type":"string","enum":["matched","override","unspecified"]},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","event","actor_id","from","to","reason","note","capability_match","created_at"]},"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/delegate":{"post":{"operationId":"delegateTask","summary":"Hand an open task to another agent, with the context it needs","description":"The deliberate handoff: name the assignee -- or `null` for the workspace queue -- say what the work requires, what you are handing over and what you expect back. Only open work can be delegated: once somebody has claimed it, it is theirs until they return it or an owner or admin reassigns it. The assignee must declare every key in `required_capabilities`, or you get 422 naming what is missing; `capability_override: true` assigns anyway and records that it was an override. Find a candidate first with `GET /v1/agents?capability=...`. Capability guides the choice and grants nothing -- the assignee's role still decides what it may do.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"required_capabilities":{"anyOf":[{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"description":"Capability keys, normalised the way `GET /v1/capabilities` reports them"},{"type":"null"}]},"handoff_note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"expected_output":{},"capability_override":{"type":"boolean"},"assignee_id":{"type":["string","null"]},"due_at":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/reassign":{"post":{"operationId":"reassignTask","summary":"Move a task to somebody else, claimed or not","description":"Supervision. Taking work off a claimant is owner or admin only; anyone who may write tasks can move unclaimed work. The claim is dropped and the task goes back to `open` for its new assignee, or to the queue when `assignee_id` is null. A reassignment racing a completion loses: finished work cannot be moved.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"assignee_id":{"type":["string","null"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"capability_override":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/return":{"post":{"operationId":"returnTask","summary":"Hand work back with a reason instead of failing it","description":"For the claimant, and only the claimant. Failing says you tried and it did not work; returning says this was the wrong agent or the brief was not enough to act on. `reason` is one of `missing_context`, `not_my_capability`, `blocked_externally`, `needs_human`, `out_of_scope`, `other`. The task goes back to whoever delegated it, or to the queue with `to_queue: true` or when that principal has left, and its `returned_count` goes up so repeatedly-bounced work is findable.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"reason":{"type":"string","enum":["missing_context","not_my_capability","blocked_externally","needs_human","out_of_scope","other"]},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"to_queue":{"type":"boolean"}},"required":["reason"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/claim":{"post":{"operationId":"claimTask","summary":"Claim a task","description":"Exactly one caller wins. A second claim returns 409 `already_claimed` — that is the signal to move on to the next task, not to retry.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/release":{"post":{"operationId":"releaseTask","summary":"Put a claimed task back on the queue","description":"The counterpart to claim, for work you cannot finish and for agents that did not come back. The principal holding it may release their own; an owner or admin may release anyone's. Keeps the task and its parent_task_id chain, which cancelling and recreating would lose. Find abandoned work with status=claimed and an old claimed_at.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/complete":{"post":{"operationId":"completeTask","summary":"Finish a task you claimed","description":"Writes `task_closed` on the linked record with your result.","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"outcome":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/fail":{"post":{"operationId":"failTask","summary":"Record that a task could not be done","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"outcome":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/tasks/{id}/cancel":{"post":{"operationId":"cancelTask","summary":"Cancel a task that should not happen","tags":["Tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"outcome":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Task","definitions":{"Task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string","enum":["email","linkedin","whatsapp","call","review","research","other"]},"assignee_id":{"type":["string","null"]},"claimed_by":{"type":["string","null"]},"claimed_at":{"type":["string","null"]},"record":{"anyOf":[{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},{"type":"null"}]},"parent_task_id":{"type":["string","null"]},"follow_on_of":{"type":["string","null"]},"payload":{"anyOf":[{"$ref":"#/definitions/TaskPayload"},{"type":"null"}]},"due_at":{"type":["string","null"]},"status":{"type":"string","enum":["open","claimed","done","failed","cancelled"]},"status_reason":{"type":["string","null"]},"result":{"anyOf":[{"type":"object","properties":{"outcome":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["outcome","note"]},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_by":{"type":"string"},"delegated_by":{"type":["string","null"]},"delegated_at":{"type":["string","null"]},"required_capabilities":{"type":"array","items":{"type":"string"}},"handoff_note":{"type":["string","null"]},"expected_output":{"anyOf":[{},{"type":"null"}]},"capability_override":{"type":"boolean"},"returned_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","channel","assignee_id","claimed_by","claimed_at","record","parent_task_id","follow_on_of","payload","due_at","status","status_reason","result","closed_at","created_by","delegated_by","delegated_at","required_capabilities","handoff_note","expected_output","capability_override","returned_count","created_at","updated_at"]},"TaskPayload":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"talking_points":{"type":"string"}},"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/lists":{"post":{"operationId":"createList","summary":"Create a list of records","tags":["Lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"object_key":{"type":"string","minLength":1,"maxLength":64}},"required":["name","object_key"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/List","definitions":{"List":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"object_key":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","name","object_key","status","status_reason","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listLists","summary":"List the lists","tags":["Lists"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/List"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"List":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"object_key":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","name","object_key","status","status_reason","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/lists/{id}":{"get":{"operationId":"getList","summary":"Fetch one list","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/List","definitions":{"List":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"object_key":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","name","object_key","status","status_reason","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/lists/{id}/members":{"post":{"operationId":"addListMembers","summary":"Add or update members in bulk","description":"Upserted on (list, record), so sending the same batch twice is safe.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"members":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"record_id":{"type":"string","minLength":1},"status":{"type":"string","minLength":1,"maxLength":64},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["record_id"]}}},"required":["members"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/ListMember"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"ListMember":{"type":"object","properties":{"id":{"type":"string"},"list_id":{"type":"string"},"record_id":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["id","list_id","record_id","status","reason","created_at","updated_at","updated_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listListMembers","summary":"Read a list's members","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/ListMember"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"ListMember":{"type":"object","properties":{"id":{"type":"string"},"list_id":{"type":"string"},"record_id":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["id","list_id","record_id","status","reason","created_at","updated_at","updated_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/lists/{id}/members/{member_id}":{"patch":{"operationId":"updateListMember","summary":"Change a member's status, with a reason","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"type":"string","minLength":1,"maxLength":64},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/ListMember","definitions":{"ListMember":{"type":"object","properties":{"id":{"type":"string"},"list_id":{"type":"string"},"record_id":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}},"required":["id","list_id","record_id","status","reason","created_at","updated_at","updated_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema":{"get":{"operationId":"getSchema","summary":"The whole registry: objects, fields, stages, activity types, statuses, views","description":"Read this first. It describes everything this workspace can store.","tags":["Schema"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Schema","definitions":{"Schema":{"type":"object","properties":{"objects":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"plural":{"type":"string"},"natural_key":{"type":["string","null"]},"is_core":{"type":"boolean"},"table_name":{"type":"string"},"hidden":{"type":"boolean"},"fields":{"type":"array","items":{"$ref":"#/definitions/Field"}}},"required":["key","label","plural","natural_key","is_core","table_name","hidden","fields"]}},"stages":{"type":"array","items":{"$ref":"#/definitions/Stage"}},"activity_types":{"type":"array","items":{"$ref":"#/definitions/ActivityType"}},"status_lists":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"views":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"is_default":{"type":"boolean"},"shared":{"type":"boolean"}},"required":["id","object_key","name","is_default","shared"]}}},"required":["objects","stages","activity_types","status_lists","views"]},"Field":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["text","long_text","number","currency","boolean","date","datetime","select","multi_select","reference","url","email","phone","json"]},"required":{"type":"boolean"},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reference_object":{"type":["string","null"]},"is_standard":{"type":"boolean"},"hidden":{"type":"boolean"},"position":{"type":"number"}},"required":["id","object_key","key","label","description","type","required","options","reference_object","is_standard","hidden","position"]},"Stage":{"type":"object","properties":{"pipeline":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"}},"required":["pipeline","key","label","position"]},"ActivityType":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"is_standard":{"type":"boolean"}},"required":["key","label","description","is_standard"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/fields":{"post":{"operationId":"addField","summary":"Add a field to any object","description":"The field becomes a real column and behaves exactly like a standard one.","tags":["Schema"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"object_key":{"type":"string","minLength":1,"maxLength":64},"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"type":{"type":"string","enum":["text","long_text","number","currency","boolean","date","datetime","select","multi_select","reference","url","email","phone","json"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string","minLength":1}},"reference_object":{"type":"string","minLength":1,"maxLength":64}},"required":["object_key","key","type"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Field","definitions":{"Field":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["text","long_text","number","currency","boolean","date","datetime","select","multi_select","reference","url","email","phone","json"]},"required":{"type":"boolean"},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reference_object":{"type":["string","null"]},"is_standard":{"type":"boolean"},"hidden":{"type":"boolean"},"position":{"type":"number"}},"required":["id","object_key","key","label","description","type","required","options","reference_object","is_standard","hidden","position"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/fields/{id}":{"patch":{"operationId":"updateField","summary":"Relabel, re-option or hide a field","tags":["Schema"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string","minLength":1}},"hidden":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Field","definitions":{"Field":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["text","long_text","number","currency","boolean","date","datetime","select","multi_select","reference","url","email","phone","json"]},"required":{"type":"boolean"},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reference_object":{"type":["string","null"]},"is_standard":{"type":"boolean"},"hidden":{"type":"boolean"},"position":{"type":"number"}},"required":["id","object_key","key","label","description","type","required","options","reference_object","is_standard","hidden","position"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"delete":{"operationId":"deleteField","summary":"Soft-delete a custom field","description":"Refused for standard fields; hide those instead. Purged after 30 days.","tags":["Schema"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/objects":{"post":{"operationId":"createObject","summary":"Create a custom object with its own table","tags":["Schema"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","minLength":1,"maxLength":120},"plural":{"type":"string","minLength":1,"maxLength":120},"natural_key":{"anyOf":[{"type":"string","minLength":1,"maxLength":48},{"type":"null"}]},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["text","long_text","number","currency","boolean","date","datetime","select","multi_select","reference","url","email","phone","json"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string","minLength":1}},"reference_object":{"type":"string","minLength":1,"maxLength":64}},"required":["key","type"]}}},"required":["key"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/ObjectDefinition","definitions":{"ObjectDefinition":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"plural":{"type":"string"},"natural_key":{"type":["string","null"]},"is_core":{"type":"boolean"},"table_name":{"type":"string"},"hidden":{"type":"boolean"}},"required":["key","label","plural","natural_key","is_core","table_name","hidden"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/objects/{key}":{"patch":{"operationId":"updateObject","summary":"Relabel a custom object","tags":["Schema"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"plural":{"type":"string","minLength":1,"maxLength":120}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/ObjectDefinition","definitions":{"ObjectDefinition":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"plural":{"type":"string"},"natural_key":{"type":["string","null"]},"is_core":{"type":"boolean"},"table_name":{"type":"string"},"hidden":{"type":"boolean"}},"required":["key","label","plural","natural_key","is_core","table_name","hidden"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"delete":{"operationId":"deleteObject","summary":"Soft-delete a custom object","tags":["Schema"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/stages":{"get":{"operationId":"listStages","summary":"The deal stages, in order","description":"Every stage in the workspace, each naming its pipeline. Pass `pipeline` for one process. A workspace that never asks for a second pipeline has one called `default`.","tags":["Schema"],"parameters":[{"name":"pipeline","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Stage"}}},"required":["data"],"definitions":{"Stage":{"type":"object","properties":{"pipeline":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"}},"required":["pipeline","key","label","position"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"put":{"operationId":"replaceStages","summary":"Replace the ordered stage list of one pipeline","description":"Refused if it would strand deals on a stage you removed. Naming a `pipeline` that does not exist creates it -- a pipeline is simply the name its stages carry. Give it a terminal stage matching the status a deal closes on, or closing will have nowhere to land.","tags":["Schema"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"pipeline":{"type":"string","minLength":1,"maxLength":48},"stages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","maxLength":120}},"required":["key"]}}},"required":["stages"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Stage"}}},"required":["data"],"definitions":{"Stage":{"type":"object","properties":{"pipeline":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"}},"required":["pipeline","key","label","position"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/stages/{key}":{"delete":{"operationId":"removeStage","summary":"Remove one stage","description":"If deals are on it, pass `move_to`; each move emits `stage_changed` attributed to you. Scoped to one pipeline: the same key in another is a different stage.","tags":["Schema"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"move_to","in":"query","required":false,"schema":{"type":"string"}},{"name":"pipeline","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Stage"}}},"required":["data"],"definitions":{"Stage":{"type":"object","properties":{"pipeline":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"}},"required":["pipeline","key","label","position"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/pipelines":{"get":{"operationId":"listPipelines","summary":"The pipelines this workspace runs","description":"Derived from the stages, not stored separately: a pipeline exists because stages carry its name. Create one by naming it in PUT /schema/stages.","tags":["Schema"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/activity-types":{"get":{"operationId":"listActivityTypes","summary":"The activity vocabulary","tags":["Schema"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/ActivityType"}}},"required":["data"],"definitions":{"ActivityType":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"is_standard":{"type":"boolean"}},"required":["key","label","description","is_standard"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"post":{"operationId":"addActivityType","summary":"Add a workspace-defined activity type","tags":["Schema"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"fields":{}},"required":["key"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/activity-types/{key}":{"delete":{"operationId":"removeActivityType","summary":"Hide an activity type","description":"Activities already recorded with it keep it.","tags":["Schema"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/schema/status-lists/{name}":{"get":{"operationId":"getStatusList","summary":"One named status list","tags":["Schema"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}}},"required":["data"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"put":{"operationId":"replaceStatusList","summary":"Replace a named status list","tags":["Schema"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"values":{"minItems":1,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":48},"label":{"type":"string","maxLength":120}},"required":["key"]}}},"required":["values"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}}},"required":["data"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/objects/{key}/records":{"post":{"operationId":"upsertObjectRecord","summary":"Create or update a objectRecord by its natural key","description":"Matches on the natural key. Returns 201 with `created: true` for a new record, 200 with `created: false` for an existing one. Only the attributes you send are written; anything that changes emits an `enriched` activity carrying the diff, your `source` and your `confidence`.","tags":["Custom objects"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/UpsertResponse","definitions":{"UpsertResponse":{"type":"object","properties":{"created":{"type":"boolean"},"record":{"$ref":"#/definitions/Record"},"activity_id":{"type":["string","null"]}},"required":["created","record","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listObjectRecords","summary":"List objectRecord records","tags":["Custom objects"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Record"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/objects/{key}/records/{id}":{"get":{"operationId":"getObjectRecord","summary":"Fetch one objectRecord","tags":["Custom objects"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Record","definitions":{"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateObjectRecord","summary":"Correct a objectRecord","description":"A patch is another activity and wins because it is later. Field edits emit `field_changed`; a status move emits `status_changed`, or `do_not_contact` when that is the new status.","tags":["Custom objects"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/RecordWrite","definitions":{"RecordWrite":{"type":"object","properties":{"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["attributes"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/PatchResponse","definitions":{"PatchResponse":{"type":"object","properties":{"record":{"$ref":"#/definitions/Record"},"changes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"from":{},"to":{}},"required":["from","to"]}},"activity_id":{"type":["string","null"]}},"required":["record","changes","activity_id"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/objects/{key}/records/{id}/activities":{"get":{"operationId":"listObjectRecordActivities","summary":"The timeline for one objectRecord","tags":["Custom objects"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor_id":{"type":"string"},"target":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"string"}},"required":["object","id"]},"body":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["number","null"]},"data":{},"created_at":{"type":"string"}},"required":["id","type","actor_id","target","body","source","confidence","data","created_at"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/views":{"post":{"operationId":"createView","summary":"Save a query","tags":["Views"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"object_key":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","minLength":1,"maxLength":120},"filters":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":64},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":64},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"group_by":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"shared":{"type":"boolean"}},"required":["object_key","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/View","definitions":{"View":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"shared":{"type":"boolean"},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]}},"required":["id","object_key","name","filters","sort","columns","group_by","owner_id","shared","is_default","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"get":{"operationId":"listViews","summary":"The saved views you can see","tags":["Views"],"parameters":[{"name":"object_key","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/View"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"definitions":{"View":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"shared":{"type":"boolean"},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]}},"required":["id","object_key","name","filters","sort","columns","group_by","owner_id","shared","is_default","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/views/{id}":{"get":{"operationId":"getView","summary":"Fetch one view","tags":["Views"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/View","definitions":{"View":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"shared":{"type":"boolean"},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]}},"required":["id","object_key","name","filters","sort","columns","group_by","owner_id","shared","is_default","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"patch":{"operationId":"updateView","summary":"Change a view's filters, sort, columns or grouping","tags":["Views"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"filters":{"type":"array","items":{}},"sort":{"type":"array","items":{}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"shared":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/View","definitions":{"View":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"shared":{"type":"boolean"},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]}},"required":["id","object_key","name","filters","sort","columns","group_by","owner_id","shared","is_default","created_at","updated_at","created_by"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}},"delete":{"operationId":"deleteView","summary":"Soft-delete a view","tags":["Views"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/views/{id}/records":{"get":{"operationId":"runView","summary":"Run a view and read the rows it selects","description":"Returns the page, plus `groups` counted over the whole filtered set when the view has a `group_by` — so a board's counts mean the pipeline, not the screen.","tags":["Views"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/ViewResults","definitions":{"ViewResults":{"type":"object","properties":{"view":{"$ref":"#/definitions/View"},"data":{"type":"array","items":{"$ref":"#/definitions/Record"}},"groups":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"next_cursor":{"type":["string","null"]}},"required":["view","data","groups","next_cursor"]},"View":{"type":"object","properties":{"id":{"type":"string"},"object_key":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","contains","starts_with","in","is_null","is_not_null"]},"value":{}},"required":["field","op"]}},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"]}},"columns":{"type":"array","items":{"type":"string"}},"group_by":{"type":["string","null"]},"owner_id":{"type":["string","null"]},"shared":{"type":"boolean"},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]}},"required":["id","object_key","name","filters","sort","columns","group_by","owner_id","shared","is_default","created_at","updated_at","created_by"]},"Record":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","created_at","updated_at"],"additionalProperties":{}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This document","tags":["Meta"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"security":[]}},"/skill":{"get":{"operationId":"getSkill","summary":"SKILL.md — how to use this API, written for an agent","tags":["Meta"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"string"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"422":{"description":"validation","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/Error","definitions":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","conflict","already_claimed","do_not_contact","validation","rate_limited","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"security":[]}}}}