Appearance
Matters & Ethical Walls API
Create and manage matters (client matters), list sessions tied to a matter, and configure ethical walls to block specific users from matters. Endpoints are under /api/matters and require appropriate RBAC permissions (for example matters:create, matters:read, ethical_walls:create). Authenticate with a Bearer token (Authentication).
Base path: /api/matters
Replace YOUR_TOKEN with your API or session token. For local development, use http://localhost:8000.
Create a matter
POST /api/mattersRequest body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Matter title (1–200 characters) |
client_name | string | Yes | Client name (1–200 characters) |
matter_number | string | No | External or custom number; auto-generated if omitted |
description | string | No | Up to 2000 characters |
practice_area | string | No | e.g. litigation, corporate |
responsible_attorney_id | string | No | User id of responsible attorney |
Additional fields may be accepted as the API evolves; always refer to the OpenAPI schema for the full schema.
Example
bash
curl -X POST "https://api.ghostai.com/api/matters" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp — IP review",
"client_name": "Acme Corp",
"practice_area": "intellectual_property",
"description": "Patent landscape review"
}'List matters
GET /api/matters
GET /api/matters?status=active
GET /api/matters?practice_area=litigation
GET /api/matters?search=acme| Query | Description |
|---|---|
status | Filter by matter status: active, on_hold, closed, archived |
practice_area | Filter by practice area string |
search | Search filter (implementation-specific) |
Pagination query parameters such as page and page_size may also be supported.
Example
bash
curl -s "https://api.ghostai.com/api/matters?status=active&search=acme" \
-H "Authorization: Bearer YOUR_TOKEN"Get, update, or delete a matter
GET /api/matters/{matter_id}
PUT /api/matters/{matter_id}
DELETE /api/matters/{matter_id}- PUT updates fields such as
name,client_name,status, etc. - DELETE archives the matter (soft delete); the matter can be un-archived by updating status.
Examples
bash
curl -s "https://api.ghostai.com/api/matters/matter-uuid" \
-H "Authorization: Bearer YOUR_TOKEN"bash
curl -X DELETE "https://api.ghostai.com/api/matters/matter-uuid" \
-H "Authorization: Bearer YOUR_TOKEN"Sessions for a matter
GET /api/matters/{matter_id}/sessionsReturns chat sessions linked to the matter (subject to ethical wall rules).
Example
bash
curl -s "https://api.ghostai.com/api/matters/matter-uuid/sessions" \
-H "Authorization: Bearer YOUR_TOKEN"Ethical walls
Ethical walls block specified users from accessing a matter.
Create ethical wall
POST /api/matters/ethical-wallsBody
| Field | Type | Required | Description |
|---|---|---|---|
matter_id | string | Yes | Matter to protect |
blocked_user_ids | string[] | Yes | At least one user id in the organization |
reason | string | No | Up to 500 characters |
Example
bash
curl -X POST "https://api.ghostai.com/api/matters/ethical-walls" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"matter_id": "matter-uuid",
"blocked_user_ids": ["user_1", "user_2"],
"reason": "Screening conflict"
}'List ethical walls
GET /api/matters/ethical-walls
GET /api/matters/ethical-walls?matter_id=matter-uuidDelete ethical wall
DELETE /api/matters/ethical-walls/{wall_id}Example
bash
curl -s "https://api.ghostai.com/api/matters/ethical-walls" \
-H "Authorization: Bearer YOUR_TOKEN"bash
curl -X DELETE "https://api.ghostai.com/api/matters/ethical-walls/wall-uuid" \
-H "Authorization: Bearer YOUR_TOKEN"