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

# Companies

> Organizations. Linked from people and deals.

## Endpoints

| Method   | Path                | Purpose                                                                            |
| -------- | ------------------- | ---------------------------------------------------------------------------------- |
| `GET`    | `/companies`        | List, paginated                                                                    |
| `POST`   | `/companies`        | Create                                                                             |
| `POST`   | `/companies/search` | Filter, sort, paginate                                                             |
| `GET`    | `/companies/:id`    | Fetch one                                                                          |
| `PATCH`  | `/companies/:id`    | Update                                                                             |
| `DELETE` | `/companies/:id`    | Soft-delete (moves to 30-day trash; restore via POST /trash/companies/:id/restore) |

## Search

`POST /companies/search` takes the same structured filter body as [people search](/docs/api-reference/people#search): operators `equals | not_equals | contains | gt | gte | lt | lte | is_null`, combinators `and | or`, custom attributes via `custom_attributes.<key>`. Filterable fields: `id`, `name`, `domain`, `created_at`, `updated_at`.

```bash theme={null}
curl -X POST $SALTY_API/companies/search \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filter":{"domain":{"equals":"acme.com"}}}'
```

## Fields

| Field                      | Type           | Notes                                                     |
| -------------------------- | -------------- | --------------------------------------------------------- |
| `id`                       | uuid           |                                                           |
| `name`                     | string         | Required                                                  |
| `domain`                   | string \| null | Indexed (case-insensitive)                                |
| `custom_attributes`        | object         | Validated by the [schema engine](/docs/concepts/schema-engine) |
| `created_at`, `updated_at` | datetime       |                                                           |

## Create

```bash theme={null}
curl -X POST $SALTY_API/companies \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Corp","domain":"acme.com","custom_attributes":{"tier":"enterprise","arr":250000}}'
```

## Validation errors

`name` is required:

```json theme={null}
{
  "error": {
    "type": "invalid_request",
    "code": "validation_failed",
    "message": "Required",
    "param": "name"
  }
}
```
