{"openapi":"3.1.0","info":{"title":"Coherence API","version":"1.0.0","description":"Public REST API for the Coherence platform. Use an API key created at Settings → API Keys in any Coherence workspace.","contact":{"name":"Coherence","url":"https://getcoherence.io"}},"servers":[{"url":"https://api.getcoherence.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_…","description":"API key created in your Coherence workspace."}}},"paths":{"/me":{"get":{"summary":"Identity check","description":"Returns the user/account/scopes the current key resolves to.","responses":{"200":{"description":"Identity payload"}}}},"/modules":{"get":{"summary":"List modules","description":"Returns active CRM modules in the workspace.","responses":{"200":{"description":"Array of modules"}}}},"/modules/{moduleSlug}/fields":{"get":{"summary":"List fields defined on a module","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Array of fields"}}}},"/modules/{moduleSlug}/records":{"get":{"summary":"List records in a module","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","default":25}},{"name":"search","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated record list"}}},"post":{"summary":"Create a record","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string"},"fields":{"type":"object","additionalProperties":true},"ownerUserId":{"type":"string","format":"uuid"}}}}}},"responses":{"201":{"description":"Created record"}}}},"/agents/messages":{"post":{"summary":"Chat with a Coherence agent","description":"Send a message to a Coherence agent (Nash by default). The agent runs its multi-step tool loop and returns its final natural-language response. Tools the agent invokes (sendEmail, createReminder, etc.) still flow through the workspace's approval system.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","maxLength":10000},"agentId":{"type":"string","format":"uuid","description":"Optional. When set, runs the named agent with its custom system prompt. When omitted, uses the default Nash agent."}}}}}},"responses":{"200":{"description":"Agent response payload"},"404":{"description":"Agent not found (when agentId is provided)"}}}},"/modules/{moduleSlug}/records/{recordId}":{"get":{"summary":"Get a record by ID","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Record payload"},"404":{"description":"Not found"}}},"patch":{"summary":"Update a record","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"fields":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Updated record"}}},"delete":{"summary":"Delete a record (soft-delete)","parameters":[{"name":"moduleSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"}}}}}}