Customers
The people and organizations you work for. Everything else hangs off a customer: a site belongs to one, and an estimate is written for the customer who owns the site it prices.
get
https://treeinventory.ai/api/v1/customersList customers
Oldest first, by creation. Use search to find one by name. That is the usual first call when you are working from a name on a spreadsheet.
Scope: customers:read
Query parameters
| Field | Type | Notes |
|---|---|---|
| cursor | string | Opaque. Take it from a previous response's nextCursor and send it back unchanged. Do not parse it; its contents are not part of this contract. |
| limit | integer | Page size. Defaults to 50, clamped to 200 rather than refused. |
| search | string | Case-insensitive substring of the customer name. |
Each item in data.items
| Field | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| string or null | ||
| phone | string or null | |
| createdAt | string | ISO-8601, UTC. |
| updatedAt | string | ISO-8601, UTC. |
Example response 200
{
"success": true,
"message": "Customers retrieved",
"data": {
"items": [
{
"id": "9f1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"name": "Delap Road Properties",
"email": "office@delaproad.example",
"phone": "(812) 555-0134",
"createdAt": "2026-08-19T14:02:11.412Z",
"updatedAt": "2026-08-19T14:02:11.412Z"
}
],
"nextCursor": "eyJ2IjoidjEiLCJjcmVhdGVkQXQiOiIyMDI2LTA4LTE5IDE0OjAyOjExLjQxMjMzMSswMCIsImlkIjoiOWYxYjJjM2QtNGU1Zi00YTZiLThjN2QtMGUxZjJhM2I0YzVkIn0"
}
}Failures
401Missing, malformed, revoked or expired credential. TheWWW-Authenticateheader names the scheme, which isApiKey.403The key is valid but does not carry the scope this operation requires. The message names the scope, so you can ask for exactly the grant you need.404No such record in your organization. A record belonging to somebody else is indistinguishable from one that does not exist.422Validation failed. Every bad field is named, at once.429Rate limit exceeded.500Something failed on our side. Retry with the SAME Idempotency-Key; a 5xx is the one status where retrying is correct.
post
https://treeinventory.ai/api/v1/customersCreate a customer
Send an Idempotency-Key. Without one, a retry after a timeout creates a second customer and somebody has to merge them by hand.
Scope: customers:write
Headers
| Field | Type | Notes |
|---|---|---|
| Idempotency-Key | uuid | A UUID you mint per logical action and REUSE on every retry of it. Replay returns the original response and creates nothing. Omit it and a retry creates a second record. |
Request body
| Field | Type | Notes |
|---|---|---|
| namerequired | string | |
| email or null | ||
| phone | string or null |
Example request
{
"name": "Delap Road Properties",
"email": "office@delaproad.example",
"phone": "(812) 555-0134"
}data
| Field | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| string or null | ||
| phone | string or null | |
| createdAt | string | ISO-8601, UTC. |
| updatedAt | string | ISO-8601, UTC. |
Example response 201
{
"success": true,
"message": "Customer created",
"data": {
"id": "9f1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"name": "Delap Road Properties",
"email": "office@delaproad.example",
"phone": "(812) 555-0134",
"createdAt": "2026-08-19T14:02:11.412Z",
"updatedAt": "2026-08-19T14:02:11.412Z"
}
}Failures
401Missing, malformed, revoked or expired credential. TheWWW-Authenticateheader names the scheme, which isApiKey.403The key is valid but does not carry the scope this operation requires. The message names the scope, so you can ask for exactly the grant you need.404No such record in your organization. A record belonging to somebody else is indistinguishable from one that does not exist.409Idempotency conflict: thisIdempotency-Keywas used with a different body (idempotency_key_reused), or an identical request is still in flight (command_in_progress, withRetry-After).422Validation failed. Every bad field is named, at once.429Rate limit exceeded.500Something failed on our side. Retry with the SAME Idempotency-Key; a 5xx is the one status where retrying is correct.