Skip to the page

REST API

Links

Links: 11 endpoints of the REST API.

POST/links

Create a link

Creates a link on the environment’s shared domain (or on domain_id). Without path a random 7-character path is generated. In the live environment the creating user must have a verified email address. A destination URL that looks suspicious is saved and listed in warnings; one that is listed as dangerous is refused with 422 url_blocked.

Secret key scope (any of): links:write

Request body

FieldTypeDescription
domain_idstring

The domain to serve the link on. Omit for the environment’s shared domain ({slug}.becklinks.com, or {slug}-test.… in test).

pathstring

The short path, 1–64 characters of letters, digits, "-" and "_". Omit to get a generated 7-character path. A path of a deleted link stays reserved for 90 days.

namestring | null
deep_link_pathrequiredstring

The in-app route handed to the app, e.g. /product/123; / for the start screen.

dataobject

Custom JSON delivered to the app, at most 4 KB as stored; keys at most 64 characters.

campaignstring | null

Key of a campaign of this environment; the link inherits its UTM defaults.

utmobject | null

Overrides of the campaign’s UTM fields; a field left null is inherited.

redirectsobject | null

Per-platform destinations. ios and android take https or a custom app scheme, the rest https only; a missing destination uses the project defaults.

expires_atstring (date-time) | null

When the link stops working (ISO-8601 UTC); must be in the future.

allow_param_passthroughboolean

Pass query parameters added to the short URL on to the app payload (LNK-005).

tagsstring[]
metadataobject

Your own annotations; never sent to the app. At most 4 KB as stored.

Responses

201 The new link.

FieldTypeDescription
idrequiredstring
urlrequiredstring

The short URL: https://{host}/{path}.

qr_urlrequiredstring

Path of the QR code image of this link (PNG or SVG) on this API, e.g. /v1/links/{id}/qr.

domain_idrequiredstring
hostrequiredstring
pathrequiredstring
namerequiredstring | null
deep_link_pathrequiredstring
datarequiredobject
campaignrequiredobject | null
utmrequiredobject

The link’s own UTM values; null where the campaign’s value is inherited.

utm.sourcerequiredstring | null
utm.mediumrequiredstring | null
utm.contentrequiredstring | null
utm.termrequiredstring | null
utm.creativerequiredstring | null
effective_utmrequiredobject

What a click records: the link’s value, else the campaign’s.

effective_utm.sourcerequiredstring | null
effective_utm.mediumrequiredstring | null
effective_utm.contentrequiredstring | null
effective_utm.termrequiredstring | null
effective_utm.creativerequiredstring | null
redirectsrequiredobject
redirects.iosrequiredstring | null
redirects.androidrequiredstring | null
redirects.webrequiredstring | null
redirects.desktoprequiredstring | null
redirects.fallbackrequiredstring | null
statusrequired"active" | "disabled" | "expired" | "archived" | "blocked"
expires_atrequiredstring (date-time) | null
allow_param_passthroughrequiredboolean
tagsrequiredstring[]
metadatarequiredobject
versionrequiredinteger
created_byrequiredstring | null

The user who created the link; null for links made with an API or SDK key.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
deleted_atrequiredstring (date-time) | null

Set while the link is in the trash; it is purged 30 days later.

warningsrequiredobject[]
warnings[].coderequired"destination_suspicious"
warnings[].pointerrequiredstring

JSON Pointer to the field the warning is about.

warnings[].detailrequiredstring
warnings[].reasonsrequiredstring[]

Stable reason codes of the URL check.

Example

Bash
POST/links/bulk

Create links in bulk

Creates up to 1,000 links in one request (body up to 10 MiB). By default every valid link is created and each invalid one is reported in results (the response is always 200; check failed). With atomic: true either all links are created or none. Each item follows CreateLinkRequest. A destination URL that looks suspicious is saved and listed in warnings; one that is listed as dangerous is refused with 422 url_blocked.

Secret key scope (any of): links:write

Request body

FieldTypeDescription
linksrequiredobject[]

1 to 1000 objects shaped like CreateLinkRequest (the body may be up to 10 MiB).

atomicboolean

false (default): every valid link is created and each invalid one is reported in results. true: all links are created or none (the first problem answers 422 and nothing is saved).

Responses

200 The outcome of each link.

FieldTypeDescription
createdrequiredinteger
failedrequiredinteger
resultsrequiredobject[]

One entry per submitted link, in request order.

results[].indexrequiredinteger
results[].statusrequired"created" | "failed"
results[].linkrequiredobject | null
results[].errorrequiredobject | null

