Skip to main content
POST
Create an account link

Authorizations

Authorization
string
header
required

Bearer token authentication. Pass your API key as Authorization: Bearer sk_.... See Authentication for keys, scopes, and sandbox vs production.

Path Parameters

account_id
string
required

The account to act on. It must be one of your own accounts; any other ID returns 404 so the response never confirms that an unrelated account exists.

Body

application/json
type
enum<string>
required

What the account holder is being sent to do. onboarding: collect everything the account still owes for the first time. update: revisit information already collected, which requires the account to have requirements already and otherwise fails with 400 CONNECTED_ACCOUNT_REQUIREMENTS_NOT_FOUND.

Available options:
onboarding,
update
Example:

"onboarding"

refresh_url
string<uri>
required

Where the account holder is sent when the link is no longer usable, for example after it expired. Issue a fresh link from the page you point at, because the original URL cannot be revived.

Example:

"https://adastores.example/connect/refresh"

return_url
string<uri>
required

Where the account holder is sent when they finish or abandon the flow. Arriving here is not proof that onboarding completed, so confirm from the account.updated event rather than from the redirect.

Example:

"https://adastores.example/connect/return"

collection_options
object | null

Options carried through to the hosted flow and handed back unchanged when the link is opened. Omit it unless you were given specific keys to send.

Response

Account link created. url is returned only here and cannot be read back.

id
string

Unique identifier for the account link.

Example:

"alnk_3b7e12c9d4a05f68b1c2"

object
enum<string>

Always connected_account_link, so a mixed webhook or log stream can be routed on type.

Available options:
connected_account_link
Example:

"connected_account_link"

account
string

The account this link onboards.

Example:

"acct_3Wq8ZfT1yHnJ5sVe"

type
enum<string>

What the link was issued for, echoing the type you sent. onboarding: the account holder is walked through everything the account still owes, for the first time. update: the account holder revisits information already collected, which only works once the account has requirements and otherwise fails with 400 CONNECTED_ACCOUNT_REQUIREMENTS_NOT_FOUND.

Available options:
onboarding,
update
Example:

"onboarding"

created
string<date-time>

When the link was issued, ISO 8601 in UTC.

Example:

"2026-08-07T11:04:22.518Z"

expires_at
string<date-time>

When the link stops working, ISO 8601 in UTC. After this the account holder lands on your refresh_url instead. Read this value rather than assuming a fixed lifetime.

Example:

"2026-09-06T11:04:22.518Z"

url
string

Send the account holder here. The URL carries a single-use credential, so deliver it over a channel you trust and keep it out of logs and analytics. It is returned only on this response and cannot be read back.

Example:

"https://connect.bachs.io/setup/c/acct_3Wq8ZfT1yHnJ5sVe/al_kQ2v8nS1xJd0pR7mLtY4wZ6aHb3cFg9e"

true when issuing this link invalidated an outstanding active link of the same type for the account. Generating a link on every page render keeps invalidating the one you already sent, so create a link when you are about to redirect and not before.

Example:

false