Skip to main content
Bring your own keys (BYOK) connects your org’s provider account to Deepline. Your provider bills calls that use this connection. Deepline compute or other usage charges can still apply. Managed access uses Deepline credentials and billing when the action supports this mode.

Connection contract

Each connection belongs to one org. Only org owners and admins can connect integrations. The provider’s current connection form defines the required fields and supported authentication method. See Connect integrations. For supported credential-form providers, POST /api/v2/integrations/connect accepts provider and credentials. A representative Icypeas request body is:
The endpoint also retains the api_key compatibility input for applicable single-key providers. OAuth and specialized integrations use their own connection procedures. This payload does not connect every OAuth provider.

Managed and BYOK eligibility

Each action defines its supported billing modes and price. A connected provider does not imply that every action supports both modes. Inspect the live tool contract and the provider rate cards for the operation you use. Provider environment variables in an operator’s server configuration are not a hosted customer connection method. Setting a provider key in your local shell does not send it through the hosted CLI. Store org credentials using the connection flow, not in Play source or tool input.

Who bills the work

A failed BYOK request does not imply a silent switch to managed access. Inspect the action contract before changing modes. Deepline exposes its customer charges; your provider invoice remains a separate source for BYOK costs. A connection establishes access. Your team still owns data-use permissions, retention policy, and which results may reach a destination. See Connect an integration for setup and Cost control for scoped usage and accepted-result economics.

Meta audiences

Connect Meta with a system user token from your own Meta Business portfolio. Use the Deepline connection form for the token; keep it out of chat, email, tickets, and source control. A Deepline owner or admin manages the connection.

Required access

You need:
  • Admin access to the Meta Business portfolio that owns the ad account. Open Business settings and check that you can see Users → System users.
  • The ad account you want Deepline to create audiences in. It must belong to, or be shared with, that Business portfolio. Its ID appears in Ads Manager next to the account name.
  • A Deepline org admin to paste the token.
1

Create a Business app

Open Create an app in Meta for Developers. If Meta shows “There’s a new way to create apps with Meta”, select Create app to continue.
  1. App details. Enter an app name such as Deepline Audiences and a contact email your team reads. Select Next. App details step with the app name and contact email
  2. Use cases. Check Create & manage ads with Marketing API, then select Next. This use case is what makes ads_management and ads_read available to the token in step 4. Use cases step with Create & manage ads with Marketing API selected
  3. Business. Select the Business portfolio that owns your ad account, then select Next. Business step with the Business portfolio selected
  4. Requirements and Overview. Check the overview and select Create app. Meta may ask for your password. Overview step showing the app name, use case and business
Already have an app in this portfolio with a Marketing API use case? You can reuse it and skip this step.
2

Add a system user

In Business settings, open Users → System users and select Add. If you manage more than one Business portfolio, Meta first asks you to pick one: choose the portfolio that owns your ad account. Name the system user Deepline, keep the role Employee, and select Create system user.Create system user dialog with the Employee roleAdd stays greyed out until an app belongs to the portfolio, and Meta shows “In order to add a system user, an app must be part of this business portfolio”. Create the app first; the Employee role provides the required asset access.
3

Give the system user the ad account and the app

Select the new system user, then Assign assets.
  • Ad accounts: select your ad account and turn on Manage campaigns (ads) under Partial access. Meta turns on View performance and Manage Creative Hub mockups with it. Ad account permissions with Manage campaigns (ads) turned on
  • Apps: select the app from step 1 and turn on Develop app. Meta turns on View insights and Test app with it. App permissions with Develop app turned on
Select Assign assets. The system user should now list both:System user with the ad account and app assigned
4

Generate the token

On the system user, select Generate token.
  1. Select app: pick the app from step 1, then Next. Generate token dialog with the app selected
  2. Set expiration: choose Never, then Next. Meta preselects “60 days (Recommended)”. Deepline stores the token as permanent, so a 60-day token stops working without warning when it expires. Token expiration set to Never
  3. Assign permissions: type ads_ in the search box and check ads_read and ads_management. Leave everything else unchecked. Deepline does not use business_management, pages_manage_ads, or any other permission. ads_read and ads_management checked
  4. Select Generate token, then copy the token. Meta shows it only once. Store it only in Deepline; don’t paste it into chat, email or tickets.
