Developers

Errors

What ServFlo's error answers look like, every status code and code, and what to do about each.

When a call fails, ServFlo answers with an HTTP status and a JSON body that says what went wrong in words you can show to a person:

{
	"defined": false,
	"code": "PLAN_UPGRADE_REQUIRED",
	"status": 402,
	"message": "This needs the Pro plan or higher. Upgrade in Settings → Billing.",
	"data": {
		"feature": "equipment_tracking",
		"requiredPlan": "pro",
		"requiredAddon": null,
		"currentPlan": "grow"
	}
}
  • code is stable: branch on it, not on the message.
  • message is written for people. It often says what to do next.
  • data carries details for some codes (below). It may be missing.

Status codes

StatusCodeWhat it meansWhat to do
400BAD_REQUESTThe input is not valid: a missing field, a wrong format, a value out of range, or a rule the record breaks.Fix the input. For validation errors, data.issues lists each field.
401UNAUTHORIZEDNo credential, or the key is wrong, revoked or expired.Check the Authorization: Bearer sfk_… header. Make a new key if this one was revoked.
402PLAN_UPGRADE_REQUIREDThe business's plan doesn't include this (the API itself needs Pro).Upgrade, or add the add-on named in data.requiredAddon.
402PLAN_LIMIT_REACHEDA plan limit is used up: AI credits this month, texts past the monthly cap, or every office user seat is taken.Buy AI credits, wait for the month to reset, or add a seat in Settings → Billing.
402SUBSCRIPTION_REQUIREDThe ServFlo subscription has ended, so the business is read-only. Reads still work.The owner chooses a plan in Settings → Billing.
402PAYMENT_METHOD_REQUIREDThe business is on a free trial with no card, and this would cost money (texts, numbers, calls, campaigns…).The owner adds a card in Settings → Billing. Nothing is charged until the trial ends.
402BILLING_UNAVAILABLEServFlo can't check the plan right now, so anything that costs money is paused.Try again in a few minutes.
403FORBIDDENYour role, the key's permissions or its access level don't allow this, or a key can't do it at all.Read the message: it names the missing permission or scope. See Authentication.
404NOT_FOUNDNo such record in this business (or one your role can't see).Check the id and the business id in the path.
409CONFLICTThe record's state doesn't allow it (an invoice already paid, a duplicate), or an Idempotency-Key clash.Read the record again, then decide.
409APPROVAL_DECLINEDYou declined this call in ServFlo.Don't retry unless you change your mind.
409APPROVAL_EXPIREDThe approval request expired before it was approved or used.Call again without the approval header to ask again.
409APPROVAL_ALREADY_RUNThat approval was already used. An approval runs once.Read the record to see the result.
409CONFIRMATION_INVALIDThe approval header doesn't match this exact call (other inputs, endpoint, key or business).Repeat the call exactly as it was approved, or ask again.
413PAYLOAD_TOO_LARGEThe request body is over 40 MB.Send less, or upload files by URL.
428APPROVAL_REQUIREDThis action waits for a person's approval in ServFlo. Nothing was done yet.See Approvals.
429TOO_MANY_REQUESTSToo many calls in a minute.Slow down and retry. See Rate limits.
500INTERNAL_SERVER_ERRORSomething broke on our side. It is reported to us automatically.Retry later. Use an Idempotency-Key on writes so a retry is safe.
503SERVICE_UNAVAILABLEA part of ServFlo is briefly unavailable.Retry in a moment.

Validation errors

A 400 from input validation lists every problem in message (field: what's wrong; …) and in data.issues, with the path to each field:

{
	"code": "BAD_REQUEST",
	"status": 400,
	"message": "scheduledDate: Use a date as YYYY-MM-DD",
	"data": {
		"issues": [{ "path": ["scheduledDate"], "message": "Use a date as YYYY-MM-DD" }]
	}
}

Plan errors in detail

402 PLAN_UPGRADE_REQUIRED names what's needed in data:

FieldMeaning
featureThe feature the call needs, such as memberships or phone.
requiredPlanThe cheapest plan that has it (connect, grow, pro), or null for an add-on-only feature.
requiredAddonThe add-on that sells it (phone, ai_receptionist, service_reports…), or null.
currentPlanThe plan the business is on.

402 PLAN_LIMIT_REACHED has data.feature (ai_credits, sms, office_users…) and data.reason. 402 PAYMENT_METHOD_REQUIRED has data.kind (what would cost money) and data.action: "add_card".

Reads are not blocked by the plan: after a downgrade you can still read and export what you made. A few reads that are a paid feature themselves (Customer 360 lists, job costing, weather, capacity planning, payroll runs, ads and call reports) do need it.

Approval errors in detail

428 APPROVAL_REQUIRED carries what you need to finish the call in data:

FieldMeaning
statusAPPROVAL_PENDING.
approvalIdThe request's id.
tokenThe value to send back in the X-ServFlo-Approval header, sfc_….
summaryWhat the person is asked to approve, in words.
expiresAtWhen the request expires if nobody decides.
approvalUrlThe ServFlo page where the person approves it.
headerX-ServFlo-Approval.

See Approvals for the whole flow.

On this page