> For the complete documentation index, see [llms.txt](https://tri.gitbook.io/tri-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tri.gitbook.io/tri-doc/liquidity-pool/create-company.md).

# Create Company

### Liquidity Pool

<mark style="color:green;">`POST`</mark> <https://sandbox.triangle.digital/api/v2/liquidity\\_pool/clients/{client\\_id}/companies>

Adds a Carbon Pool company of the client. Business accounts only. All validation problems are returned at once in `data.errors`.

**Path parameters**

<table data-full-width="true" data-search="false"><thead><tr><th width="230">Name</th><th width="110">Type</th><th>Description</th><th width="210">Where to take it from</th></tr></thead><tbody><tr><td><code>client_id</code></td><td>integer</td><td><strong>Required.</strong> The client the company belongs to.</td><td><a href="/tri-doc/liquidity-pool/get-clients.md">Get Clients</a> — <code>client_id</code></td></tr></tbody></table>

**Headers**

<table data-full-width="true"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr></tbody></table>

**Body**

<table data-full-width="true" data-search="false"><thead><tr><th width="200">Name</th><th width="110">Type</th><th>Description</th><th width="260">Example</th></tr></thead><tbody><tr><td><code>hash</code></td><td>string</td><td><strong>Required.</strong> API key.</td><td>fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1</td></tr><tr><td><code>client_company_id</code></td><td>string</td><td><strong>Required.</strong> Company ID — the client assigns the value, as used in its own systems. Unique within the client.</td><td>119401</td></tr><tr><td><code>company_name</code></td><td>string</td><td>Company name, unique within the client when given.</td><td>Triangle Digital</td></tr><tr><td><code>first_name</code></td><td>string</td><td>Contact first name.</td><td>John</td></tr><tr><td><code>last_name</code></td><td>string</td><td>Contact last name.</td><td>Smith</td></tr><tr><td><code>email</code></td><td>string</td><td>Contact email; validated when given.</td><td>support@triangle.digital</td></tr><tr><td><code>telephone</code></td><td>string</td><td>Contact telephone.</td><td>+1 (555) 555-0199</td></tr></tbody></table>

```json
{
    "hash": "fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1",
    "client_company_id": "119401",
    "company_name": "Triangle Digital",
    "first_name": "John",
    "last_name": "Smith",
    "email": "support@triangle.digital",
    "telephone": "+1 (555) 555-0199"
}
```

**Response fields**

<table data-full-width="true" data-search="false"><thead><tr><th width="280">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code></td><td>string</td><td>Human-readable result of the call.</td></tr><tr><td><code>success</code></td><td>boolean</td><td>Whether the company was created; a refused call answers HTTP 400.</td></tr><tr><td><code>data.company_id</code></td><td>uuid</td><td>The created company. Use it wherever a <code>company_id</code> is expected (<a href="/tri-doc/liquidity-pool/buy-carbon-pool.md">Buy Carbon Pool</a>, <a href="/tri-doc/liquidity-pool/get-carbon-transactions.md">Get Carbon Transactions</a>, <a href="/tri-doc/liquidity-pool/get-employees.md">Get Employees</a>).</td></tr><tr><td><code>data.client_company_id</code></td><td>string</td><td>Company ID as entered by the client.</td></tr><tr><td><code>data.company_name</code> / <code>first_name</code> / <code>last_name</code> / <code>email</code> / <code>telephone</code></td><td>string</td><td>The stored values, as entered.</td></tr><tr><td><code>data.errors</code></td><td>array</td><td>400 only — every validation problem, one per entry.</td></tr><tr><td><code>operations_count</code></td><td>integer</td><td>Always <code>1</code>.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="201" %}
{% code fullWidth="false" %}

```json
{
    "message": "Company created successfully.",
    "success": true,
    "data": {
        "company_id": "96b3c062-e7da-4c3e-98d4-029de59c9dc7",
        "client_company_id": "119401",
        "company_name": "Triangle Digital",
        "first_name": "John",
        "last_name": "Smith",
        "email": "support@triangle.digital",
        "telephone": "+1 (555) 555-0199"
    },
    "operations_count": 1
}
```

{% endcode %}
{% endtab %}

{% tab title="400" %}
A field is missing or not valid, or the client is not a Business account; `data.errors` lists every problem. The validation texts are: `Company ID is required`; `Company ID already exists`; `Company Name already exists`; `Email is invalid`.

```json
{
    "message": "Company ID already exists. Company Name already exists",
    "success": false,
    "data": {
        "errors": [
            "Company ID already exists",
            "Company Name already exists"
        ]
    },
    "operations_count": 1
}
```

{% endtab %}
{% endtabs %}
