REST endpoints for ads in ServFlo: 10 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.
Whether Google Ads and Meta are connected (and usable on this server), the ad accounts each sign-in can use, and the business's ad accounts with their sync state. Start here before connecting, choosing accounts or reading the return. Read-only.
SERVFLO_ADS on this server. One of fake, live, off.
platforms
array of object
platforms[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
platforms[].mode
enum
fake: demo accounts (tests); live: the real platform; unconfigured: this server has no app credentials for it; off: ads are switched off here. One of fake, live, unconfigured, off.
platforms[].connected
boolean
platforms[].status
string
platforms[].account
string or null
Who signed in at the platform.
platforms[].connectedAt
string (date-time) or null
platforms[].lastError
string or null
platforms[].available
array of object
The ad accounts this sign-in can use; choose with POST /ads/accounts/choose.
platforms[].available[].externalAccountId
string
platforms[].available[].name
string
platforms[].available[].currency
string
platforms[].available[].timeZone
string
platforms[].available[].chosen
boolean
ServFlo reads this account.
accounts
array of object
accounts[].id
string
accounts[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
accounts[].mode
enum
One of MANAGED, CONNECTED.
accounts[].externalAccountId
string
The platform's id: a Google Ads customer id (digits) or a Meta ad account id.
accounts[].loginCustomerId
string or null
accounts[].name
string
accounts[].currency
string
ISO 4217; spend is integer cents of it.
accounts[].timeZone
string
The ad account's time zone: spend days are in it.
accounts[].status
string
ACTIVE (synced hourly), DISCONNECTED (no longer read; history kept), and others.
Grants access: returns the platform's consent URL (Google: the adwords scope; Meta: ads_read, ads_management and the lead and Page permissions). The person signs in there; the platform then redirects to /integrations/ads/callback with code and state, finished with POST /ads/callback. 400 when this server has no credentials for the platform.
Permission
ads.spend (Owner, Admin)
Risk
sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP tool
adAccounts_connect (toolset ads)
Plan
Needs the Ads add-on.
Approval
Waits 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.
fake: demo accounts (tests); live: the real platform; unconfigured: this server has no app credentials for it; off: ads are switched off here. One of fake, live, unconfigured, off.
platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
POST /organizations/{organizationId}/ads/accounts/choose
Grants access: the platform's ad accounts ServFlo may read (ids from GET /ads/accounts → platforms[].available). The list replaces the previous one: an account left out stops syncing and keeps its history. Chosen accounts are synced now: campaigns imported and 90 days of spend. Spends nothing.
Permission
ads.spend (Owner, Admin)
Risk
sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP tool
adAccounts_chooseAccounts (toolset ads)
Plan
Needs the Ads add-on.
Approval
Waits 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.
SERVFLO_ADS on this server. One of fake, live, off.
platforms
array of object
platforms[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
platforms[].mode
enum
fake: demo accounts (tests); live: the real platform; unconfigured: this server has no app credentials for it; off: ads are switched off here. One of fake, live, unconfigured, off.
platforms[].connected
boolean
platforms[].status
string
platforms[].account
string or null
Who signed in at the platform.
platforms[].connectedAt
string (date-time) or null
platforms[].lastError
string or null
platforms[].available
array of object
The ad accounts this sign-in can use; choose with POST /ads/accounts/choose.
platforms[].available[].externalAccountId
string
platforms[].available[].name
string
platforms[].available[].currency
string
platforms[].available[].timeZone
string
platforms[].available[].chosen
boolean
ServFlo reads this account.
accounts
array of object
accounts[].id
string
accounts[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
accounts[].mode
enum
One of MANAGED, CONNECTED.
accounts[].externalAccountId
string
The platform's id: a Google Ads customer id (digits) or a Meta ad account id.
accounts[].loginCustomerId
string or null
accounts[].name
string
accounts[].currency
string
ISO 4217; spend is integer cents of it.
accounts[].timeZone
string
The ad account's time zone: spend days are in it.
accounts[].status
string
ACTIVE (synced hourly), DISCONNECTED (no longer read; history kept), and others.
POST /organizations/{organizationId}/ads/disconnect
Revokes access: revokes and forgets the platform's tokens and stops syncing its ad accounts. Campaigns, spend history and credited requests stay; connect again to resume. Campaigns keep running at the platform.
Permission
ads.spend (Owner, Admin)
Risk
sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP tool
adAccounts_disconnect (toolset ads)
Approval
Over MCP, this tool always waits for your approval in ServFlo. See Approvals.
SERVFLO_ADS on this server. One of fake, live, off.
platforms
array of object
platforms[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
platforms[].mode
enum
fake: demo accounts (tests); live: the real platform; unconfigured: this server has no app credentials for it; off: ads are switched off here. One of fake, live, unconfigured, off.
platforms[].connected
boolean
platforms[].status
string
platforms[].account
string or null
Who signed in at the platform.
platforms[].connectedAt
string (date-time) or null
platforms[].lastError
string or null
platforms[].available
array of object
The ad accounts this sign-in can use; choose with POST /ads/accounts/choose.
platforms[].available[].externalAccountId
string
platforms[].available[].name
string
platforms[].available[].currency
string
platforms[].available[].timeZone
string
platforms[].available[].chosen
boolean
ServFlo reads this account.
accounts
array of object
accounts[].id
string
accounts[].platform
enum
The ad platform: GOOGLE_ADS (Google Ads) or META (Facebook and Instagram). One of GOOGLE_ADS, META.
accounts[].mode
enum
One of MANAGED, CONNECTED.
accounts[].externalAccountId
string
The platform's id: a Google Ads customer id (digits) or a Meta ad account id.
accounts[].loginCustomerId
string or null
accounts[].name
string
accounts[].currency
string
ISO 4217; spend is integer cents of it.
accounts[].timeZone
string
The ad account's time zone: spend days are in it.
accounts[].status
string
ACTIVE (synced hourly), DISCONNECTED (no longer read; history kept), and others.
POST /organizations/{organizationId}/ads/accounts/{adAccountId}/tracking
Changes live ads: asks the platform to add ServFlo's UTM parameters (utm_source, utm_medium, utm_campaign) to every imported campaign's landing URLs, so requests from those ads are credited to their campaign. Google: set on each campaign (final URL suffix). Meta keeps URL parameters on each ad: manual lists what to paste in Ads Manager. Spends nothing; 409 when the account isn't connected.
Permission
ads.manage (Owner, Admin)
Risk
sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP tool
adAccounts_addTracking (toolset ads)
Plan
Needs the Ads add-on.
Approval
Over MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in ServFlo). See Approvals.
POST /organizations/{organizationId}/ads/accounts/{adAccountId}/sync
Reads the account's campaigns and recent spend from the platform now (it also happens every hour; a day's spend is final three days after it), then credits recent requests whose ad click the platform can name. Rate-limited; 409 when the account isn't connected.
Permission
ads.manage (Owner, Admin)
Risk
write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
The business's ad campaigns (imported from connected accounts), filtered by adAccountId, platform or status. For what they returned, call GET /ads/report. Read-only.
Per campaign, per platform and in total for a date range (default the last 30 days): spend, impressions, clicks, leads (requests credited to the campaign + calls on its tracking number), booked jobs, revenue (paid on those jobs' and quotes' invoices within windowDays of the lead, default 90), cost per lead and per job, and return on spend; with ServFlo's Ads fee beside it. Spend days are in each ad account's time zone; leads are counted on the business's days. Read-only.