Skip to main content
POST
/
companies
/
v2
/
rs
Create a company
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/companies/v2/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Session-Token: <x-session-token>' \
  --data '
{
  "name": "Company Name",
  "type": 1,
  "email": "[email protected]",
  "comment": "Company comment",
  "location": "Company address",
  "phones": [
    "phone1",
    "phone2"
  ],
  "establishmentIds": [
    1
  ],
  "technicalInstallationIds": [
    1
  ],
  "labelIds": [
    1
  ]
}
'
{
  "id": 1,
  "name": "Company Name",
  "type": 1,
  "location": "Company address",
  "comment": "Company comment",
  "organizationId": 1,
  "archivedAt": "2024-12-10T10:00:00.000Z",
  "updatedAt": "2024-12-05T14:56:23.000Z",
  "createdAt": "2024-01-15T08:45:00.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Session-Token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Content-Type
enum<string>
required

Content type, must be "application/json".

Available options:
application/json

Body

application/json
name
string
required

Name of the company.

Maximum string length: 250
Example:

"Company Name"

type
enum<number>
required

Type of company (verification, work...).

Available options:
1,
2,
3
Example:

1

email
string<email>
required

Email of the company contact.

Maximum string length: 250
comment
string | null

Comment on the company.

Maximum string length: 2500
Example:

"Company comment"

location
string | null

Company address.

Maximum string length: 250
Example:

"Company address"

phones
string[]

Phones of the company contact.

Required array length: 1 - 5 elements
Maximum string length: 50
Example:
["phone1", "phone2"]
establishmentIds
integer[]
Minimum array length: 1

Unique identifier of the establishment.

technicalInstallationIds
integer[]
Minimum array length: 1

Unique identifier of the technical installation.

labelIds
integer[]
Maximum array length: 20

Unique identifier of the label.

Response

201 - application/json

Company created successfully

id
integer
required

Unique identifier of the company.

Example:

1

name
string
required

Name of the company.

Maximum string length: 250
Example:

"Company Name"

type
enum<number>
required

Type of company (verification, work...).

Available options:
1,
2,
3
Example:

1

location
string | null
required

Company address.

Maximum string length: 250
Example:

"Company address"

comment
string | null
required

Comment on the company.

Maximum string length: 2500
Example:

"Company comment"

organizationId
integer
required

Identifier of the associated organization.

Example:

1

archivedAt
required

Date when the rule was archived.

Example:

"2024-12-10T10:00:00.000Z"

updatedAt
required

Date of the last update of the company.

Example:

"2024-12-05T14:56:23.000Z"

createdAt
required

Date of company creation.

Example:

"2024-01-15T08:45:00.000Z"