> For the complete documentation index, see [llms.txt](https://doc.keepnetlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.keepnetlabs.com/api-reference/reseller/companies/onboard-new-customer.md).

# Create a company

As a Reseller you can create a new company (customer) via the API — this is the programmatic way to onboard a new customer. No Company ID is needed for creation; the new company is created under your Reseller account. Use a credential with Client Role = **Reseller**. After creation, use the returned company `resourceId` for license configuration, company groups, and scoped API calls (e.g. `X-KEEPNET-Company-Id`).

***

## POST /api/companies

Creates a new company. The request uses **multipart/form-data**. Required form fields include: `Name`, `CountryResourceId`, `DateFormat`, `IndustryResourceId`, `LicensePeriodTypeResourceId`, `LicenseTypeResourceId`, `NumberOfUsers`, `TimeFormat`, `TimeZoneId`. Optional: `Description`, `Address`, `WebsiteUrl`, `LicenseModuleResourceIdArray`, `LicenseStartDate`, `LicenseEndDate`, `CompanyGroupResourceIdArray`, and others. Reference IDs (country, industry, license type, etc.) are platform-specific — use valid values from your environment or see Endpoints → **Company** for the full schema.

> **Test it:** Endpoints → **Company** → **Creates a new company**. Use dummy data (H8d): e.g. name `"Acme Corp"`, placeholder resource IDs for country, industry, license type, etc.

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/companies" method="post" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

Example (conceptual — actual request is multipart/form-data): **Name** `Acme Corp`, **NumberOfUsers** `100`, and valid **CountryResourceId**, **IndustryResourceId**, **LicenseTypeResourceId**, **LicensePeriodTypeResourceId**, **DateFormat**, **TimeFormat**, **TimeZoneId** from your platform. Response includes the new company's `resourceId` — use it as Company ID in subsequent API calls and in the optional steps below.

***

## PUT /api/companies/{resourceId}

> Update the new company's details or license (type, user limit, expiry). Replace `{resourceId}` with the company ID from the create response.

[keepnet-api-spec.json](https://github.com/ucarozan/keepnet-docs/blob/main/openapi/keepnet-api-spec.json)

***

## PUT /api/company-groups/{resourceId}/participants

Optional. Add the new company to a group. Replace the first `{resourceId}` with the **group** ID; send in the body the list of company resource IDs (including the new company). See [List and manage company groups →](/api-reference/reseller/companies/list-and-manage-company-groups.md).

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/{resourceId}/participants" method="put" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## Common errors

* **403 Forbidden** — Credential is not Reseller. Set Client Role = **Reseller** in **Company → Company Settings → REST API**. [Roles and permissions →](/next-generation-product/platform/company/system-users/user-roles.md)
* **401 Unauthorized** — Missing or invalid token. Request a new token via `POST /connect/token`.
* **400 Bad Request** — Invalid or missing required form fields. Check Endpoints → **Company** for the full request schema (multipart/form-data).

**Related:** [Scope API requests to a customer →](/api-reference/reseller/companies/scope-api-requests-to-customer.md). [List companies with license details →](/api-reference/reseller/companies/list-companies-with-license-details.md) to see the new company after creation.

{% hint style="info" %}
**Platform UI:** Create companies and manage REST API credentials in **Company → Company Settings → REST API**. [REST API Settings →](/next-generation-product/platform/company/company-settings/rest-api.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.keepnetlabs.com/api-reference/reseller/companies/onboard-new-customer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
