cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/assets' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"sku_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"category_code": "LAPTOP",
"brand_code": "APPLE",
"brand_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"description": "MacBook Pro 14\" M3",
"serial_number": "C02ZX1ABCDEF",
"condition": "NEW",
"renewal_date": "2027-01-15",
"person_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"office_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/assets"
payload = { "condition": "NEW" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({condition: 'NEW'})
};
fetch('https://apipub.firstbasehq.com/api/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"sku_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"brand_code": "APPLE_US",
"serial_number": "C02ZX1ABCDEF",
"condition": "NEW",
"deploy_status": "DEPLOYED",
"description": "MacBook Pro 14\" M3",
"renewal_date": "2027-01-15",
"person_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"office_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"created_at": "2024-01-15T10:30:00Z",
"apple_business": null
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Inventory
Create asset
Creates a new asset (inventory item) in the organization’s inventory. Identify the product either by sku_id (for known SKUs) or by category_code + description (for custom products). Assign the asset to a person (person_id) or an office (office_id).
POST
https://apipub.firstbasehq.com
/
api
/
v1
/
assets
cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/assets' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"sku_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"category_code": "LAPTOP",
"brand_code": "APPLE",
"brand_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"description": "MacBook Pro 14\" M3",
"serial_number": "C02ZX1ABCDEF",
"condition": "NEW",
"renewal_date": "2027-01-15",
"person_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"office_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/assets"
payload = { "condition": "NEW" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({condition: 'NEW'})
};
fetch('https://apipub.firstbasehq.com/api/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"sku_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"brand_code": "APPLE_US",
"serial_number": "C02ZX1ABCDEF",
"condition": "NEW",
"deploy_status": "DEPLOYED",
"description": "MacBook Pro 14\" M3",
"renewal_date": "2027-01-15",
"person_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"office_id": "ed92d1a0-a8ee-4768-bbcb-26dd4bfdf8a4",
"created_at": "2024-01-15T10:30:00Z",
"apple_business": null
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Authorizations
Body
application/json
Request to create an asset (inventory item)
Response
Asset created
Newly created inventory asset item response
Current lifecycle state of the item after creation (typically DEPLOYED when assigned to a person, AVAILABLE when assigned to an office)
Available options:
ARCHIVED, AVAILABLE, AWAITING_ARRIVAL, DEPLOYED, GIFTED, LOCKED, ON_HOLD, OUT_FOR_REPAIR, UNAVAILABLE, VOIDED Example:
"DEPLOYED"