Skip to main content
PATCH
/
companies
/
v2
/
rs
/
{companyId}
Update a company
curl --request PATCH \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/companies/v2/rs/{companyId} \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "name": "Company Name",
  "type": 1,
  "location": "Company address",
  "comment": "Company comment",
  "email": "example@email.com",
  "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
string
required

Content type, must be "application/json".

Allowed value: "application/json"

Path Parameters

companyId
integer
required

Unique identifier of the company.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1

Body

application/json
name
string

Name of the company.

Maximum string length: 250
Example:

"Company Name"

type
enum<number>

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

Available options:
1,
2,
3
Example:

1

location
string | null

Company address.

Maximum string length: 250
Example:

"Company address"

comment
string | null

Comment on the company.

Maximum string length: 2500
Example:

"Company comment"

email
string<email> | null

Email of the company contact.

Maximum string length: 250
Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:

"example@email.com"

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.

Required range: -9007199254740991 <= x <= 9007199254740991
technicalInstallationIds
integer[]
Minimum array length: 1

Unique identifier of the technical installation.

Required range: -9007199254740991 <= x <= 9007199254740991
labelIds
integer[]
Maximum array length: 20

Unique identifier of the label.

Required range: -9007199254740991 <= x <= 9007199254740991

Response

200 - application/json

Company updated successfully

id
integer
required

Unique identifier of the company.

Required range: -9007199254740991 <= x <= 9007199254740991
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.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1

archivedAt
required

Date when the rule was archived.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

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

updatedAt
required

Date of the last update of the company.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

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

createdAt
required

Date of company creation.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

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