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

# API: Company Endpoints

> API routes for creating, retrieving, and updating companies

# Company Endpoints

These endpoints let you manage companies within your organization.

***

## List Companies

**GET** `/api/v1/organizations/{org_uuid}/companies`

Returns a paginated list of companies for the specified organization.

### Path Parameters

* `org_uuid` (string) – The UUID of the organization.

### Query Parameters

* `uuids` (comma-separated string) – Filter by specific company UUIDs.
* `page_size` (integer, default: `25`)
* `page_number` (integer, default: `1`)
* `sort_by` (string, default: `last_interacted_date`)
* `sort_direction` (string, default: `desc`)
* Other optional filters, such as sentiment ranges, last interacted dates, etc.

### Example Request

`GET /api/v1/organizations/abc123/companies?page_size=5`

### Example Response

```json theme={null}
{
  "companies": [
    {
      "uuid": "comp-0001",
      "organization_uuid": "abc123",
      "name": "Acme Corp",
      "domain": "acme.io",
      "dollar_value": 10000
      // ...
    }
  ],
  "total_company_count": 50
}
```

***

## Create Company

**POST** `/api/v1/organizations/{org_uuid}/companies`

Creates a new company in the specified organization.

### Path Parameters

* `org_uuid` (string)

### Request Body

```json theme={null}
{
  "name": "Acme Corp",
  "domain": "acme.io",
  "dollar_value": 10000,
  "company_persona_uuid": "comp-per-1234"
}
```

### Example Request

```bash theme={null}
curl -X POST "https://api.useinari.com/api/v1/organizations/abc123/companies" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "domain": "acme.io",
    "dollar_value": 10000
  }'
```

### Example Response

```json theme={null}
{
  "companies": [
    {
      "uuid": "comp-9999",
      "name": "Acme Corp",
      "domain": "acme.io",
      "dollar_value": 10000
      // ...
    }
  ]
}
```

***

## Get Single Company

**GET** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}`

Returns details for a single company.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

### Example Request

`GET /api/v1/organizations/abc123/companies/comp-9999`

### Example Response

```json theme={null}
{
  "companies": [
    {
      "uuid": "comp-9999",
      "name": "Acme Corp",
      "domain": "acme.io",
      "dollar_value": 10000
      // ...
    }
  ],
  "total_company_count": 1
}
```

***

## Update Company

**PUT** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}`

Update details of an existing company.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

### Request Body

```json theme={null}
{
  "name": "Acme Corporation",
  "description": "Leading widget maker",
  "domain": "acme.com",
  "dollar_value": 12000,
  "notes": "This is our top enterprise customer"
}
```

### Example Request

```bash theme={null}
curl -X PUT "https://api.useinari.com/api/v1/organizations/abc123/companies/comp-9999" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corporation",
    "domain": "acme.com",
    "dollar_value": 12000,
    "notes": "This is our top enterprise customer"
  }'
```

### Example Response

```json theme={null}
{
  "companies": [
    {
      "uuid": "comp-9999",
      "name": "Acme Corporation",
      "domain": "acme.com",
      "dollar_value": 12000,
      "notes": "This is our top enterprise customer"
      // ...
    }
  ]
}
```

***

## Get Company Customers

**GET** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}/customers`

Lists all customers associated with a specific company.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

### Example Response

```json theme={null}
{
  "customers": [
    {
      "uuid": "cust-1111",
      "full_name": "Bob Smith",
      "customer_company_uuid": "comp-9999"
      // ...
    }
  ],
  "total_customer_count": 20
}
```

***

## Get Company Feedback

**GET** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}/feedbacks`

Fetches all feedback from customers at the specified company.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

***

## Get Company Insights

**GET** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}/insights`

Lists insights for a company’s collective feedback.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

***

## Get Company Issues

**GET** `/api/v1/organizations/{org_uuid}/companies/{company_uuid}/issues`

Lists issues discovered in the company’s collective feedback.

### Path Parameters

* `org_uuid` (string)
* `company_uuid` (string)

### Example Request

`GET /api/v1/organizations/abc123/companies/comp-9999/issues`

### Example Response

```json theme={null}
{
  "issues": [
    {
      "uuid": "issue-1234",
      "title": "Issue Title",
      "description": "Issue Description",
      "status": "open",
      "created_at": "2023-01-01T00:00:00Z",
      "updated_at": "2023-01-01T00:00:00Z"
      // ...
    }
  ],
  "total_issue_count": 10
}
```

***

## Additional Notes

* **Filtering & Pagination**: Many of the query parameters for listing companies support additional filters (e.g., `from_last_interacted_date`, `to_last_interacted_date`, `min_sentiment`, etc.). Refer to the main overview or ask your dev team for a complete list.
* **Error Handling**: Standard HTTP error responses:
  * **400 Bad Request**: Invalid or missing parameters.
  * **401 Unauthorized**: Missing/invalid auth token.
  * **404 Not Found**: Company or organization doesn’t exist.
  * **500 Internal Server Error**: An unexpected error occurred.

That concludes the documentation for **Company Endpoints**.
