Skip to main content
This flow lets you build a source configuration experience on top of the Platform API: create a source in draft, hand a secure link to a client or third party so they can fill in the connector credentials (without a Nekt account), and receive a webhook when they finish — then validate and finalize the source. It mirrors the in-app Share a setup link feature, end to end over the API.

Overview

Prerequisites

Step 1: Create a draft source with a callback webhook

Create the source with draft: true. Only connector_slug is required for a draft — you (or a third party) fill in the rest later. Optionally attach a callback_webhook: Nekt POSTs to it once the third party finishes filling in the configuration through the setup link. Use the optional custom header to authenticate the call on your side.

callback_webhook object

callback_webhook is write-only. Responses never echo it back; they expose a read-only boolean has_callback_webhook so you can confirm one is configured. To remove a configured webhook, send "callback_webhook": null on an update.
For security, the URL must use https and resolve to a public host. URLs pointing at localhost, loopback, private (RFC 1918), or link-local addresses are rejected.

Step 2: Create a setup token

Generate a time-limited token scoped to this draft source, then build the link as https://app.nekt.ai/scl/{token} and share it with the third party.
The full token is returned only on creation. When listing tokens it is redacted. To revoke a link, delete the token: DELETE /api/v1/sources/{source_slug}/setup-tokens/{id}/.

Step 3: The third party fills in the configuration

The recipient opens https://app.nekt.ai/scl/{token} and enters the connector credentials (or authenticates via OAuth for connectors that support it). No Nekt account is required, and the link is scoped strictly to this draft source. When they submit, Nekt POSTs to your callback_webhook (if configured):
Use config_completed to decide whether you can proceed to validation, or whether you need to send another setup link to collect the remaining fields.

Step 4: Validate the connector configuration

Start a validation for the draft source. This confirms the credentials work and discovers the available streams. The validation uses the configuration already saved on the draft (from the setup link), so you don’t need to send a request body.
You may optionally pass { "config": { ... } } to merge extra fields into the saved configuration before validating.
The response returns a validation id with status in_progress. Poll it until the status is success or failed:
To stream the validation logs (useful for surfacing progress or diagnosing failures):

Step 5: Finalize the source

Once validation succeeds, complete the source by setting draft: false along with the streams, output layer, and trigger. See Update Source for the full set of fields.
After finalizing, you can Trigger Source to start the first extraction.
Setup tokens stop working once the source leaves draft. Any unused link for this source is invalidated when you finalize it.

Customize the OAuth flow

For OAuth connectors (Facebook Ads, Google Analytics GA4, and similar), you can drive the entire setup over the API instead of sharing a setup link, with one exception: the OAuth consent step. The provider’s login and “Authorize” screen must be opened in a browser by a human once per connected account.
This is a requirement of the provider (Meta, Google, etc.), not of Nekt. The consent step cannot be made fully server-to-server. Everything else — creating the source, generating the authorization URL, exchanging the code for a token, saving it, and validating — runs through the API.
The authorization code must be exchanged through Nekt’s OAuth endpoints. The app’s client_id/client_secret and the registered redirect URIs belong to Nekt, so you cannot exchange the code for a token on your own — the exchange has to go through Nekt’s callback. The steps below use Facebook Ads as the example. For GA4, swap tap-facebook-ads for tap-google-analytics-ga4.
1

Create a draft source

Authenticate with your API key. Create the source with draft: true and the connector slug.
2

Open the consent screen in a browser

A human opens the initiate URL, which redirects to the provider’s login and authorize screen. Pass your own return URL as redirect_uri.
3

Capture the return

After the user authorizes, the provider redirects to your redirect_uri with ?code=...&state=.... Store both values.
4

Exchange the code for a token

Call the callback endpoint with the code, state, and the same redirect_uri from step 2. This call uses a user token, not your API key.
The response returns the access_token, refresh_token, and related fields.
5

Save the token on the source

Authenticate with your API key. Patch the draft source with the refresh_token from the previous step.
Nekt injects the client_id/client_secret at runtime, so you don’t need to send them.
6

Validate

Start a validation, then poll it until the status is success (see Step 4 above).
7

Finalize the source

Patch the source with draft: false plus the streams, output layer, and trigger (see Step 5 above). You can then Trigger Source to start the first extraction.
The exact endpoints and request/response shapes are available in the OpenAPI schema at api.nekt.ai/api/schema/.