DevelopersAPI referencePhone

Lines API

REST endpoints for lines 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
Everyone's linesGET /organizations/{organizationId}/linesread
My lineGET /organizations/{organizationId}/lines/meread
My mobilePATCH /organizations/{organizationId}/lines/mewrite
Choose a person's linePUT /organizations/{organizationId}/lines/{userId}sensitive

Everyone's lines

GET /organizations/{organizationId}/lines

Every team member's line: their own ServFlo number (OWN_NUMBER) or the business's (BUSINESS_NUMBER), and their mobile for calls. Read-only.

Permissionlines.manage (Owner, Admin)
Riskread, OAuth scope servflo.read. Read: reads only.
MCP toollines_list (toolset marketing)

Example

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

Response

200: the answer's fields
FieldTypeDescription
itemsarray of object
items[].userIdstring
items[].namestring or null
items[].emailstring or null
items[].roleKeystring or null
items[].modeenumOWN_NUMBER: their texts and calls go through number; BUSINESS_NUMBER: the business's numbers. One of OWN_NUMBER, BUSINESS_NUMBER.
items[].numberobject or null
items[].number.idstring
items[].number.e164string
items[].number.labelstring
items[].cellNumberstring or nullTheir mobile: rung for their line's calls when no app or browser answers.
items[].ringCellboolean
items[].emailAddressstring or nullTheir own ServFlo email address: Inbox emails they answer go out from it; mail to it lands on their line.

My line

GET /organizations/{organizationId}/lines/me

The signed-in person's line: their own number (texts and calls go out from it) or the business's, and their mobile. What the phone dock and the app show. Read-only.

Permission: phone.calls (Owner, Admin, Dispatcher, Technician (own jobs)); risk read (OAuth scope servflo.read).

Permissionphone.calls
Riskread, OAuth scope servflo.read. Read: reads only.
MCP toollines_mine (toolset marketing)

Example

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

Response

200: the answer's fields
FieldTypeDescription
userIdstring
namestring or null
emailstring or null
roleKeystring or null
modeenumOWN_NUMBER: their texts and calls go through number; BUSINESS_NUMBER: the business's numbers. One of OWN_NUMBER, BUSINESS_NUMBER.
numberobject or null
number.idstring
number.e164string
number.labelstring
cellNumberstring or nullTheir mobile: rung for their line's calls when no app or browser answers.
ringCellboolean
emailAddressstring or nullTheir own ServFlo email address: Inbox emails they answer go out from it; mail to it lands on their line.

My mobile

PATCH /organizations/{organizationId}/lines/me

The signed-in person's mobile and whether it rings for their line's calls (when no app or browser answers), also the phone rung first when they call out through their phone. Changes nothing the customer sees.

Permission: phone.calls (Owner, Admin, Dispatcher, Technician (own jobs)); risk write (OAuth scope servflo.write).

Permissionphone.calls
Riskwrite, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toollines_setMine (toolset marketing)

Request body

FieldTypeRequiredDescription
cellNumberstring or nullNoTheir mobile with area code; null or empty removes it. Up to 32 characters.
ringCellbooleanNo

Example

curl -X PATCH "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/lines/me" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cellNumber":"string","ringCell":true}'

Response

200: the answer's fields
FieldTypeDescription
userIdstring
namestring or null
emailstring or null
roleKeystring or null
modeenumOWN_NUMBER: their texts and calls go through number; BUSINESS_NUMBER: the business's numbers. One of OWN_NUMBER, BUSINESS_NUMBER.
numberobject or null
number.idstring
number.e164string
number.labelstring
cellNumberstring or nullTheir mobile: rung for their line's calls when no app or browser answers.
ringCellboolean
emailAddressstring or nullTheir own ServFlo email address: Inbox emails they answer go out from it; mail to it lands on their line.

Choose a person's line

PUT /organizations/{organizationId}/lines/{userId}

MONEY when buyE164 is given: buys that number (one GET /phone/numbers/available offered) as the person's own line, billed monthly as phone usage. OWN_NUMBER: their texts and calls go through their own number (bought now, or phoneNumberId, a business number that isn't anyone's); calls to it ring only them and texts to it are theirs. BUSINESS_NUMBER: they use the business's numbers; a number that was theirs stays on the business, unassigned. A sole-proprietor texting registration allows one number, so it refuses own numbers.

Permissionlines.manage (Owner, Admin)
Risksensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toollines_set (toolset marketing)
PlanNeeds the Phone system add-on.
ApprovalWaits for your approval in ServFlo when called with an API key or a connected app: the first call answers 428 APPROVAL_REQUIRED; once you approve it, repeat the call with the X-ServFlo-Approval header. See Approvals.

Parameters

NameInTypeRequiredDescription
userIdpathstringYesThe team member (Base316 user id).

Request body

FieldTypeRequiredDescription
modeenumYesOne of OWN_NUMBER, BUSINESS_NUMBER.
buyE164string or nullNoOWN_NUMBER: a number to buy for them (from GET /phone/numbers/available). Up to 32 characters.
phoneNumberIdstring or nullNoOWN_NUMBER: a business number that isn't anyone's, to make theirs.
cellNumberstring or nullNoTheir mobile with area code; null or empty removes it. Up to 32 characters.
ringCellbooleanNo
emailNamestringNoThe part of their ServFlo email address before the business (jane in jane.bright-air@mail.servflo.ai); must be free. Up to 30 characters.

Example

curl -X PUT "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/lines/{userId}" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"OWN_NUMBER"}'

Response

200: the answer's fields
FieldTypeDescription
userIdstring
namestring or null
emailstring or null
roleKeystring or null
modeenumOWN_NUMBER: their texts and calls go through number; BUSINESS_NUMBER: the business's numbers. One of OWN_NUMBER, BUSINESS_NUMBER.
numberobject or null
number.idstring
number.e164string
number.labelstring
cellNumberstring or nullTheir mobile: rung for their line's calls when no app or browser answers.
ringCellboolean
emailAddressstring or nullTheir own ServFlo email address: Inbox emails they answer go out from it; mail to it lands on their line.

On this page