Skip to main content
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. Set is_private to true if the connection should only be visible and usable by the user who created the API key.

Endpoint

Request Body

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=... or GET /v1/connections/{external_id}?lookup_by=external_id, instead of storing Markifact connection IDs yourself.
  • Treat lookups as potentially returning multiple connections. external_id is not unique — a customer may reconnect or connect more than one account, so a single external_id can 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

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 provide redirect_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:
Example final redirect:

Error Redirect

When OAuth fails, is denied by the user, or cannot be completed, Markifact redirects with:
Error redirects do not consume the auth link. The user can retry the same link until it expires.

Existing Query Parameters

Existing query parameters on your redirect_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:
a successful redirect would look like:
Your redirect handler should read markifact_status when present, otherwise read status.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
connection_type
string
required
Example:

"ga4"

redirect_url
string<uri>
Example:

"https://example.com/oauth/callback"

external_id
string
Maximum string length: 255
Example:

"customer_123"

is_private
boolean
default:false

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.

Response

Auth link created.

id
string
required
url
string<uri>
required
expires_at
integer<int64>
required