Skip to content

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/matters

Request body ​

FieldTypeRequiredDescription
namestringYesMatter title (1–200 characters)
client_namestringYesClient name (1–200 characters)
matter_numberstringNoExternal or custom number; auto-generated if omitted
descriptionstringNoUp to 2000 characters
practice_areastringNoe.g. litigation, corporate
responsible_attorney_idstringNoUser 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
QueryDescription
statusFilter by matter status: active, on_hold, closed, archived
practice_areaFilter by practice area string
searchSearch 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}/sessions

Returns 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-walls

Body

FieldTypeRequiredDescription
matter_idstringYesMatter to protect
blocked_user_idsstring[]YesAt least one user id in the organization
reasonstringNoUp 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-uuid

Delete 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"

SOC 2 Type II Certified | BAA Available | HIPAA-Ready