You can’t change a token’s permissions after you generate it. To change them, generate a new token and paste it into Deepline again.
5

Accept the Custom Audience terms

Meta rejects customer-list audiences until a person in your business accepts its Custom Audience terms for that ad account. Open this link with your ad account ID and select Accept:https://business.facebook.com/ads/manage/customaudiences/tos/?act=<ad account ID>When they’re accepted, the page says “You have accepted these terms of service on behalf of” your business:Custom Audience terms page showing the terms are acceptedRepeat for each ad account you connect. Creating one audience by hand in Ads Manager’s Audiences page also shows the terms prompt.
6

Paste the token into Deepline

In Deepline, open Integrations, find Meta audiences under Ad Platform, and select Connect.Meta audiences in the Deepline integrations listPaste the token into System user token and select Connect with token.Deepline's Meta Audiences setup page with the system user token field

What Deepline checks when you connect

When you select Connect with token, Deepline:
  1. lists every ad account the token can reach;
  2. confirms it can read Custom Audiences in at least one account, starting with the default. If none can, it saves nothing and keeps any existing connection;
  3. checks whether the Custom Audience terms are accepted for each account, and lists any account still missing them with an Accept terms link;
  4. saves the token. It is stored encrypted and never returned by the API.
If there is exactly one ad account, Deepline enables it and makes it the default. With more than one, enable the accounts Deepline may use, star a default, and select Save. Tool calls that omit ad_account_id use the default.Agents can read each account’s terms state from GET /api/v2/integrations/meta_audiences/accounts, called with an org admin’s session or an API key owned by an org admin. The customAudienceTermsAccepted field is true, false, or null when Meta didn’t report it. The endpoint returns the state from the last discovery; Refresh (or POST to the same endpoint) discovers again.

Rotate or revoke the token

  • Rotate: generate a new token for the same system user (step 4) and paste it on the same Deepline page. Your enabled accounts and default carry over where the accounts still match.
  • Revoke: in System users, select the system user and Revoke tokens. Meta rejects the token immediately, and Deepline reports the error on its next Meta call. Disconnect it under Integrations too.
  • Add an ad account: assign it to the system user (step 3), accept its terms (step 5), then select Refresh on the Deepline Meta Audiences page. The existing token picks up newly assigned accounts.

Connection troubleshooting

For complete-list uploads, processing locks, and match status, see Build ad audiences.

External Postgres

Save the connection under Integrations → Postgres in the intended Deepline org, then choose Connect and Test. Supply either a postgres:// or postgresql:// URI, or the host, port, database, user, and password fields. An optional schema sets the session search path. Credentials are stored with the org; SQL tool calls cannot supply or override them.
The direct Supabase endpoint may require IPv6. Use the Session Pooler endpoint shown by your project:
  1. In Supabase, open Connect and select Session pooler.
  2. Copy the displayed PostgreSQL URI, including its actual host, port, and username. Do not construct the pooler host from the region.
  3. Replace the password placeholder with the URL-encoded database password.
  4. In Deepline, open Integrations → Postgres → Change credentials, select Connection string, paste the URI, then choose Connect and Test.
Illustrative shape:
Encode reserved password characters: @ becomes %40, and a backslash becomes %5C. The @ before the hostname is the URI separator; shell-style backslashes are not URI escaping. See Supabase Connect for the endpoint shown by your project.
  • Use a read-only database role when writes must be prohibited. The role’s privileges govern external SQL; mutations and DDL need no extra write flag.
  • The connection needs a public endpoint. Private, loopback, link-local, metadata, reserved, and other non-public targets are blocked; Deepline validates DNS answers and pins the approved public address.
  • Require TLS is enabled by default. It encrypts the connection without verifying the server certificate; switching it off disables encryption.
  • Keep credentials private and requests bounded. Use saved credentials, positional binds, rowLimit, and SQL LIMIT for the query you need.
Query an external Postgres database shows SQL examples and explains how this differs from Deepline’s Database.