Companies
Manage companies in the system.
List Companies
Retrieve a list of all companies.
Endpoint: GET /public/v2/companies
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/companies" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/companies", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Get Company
Retrieve a specific company by ID.
Endpoint: GET /public/v2/companies/:id
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/companies/4" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/companies/4", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Create Company
Create a new company.
Endpoint: POST /public/v2/companies
- cURL
- JavaScript
curl -X POST "https://api.biosensei.io/public/v2/companies" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"code": "ACME"
}'
const response = await fetch("https://api.biosensei.io/public/v2/companies", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Acme Corp",
code: "ACME"
})
});
const data = await response.json();
console.log(data);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the company. |
code | string | Yes | A unique code for identification. |
Update Company
Update an existing company.
Endpoint: PUT /public/v2/companies/:id
- cURL
- JavaScript
curl -X PUT "https://api.biosensei.io/public/v2/companies/9" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp Updated",
"code": "ACME_UPDATED"
}'
const response = await fetch("https://api.biosensei.io/public/v2/companies/9", {
method: "PUT",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Acme Corp Updated",
code: "ACME_UPDATED"
})
});
const data = await response.json();
console.log(data);