Example

Bash
POST/links/{link}/archive

Archive a link

Hides the link from the default list and stops it from redirecting. Its short path stays its own; restore it to use it again.

Secret key scope (any of): links:write

Parameters

FieldTypeDescription
link (path)requiredstring

The ID of the link.

Responses

200 The archived link.

FieldTypeDescription
idrequiredstring
urlrequiredstring

The short URL: https://{host}/{path}.

qr_urlrequiredstring

Path of the QR code image of this link (PNG or SVG) on this API, e.g. /v1/links/{id}/qr.

domain_idrequiredstring
hostrequiredstring
pathrequiredstring
namerequiredstring | null
deep_link_pathrequiredstring
datarequiredobject
campaignrequiredobject | null
utmrequiredobject

The link’s own UTM values; null where the campaign’s value is inherited.

utm.sourcerequiredstring | null
utm.mediumrequiredstring | null
utm.contentrequiredstring | null
utm.termrequiredstring | null
utm.creativerequiredstring | null
effective_utmrequiredobject

What a click records: the link’s value, else the campaign’s.

effective_utm.sourcerequiredstring | null
effective_utm.mediumrequiredstring | null
effective_utm.contentrequiredstring | null
effective_utm.termrequiredstring | null
effective_utm.creativerequiredstring | null
redirectsrequiredobject
redirects.iosrequiredstring | null
redirects.androidrequiredstring | null
redirects.webrequiredstring | null
redirects.desktoprequiredstring | null
redirects.fallbackrequiredstring | null
statusrequired"active" | "disabled" | "expired" | "archived" | "blocked"
expires_atrequiredstring (date-time) | null
allow_param_passthroughrequiredboolean
tagsrequiredstring[]
metadatarequiredobject
versionrequiredinteger
created_byrequiredstring | null

The user who created the link; null for links made with an API or SDK key.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
deleted_atrequiredstring (date-time) | null

Set while the link is in the trash; it is purged 30 days later.

warningsrequiredobject[]
warnings[].coderequired"destination_suspicious"
warnings[].pointerrequiredstring

JSON Pointer to the field the warning is about.

warnings[].detailrequiredstring
warnings[].reasonsrequiredstring[]

Stable reason codes of the URL check.

Example

Bash
POST/links/{link}/disable

Disable a link

Stops the link from redirecting (within a minute). Disabling a disabled link succeeds without change. Expired, archived and blocked links cannot be disabled (409).

Secret key scope (any of): links:write

Parameters

FieldTypeDescription
link (path)requiredstring

The ID of the link.

Responses

200 The disabled link.

FieldTypeDescription
idrequiredstring
urlrequiredstring

The short URL: https://{host}/{path}.

qr_urlrequiredstring

Path of the QR code image of this link (PNG or SVG) on this API, e.g. /v1/links/{id}/qr.

domain_idrequiredstring
hostrequiredstring
pathrequiredstring
namerequiredstring | null
deep_link_pathrequiredstring
datarequiredobject
campaignrequiredobject | null
utmrequiredobject

The link’s own UTM values; null where the campaign’s value is inherited.

utm.sourcerequiredstring | null
utm.mediumrequiredstring | null
utm.contentrequiredstring | null
utm.termrequiredstring | null
utm.creativerequiredstring | null
effective_utmrequiredobject

What a click records: the link’s value, else the campaign’s.

effective_utm.sourcerequiredstring | null
effective_utm.mediumrequiredstring | null
effective_utm.contentrequiredstring | null
effective_utm.termrequiredstring | null
effective_utm.creativerequiredstring | null
redirectsrequiredobject
redirects.iosrequiredstring | null
redirects.androidrequiredstring | null
redirects.webrequiredstring | null
redirects.desktoprequiredstring | null
redirects.fallbackrequiredstring | null
statusrequired"active" | "disabled" | "expired" | "archived" | "blocked"
expires_atrequiredstring (date-time) | null
allow_param_passthroughrequiredboolean
tagsrequiredstring[]
metadatarequiredobject
versionrequiredinteger
created_byrequiredstring | null

The user who created the link; null for links made with an API or SDK key.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
deleted_atrequiredstring (date-time) | null

Set while the link is in the trash; it is purged 30 days later.

warningsrequiredobject[]
warnings[].coderequired"destination_suspicious"
warnings[].pointerrequiredstring

JSON Pointer to the field the warning is about.

warnings[].detailrequiredstring
warnings[].reasonsrequiredstring[]

Stable reason codes of the URL check.

Example

