> ## Documentation Index
> Fetch the complete documentation index at: https://docs.casexchange.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Firms

> Firm directory and profile management

## Firms Endpoints

Base URL: `https://api.casexchange.com/api/public/v1`

***

### GET /firms/directory

Returns a directory of all active firms on the platform.

**Tier:** `read_only`

```bash theme={null}
curl -X GET "https://api.casexchange.com/api/public/v1/firms/directory" \
  -H "X-API-Key: cxp_ro_your_key_here"
```

**Response `200`**

```json theme={null}
{
  "data": [
    {
      "id": "a1b2c3d4-5678-9abc-def0-1234567890ab",
      "name": "Sterling & Associates",
      "phone": "212-555-0147",
      "address": "450 Lexington Ave, Suite 1200",
      "city": "New York",
      "state": "NY",
      "zip": "10017",
      "website": "https://sterlinglaw.example.com",
      "isInternal": false,
      "createdAt": "2024-06-15T09:30:00.000Z",
      "updatedAt": "2025-11-02T14:22:00.000Z"
    },
    {
      "id": "b2c3d4e5-6789-0abc-def1-234567890abc",
      "name": "Caldwell Legal Group",
      "phone": "310-555-0283",
      "address": "9100 Wilshire Blvd, 7th Floor",
      "city": "Los Angeles",
      "state": "CA",
      "zip": "90212",
      "website": "https://caldwelllegal.example.com",
      "isInternal": false,
      "createdAt": "2024-08-01T12:00:00.000Z",
      "updatedAt": "2025-10-18T08:45:00.000Z"
    }
  ],
  "meta": {
    "requestId": "req_7f3a1b2c4d5e6f78",
    "timestamp": "2026-03-31T16:00:00.000Z"
  }
}
```

***

### GET /firms/me

Returns the firm associated with the API key making the request.

**Tier:** `read_only`

```bash theme={null}
curl -X GET "https://api.casexchange.com/api/public/v1/firms/me" \
  -H "X-API-Key: cxp_ro_your_key_here"
```

**Response `200`**

```json theme={null}
{
  "data": {
    "id": "a1b2c3d4-5678-9abc-def0-1234567890ab",
    "name": "Sterling & Associates",
    "phone": "212-555-0147",
    "address": "450 Lexington Ave, Suite 1200",
    "city": "New York",
    "state": "NY",
    "zip": "10017",
    "website": "https://sterlinglaw.example.com",
    "isInternal": false,
    "createdAt": "2024-06-15T09:30:00.000Z",
    "updatedAt": "2025-11-02T14:22:00.000Z"
  },
  "meta": {
    "requestId": "req_8a4b2c3d5e6f7890",
    "timestamp": "2026-03-31T16:00:05.000Z"
  }
}
```

***

### GET /firms/{id}

Returns a single firm by its UUID.

**Tier:** `read_only`

```bash theme={null}
curl -X GET "https://api.casexchange.com/api/public/v1/firms/b2c3d4e5-6789-0abc-def1-234567890abc" \
  -H "X-API-Key: cxp_ro_your_key_here"
```

**Response `200`**

```json theme={null}
{
  "data": {
    "id": "b2c3d4e5-6789-0abc-def1-234567890abc",
    "name": "Caldwell Legal Group",
    "phone": "310-555-0283",
    "address": "9100 Wilshire Blvd, 7th Floor",
    "city": "Los Angeles",
    "state": "CA",
    "zip": "90212",
    "website": "https://caldwelllegal.example.com",
    "isInternal": false,
    "createdAt": "2024-08-01T12:00:00.000Z",
    "updatedAt": "2025-10-18T08:45:00.000Z"
  },
  "meta": {
    "requestId": "req_9b5c3d4e6f789012",
    "timestamp": "2026-03-31T16:00:10.000Z"
  }
}
```

***

### GET /firms/available

Returns firms the authenticated firm can send referrals to, from their private network and/or the public directory. Includes resolved case type display names and referral instructions. Supports pagination, source filtering, and name search.

**Tier:** `read_only`

**Query parameters:**

| Parameter | Type    | Default | Description                                  |
| --------- | ------- | ------- | -------------------------------------------- |
| `source`  | string  | —       | `network` or `directory`. Omit for both.     |
| `page`    | integer | `1`     | Page number (1-indexed).                     |
| `limit`   | integer | `25`    | Results per page (max 100).                  |
| `search`  | string  | —       | Case-insensitive partial match on firm name. |

```bash theme={null}
curl -X GET "https://api.casexchange.com/api/public/v1/firms/available?source=network&page=1&limit=25" \
  -H "X-API-Key: cxp_ro_your_key_here"
```

**Response `200`**

```json theme={null}
{
  "data": [
    {
      "id": "c3d4e5f6-7890-1abc-def2-34567890abcd",
      "name": "Rivera Injury Law",
      "description": "Full-service personal injury firm serving Southern California since 2012.",
      "jurisdictions": ["CA", "NV"],
      "caseTypes": ["Personal Injury", "Product Liability"],
      "referralInstructions": "Email intake@riverainjury.example.com with case summary and client contact info.",
      "source": "private_network"
    },
    {
      "id": "d4e5f6a7-8901-2bcd-ef34-567890abcde0",
      "name": "Hawkins & Pratt LLP",
      "description": "Medical malpractice specialists with board-certified nurse consultants on staff.",
      "jurisdictions": ["NY", "NJ", "CT"],
      "caseTypes": ["Medical Malpractice", "Nursing Home Abuse"],
      "referralInstructions": null,
      "source": "both"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 25,
    "total": 2,
    "totalPages": 1
  },
  "meta": {
    "requestId": "req_0c6d4e5f7a890123",
    "timestamp": "2026-03-31T16:00:15.000Z"
  }
}
```

***

### PUT /firms/me

Updates editable fields on the API key's own firm. All body fields are optional -- include only the fields you want to change.

**Tier:** `full`

```bash theme={null}
curl -X PUT "https://api.casexchange.com/api/public/v1/firms/me" \
  -H "X-API-Key: cxp_full_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sterling & Associates LLP",
    "phone": "212-555-0199",
    "address": "500 Park Ave, Suite 800",
    "city": "New York",
    "state": "NY",
    "zip": "10022",
    "website": "https://sterlingllp.example.com"
  }'
```

**Response `200`**

```json theme={null}
{
  "data": {
    "id": "a1b2c3d4-5678-9abc-def0-1234567890ab",
    "name": "Sterling & Associates LLP",
    "phone": "212-555-0199",
    "address": "500 Park Ave, Suite 800",
    "city": "New York",
    "state": "NY",
    "zip": "10022",
    "website": "https://sterlingllp.example.com",
    "isInternal": false,
    "createdAt": "2024-06-15T09:30:00.000Z",
    "updatedAt": "2026-03-31T16:00:20.000Z"
  },
  "meta": {
    "requestId": "req_1d7e5f6a8b901234",
    "timestamp": "2026-03-31T16:00:20.000Z"
  }
}
```
