Files
Sentri-docs/API/v1/customers/companies/PUT Activate.md
2026-05-31 00:26:38 +02:00

62 lines
1.7 KiB
Markdown

# PUT Activate company
Companies are imported into Sentri from external systems. Before a company can be used within Sentri, it must be activated.
This API call activates a company by changing its status from inactive to active.
#### Location
```
/api/v1/customers/companies/activate/
```
#### Permissions required
`customers-companies` RW
#### Body parameters
| Parameter | Type | Required | Description |
| ------------- | ------ | -------- | ---------------------------------------------- |
| company_uuid | string | yes | Unique id of the company |
| company_state | enum | yes | The state of the company (active or imported). |
**imported** is the state of the company when its imported from the source.
### Example Body (json)
```json
{
"company_uuid": "e0a60eba-52f6-11f1-8bcc-bc2411125ba4",
"copmany_state": "active",
}
```
### Example Request
```php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $baseUrl . '/api/v1/customers/companies/activate/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $json_payload,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
'X-HTTP-Method-Override: PUT'
],
]);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($response === false) {
echo curl_error($curl);
}
curl_close($curl);
```
### Example Response
```json
"company state successfully updated"
```
#### Known errors or issues.
None are known at the time
If you do encounter issues and get an http code in return, check the response codes on this page.