---
title: "Create a company"
method: POST
path: "/v1/locations/{locationId}/companies"
tags: ["Companies"]
---

# Create a company

`POST /v1/locations/{locationId}/companies`

## Request

- Base URL: `https://api.cliento.com`
- URL: `https://api.cliento.com/v1/locations/{locationId}/companies`
- Auth: HTTP bearer

Creates a company at the location. Send an `externalReference`, your own id for the company, to make the call safe to repeat. When a company at the location already has that reference, that company is returned unchanged with `200` and nothing is created. A company with an organisation number that another company at the location already has is normally refused with `duplicate`.

## Path parameters

- `locationId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- CompanyCreate
  - `address` Address
    - `city` string, nullable
    - `country` string, nullable: Free text; an ISO 3166-1 alpha-2 code is recommended.
    - `line1` string, nullable
    - `line2` string, nullable
    - `line3` string, nullable
    - `postCode` string, nullable
  - `department` string: A part of the company, when the location serves several of them.
  - `email` string
  - `externalReference` string: Your own id for it, at most 100 characters, such as its id in your system. It makes the create safe to repeat and lets you find it again. Compared exactly, letter case included.
  - `name` string, required
  - `notes` string: Staff-facing notes, at most 1000 characters.
  - `organisationNumber` string: The Swedish organisation number: ten digits with a valid check digit, with no hyphen.
  - `otherPhoneNumber` string
  - `phoneNumber` string: Phone number in E.164 format: a plus sign, the country code and the number, at most 15 digits.

## Response `200`

A company with this `externalReference` already existed.

- Company: Represents a business a location serves. Belongs to one location.
  - `address` Address
    - `city` string, nullable
    - `country` string, nullable: Free text; an ISO 3166-1 alpha-2 code is recommended.
    - `line1` string, nullable
    - `line2` string, nullable
    - `line3` string, nullable
    - `postCode` string, nullable
  - `createdAt` string, date-time
  - `department` string: A part of the company, when the location serves several of them.
  - `email` string
  - `externalReference` string: Your own id for it, as sent when it was created.
  - `id` string, required
  - `locationId` string, required
  - `name` string
  - `notes` string: Staff-facing notes, at most 1000 characters.
  - `organisationNumber` string: The Swedish organisation number: ten digits with a valid check digit, with no hyphen.
  - `otherPhoneNumber` string
  - `phoneNumber` string: Phone number, in E.164 format when it was set through this API.
  - `updatedAt` string, date-time

## Other responses

- `201`: The company was created.
- `default`: Any failure. See the Errors section.

---

[API](https://skmtc.dev/cliento/apis/cliento-api.md) · [All operations](https://skmtc.dev/cliento/apis/cliento-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cliento/apis/cliento-api/revisions/29ca811bc061?raw)
