DevelopersAPI reference

Materials API

REST endpoints for materials in ServFlo: 4 operations with parameters, request and response fields, permissions and curl examples.

Base URL: https://app.servflo.ai/api. Every call needs Authorization: Bearer sfk_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.

OperationEndpointRisk
List materialsGET /organizations/{organizationId}/materialsread
Create a materialPOST /organizations/{organizationId}/materialswrite
Update a materialPATCH /organizations/{organizationId}/materials/{materialId}write
Delete a materialDELETE /organizations/{organizationId}/materials/{materialId}sensitive

List materials

GET /organizations/{organizationId}/materials

Parts and supplies with unit, unit cost (cents) and stock. Seeded with five on first read. Read-only.

Permissioncatalog.read (Owner, Admin, Dispatcher, Technician, Member)
Riskread, OAuth scope servflo.read. Read: reads only.
MCP toolmaterials_list (toolset pricebook)

Example

curl "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/materials" \
  -H "Authorization: Bearer $SERVFLO_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
idstringMaterial id.
organizationIdstring
namestring
unitstring
unitCostCentsintegerThe unit PRICE billed (the original API's name), in integer cents.
inStocknumber
createdAtstring (date-time)
updatedAtstring (date-time)

Create a material

POST /organizations/{organizationId}/materials

Adds a material. A blank unit becomes "ea". Returns it.

Permissioncatalog.write (Owner, Admin)
Riskwrite, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolmaterials_create (toolset pricebook)

Request body

FieldTypeRequiredDescription
namestringYes
unitstringNoUp to 50 characters.
unitCostCentsintegerNoMoney in integer cents (12500 = 125.00). -100000000–100000000.
inStocknumberNo-1000000000–1000000000.

Example

curl -X POST "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/materials" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Dana Whitfield"}'

Response

201: the answer's fields
FieldTypeDescription
idstringMaterial id.
organizationIdstring
namestring
unitstring
unitCostCentsintegerThe unit PRICE billed (the original API's name), in integer cents.
inStocknumber
createdAtstring (date-time)
updatedAtstring (date-time)

Update a material

PATCH /organizations/{organizationId}/materials/{materialId}

Changes the fields sent. Material already recorded on jobs keeps its frozen cost. Returns it.

Permissioncatalog.write (Owner, Admin)
Riskwrite, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolmaterials_update (toolset pricebook)

Parameters

NameInTypeRequiredDescription
materialIdpathstringYes

Request body

FieldTypeRequiredDescription
namestringNo
unitstringNoUp to 50 characters.
unitCostCentsintegerNoMoney in integer cents (12500 = 125.00). -100000000–100000000.
inStocknumberNo-1000000000–1000000000.

Example

curl -X PATCH "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/materials/{materialId}" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Dana Whitfield","unit":"string","unitCostCents":12500}'

Response

200: the answer's fields
FieldTypeDescription
idstringMaterial id.
organizationIdstring
namestring
unitstring
unitCostCentsintegerThe unit PRICE billed (the original API's name), in integer cents.
inStocknumber
createdAtstring (date-time)
updatedAtstring (date-time)

Delete a material

DELETE /organizations/{organizationId}/materials/{materialId}

Destructive: deletes the material from the catalog; lines already recorded on jobs keep their description and cost.

Permissioncatalog.write (Owner, Admin)
Risksensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolmaterials_delete (toolset pricebook)
ApprovalOver MCP, this tool always waits for your approval in ServFlo. See Approvals.

Parameters

NameInTypeRequiredDescription
materialIdpathstringYes

Example

curl -X DELETE "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/materials/{materialId}" \
  -H "Authorization: Bearer $SERVFLO_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
oktrue

On this page