Bash
POST/links/{link}/enable

Enable a link

Makes a disabled link redirect again. An expired link is revived by changing its expires_at, an archived one by restoring it (409 otherwise).

Secret key scope (any of): links:write

Parameters

FieldTypeDescription
link (path)requiredstring

The ID of the link.

Responses

200 The enabled link.

FieldTypeDescription
idrequiredstring
urlrequiredstring

The short URL: https://{host}/{path}.

qr_urlrequiredstring

Path of the QR code image of this link (PNG or SVG) on this API, e.g. /v1/links/{id}/qr.

domain_idrequiredstring
hostrequiredstring
pathrequiredstring
namerequiredstring | null
deep_link_pathrequiredstring
datarequiredobject
campaignrequiredobject | null
utmrequiredobject

The link’s own UTM values; null where the campaign’s value is inherited.

utm.sourcerequiredstring | null
utm.mediumrequiredstring | null
utm.contentrequiredstring | null
utm.termrequiredstring | null
utm.creativerequiredstring | null
effective_utmrequiredobject

What a click records: the link’s value, else the campaign’s.

effective_utm.sourcerequiredstring | null
effective_utm.mediumrequiredstring | null
effective_utm.contentrequiredstring | null
effective_utm.termrequiredstring | null
effective_utm.creativerequiredstring | null
redirectsrequiredobject
redirects.iosrequiredstring | null
redirects.androidrequiredstring | null
redirects.webrequiredstring | null
redirects.desktoprequiredstring | null
redirects.fallbackrequiredstring | null
statusrequired"active" | "disabled" | "expired" | "archived" | "blocked"
expires_atrequiredstring (date-time) | null
allow_param_passthroughrequiredboolean
tagsrequiredstring[]
metadatarequiredobject
versionrequiredinteger
created_byrequiredstring | null

The user who created the link; null for links made with an API or SDK key.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
deleted_atrequiredstring (date-time) | null

Set while the link is in the trash; it is purged 30 days later.

warningsrequiredobject[]
warnings[].coderequired"destination_suspicious"
warnings[].pointerrequiredstring

JSON Pointer to the field the warning is about.

warnings[].detailrequiredstring
warnings[].reasonsrequiredstring[]

Stable reason codes of the URL check.

Example

Bash
POST/links/{link}/restore

Restore a link

Brings an archived link back as active, or takes a deleted link out of the trash (within 30 days; it keeps the status it had, so restore an archived and deleted link twice).

Secret key scope (any of): links:write

Parameters

FieldTypeDescription
link (path)requiredstring

The ID of the link.

Responses

200 The restored link.

FieldTypeDescription
idrequiredstring
urlrequiredstring

The short URL: https://{host}/{path}.

qr_urlrequiredstring

Path of the QR code image of this link (PNG or SVG) on this API, e.g. /v1/links/{id}/qr.

domain_idrequiredstring
hostrequiredstring
pathrequiredstring
namerequiredstring | null
deep_link_pathrequiredstring
datarequiredobject
campaignrequiredobject | null
utmrequiredobject

The link’s own UTM values; null where the campaign’s value is inherited.

utm.sourcerequiredstring | null
utm.mediumrequiredstring | null
utm.contentrequiredstring | null
utm.termrequiredstring | null
utm.creativerequiredstring | null
effective_utmrequiredobject

What a click records: the link’s value, else the campaign’s.

effective_utm.sourcerequiredstring | null
effective_utm.mediumrequiredstring | null
effective_utm.contentrequiredstring | null
effective_utm.termrequiredstring | null
effective_utm.creativerequiredstring | null
redirectsrequiredobject
redirects.iosrequiredstring | null
redirects.androidrequiredstring | null
redirects.webrequiredstring | null
redirects.desktoprequiredstring | null
redirects.fallbackrequiredstring | null
statusrequired"active" | "disabled" | "expired" | "archived" | "blocked"
expires_atrequiredstring (date-time) | null
allow_param_passthroughrequiredboolean
tagsrequiredstring[]
metadatarequiredobject
versionrequiredinteger
created_byrequiredstring | null

The user who created the link; null for links made with an API or SDK key.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
deleted_atrequiredstring (date-time) | null

Set while the link is in the trash; it is purged 30 days later.

warningsrequiredobject[]
warnings[].coderequired"destination_suspicious"
warnings[].pointerrequiredstring

JSON Pointer to the field the warning is about.

warnings[].detailrequiredstring
warnings[].reasonsrequiredstring[]

Stable reason codes of the URL check.

Example

Bash