Create auth link
Connections
Create auth link
Create a shareable OAuth link that connects an external account to your Markifact team.
POST
Create auth link
Creates an OAuth link for a user to connect an account. When the user completes the flow, Markifact stores the connection in your team workspace. By default, the resulting connection is shared with the workspace, so other team members can see and use it. SetDocumentation Index
Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
Use this file to discover all available pages before exploring further.
is_private to true if the connection should only be visible and usable by the user who created the API key.
Endpoint
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
connection_type | string | Yes | Supported connection type, such as ga4, gads, or meta_ads. |
redirect_url | string | No | HTTPS URL to redirect the user to after the OAuth callback. |
external_id | string | No | Your ID for the customer, store, workspace, or account. Max 255 characters. |
is_private | boolean | No | Whether the created connection should be private to the API-key user. Defaults to false, meaning shared with the workspace so other team members can see and use it. |
Best practices for external_id
external_id is how you tie a resulting connection back to a record in your own system. It is stored on the created connection and returned unchanged in both the connection responses and the redirect parameters.
- Use a stable, unique ID from your system — your customer, workspace, store, or account ID. Avoid values that change over time so lookups stay reliable.
- Keep it opaque. Don’t put PII or secrets in it (no emails, names, tokens). It is echoed back in the redirect URL query string, so it can land in browser history, referrer headers, and logs.
- Use it to look connections up later with
GET /v1/connections?external_id=...orGET /v1/connections/{external_id}?lookup_by=external_id, instead of storing Markifact connection IDs yourself. - Treat lookups as potentially returning multiple connections.
external_idis not unique — a customer may reconnect or connect more than one account, so a singleexternal_idcan map to several connections. - Set it at creation time. It can only be provided when the link is created; it is not editable afterwards.
Example Request
Response
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Auth link ID. Use this with the auth link status endpoint. |
url | string | URL to send the user to. |
expires_at | integer | Expiration timestamp in milliseconds. |
Auth links expire 24 hours after creation, or as soon as a connection is
successfully created — whichever comes first. Each link can be used to create
one connection; generate a new link if it expires or has already been used.
Redirect URL Parameters
If you provideredirect_url, Markifact redirects the user’s browser back to that URL after the OAuth provider returns to Markifact. The redirect URL must use HTTPS.
Markifact preserves any query parameters already on your URL and appends result metadata. Treat this browser redirect as a user-experience handoff, not as your only source of truth. For server-side confirmation, call the auth link status endpoint using the id returned when you created the link.
Success Redirect
When OAuth succeeds, Markifact stores the connection in your workspace, marks the auth link as connected, and redirects with:| Parameter | Description |
|---|---|
status | success when the connection was created. |
connection_type | The connection type originally requested, such as ga4 or gads. |
connection_id | The Markifact connection ID created by the completed OAuth flow. Use this with the connections API. |
external_id | Your optional external ID, returned unchanged when provided. |
Error Redirect
When OAuth fails, is denied by the user, or cannot be completed, Markifact redirects with:| Parameter | Description |
|---|---|
status | error when the connection was not created. |
connection_type | The connection type originally requested. |
external_id | Your optional external ID, returned unchanged when provided. |
error | A URL-encoded error message suitable for logging or showing a generic retry prompt. |
Existing Query Parameters
Existing query parameters on yourredirect_url are preserved. If your URL already contains one of Markifact’s parameter names, Markifact avoids overwriting it by adding a markifact_ prefix.
For example, if you create a link with:
markifact_status when present, otherwise read status.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
"ga4"
Example:
"https://example.com/oauth/callback"
Maximum string length:
255Example:
"customer_123"
Whether the created connection should be private to the API-key user. Defaults to false, meaning shared with the workspace so other team members can see and use it.

