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

# Companies

> Create, list, update, and delete companies.

<Snippet file="auth-header.mdx" />

## List companies

<ParamField query="page" type="integer" default="1">Page number</ParamField>
<ParamField query="per_page" type="integer" default="25">Items per page (max 250)</ParamField>
<ParamField query="sort" type="string">Sort field</ParamField>
<ParamField query="order" type="string" default="desc">Sort order: `asc` or `desc`</ParamField>
<ParamField query="q" type="string">Full-text search query</ParamField>
<ParamField query="industry" type="string">Filter by industry</ParamField>
<ParamField query="tag" type="string">Filter by tag name</ParamField>

```bash theme={null}
GET /api/v1/companies
```

```bash Example theme={null}
curl https://api.mossdesk.com/api/v1/companies?industry=SaaS \
  -H "X-API-Key: moss_k_..."
```

## Get a company

```bash theme={null}
GET /api/v1/companies/:id
```

## Create a company

```bash theme={null}
POST /api/v1/companies
```

<ParamField body="name" type="string" required>Company name</ParamField>
<ParamField body="domain" type="string">Company domain (e.g., `acme.com`)</ParamField>
<ParamField body="industry" type="string">Industry</ParamField>
<ParamField body="size" type="string">Company size</ParamField>
<ParamField body="notes" type="string">Free-text notes</ParamField>
<ParamField body="tags" type="string[]">Array of tag names</ParamField>
<ParamField body="custom_fields" type="object">Custom field values as key-value pairs</ParamField>

```bash Example theme={null}
curl -X POST https://api.mossdesk.com/api/v1/companies \
  -H "X-API-Key: moss_k_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "domain": "acme.com",
    "industry": "SaaS",
    "size": "50-200"
  }'
```

## Update a company

```bash theme={null}
PATCH /api/v1/companies/:id
```

Accepts the same body fields as create. Only specified fields are updated.

## Delete a company

```bash theme={null}
DELETE /api/v1/companies/:id
```

Returns `{ "data": null }` on success.
