Skip to content

Public routes: Email links

The links in PurrCRM’s own emails: clicks, opens, unsubscribing and the preference centre. PurrCRM writes these; you do not call them.

What it doesRoute
Follow a link in an emailGET /public/v1/email/c/{token}
Count a click the app openedPOST /public/v1/email/c/{token}
Read an email’s unsubscribe pageGET /public/v1/email/lists/{token}
An email’s open pixelGET /public/v1/email/o/{token}
Open the unsubscribe linkGET /public/v1/email/unsubscribe/{token}
Unsubscribe in one clickPOST /public/v1/email/unsubscribe/{token}
Read the preference centreGET /public/v1/preferences/{token}
Save the preference centrePOST /public/v1/preferences/{token}

GET /public/v1/email/c/{token}

Counts the click and redirects to the link the email’s own version holds.

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
302noneA redirect

POST /public/v1/email/c/{token}

The same click, when the app opened the email’s link itself.

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
204noneDone, with nothing to say

GET /public/v1/email/lists/{token}

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
200objectOK
404problemNot found, or the part is switched off.
429problemToo many requests: wait for Retry-After.

GET /public/v1/email/o/{token}

Always a 1×1 GIF; the first fetch counts the open.

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
200image/gifOK

GET /public/v1/email/unsubscribe/{token}

Redirects to the unsubscribe page, which asks first.

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
302noneA redirect

POST /public/v1/email/unsubscribe/{token}

The one-click unsubscribe (RFC 8058) a mail app posts, and the unsubscribe page’s confirm: the person leaves that email’s topic by email.

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.
sourcequery

Answers

StatusBodyMeaning
200objectOK
303noneA redirect
404problemNot found, or the part is switched off.
429problemToo many requests: wait for Retry-After.

GET /public/v1/preferences/{token}

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Answers

StatusBodyMeaning
200PublicPreferencesOK
404problemNot found, or the part is switched off.
429problemToo many requests: wait for Retry-After.

POST /public/v1/preferences/{token}

Takes JSON, or the page’s plain form (which is then redirected back to the page).

Needs: nothing: no credential.

Parameters

NameInDescription
token (required)pathThe signed token from the email’s link.

Body (application/json): PreferencesBody

FieldTypeDescription
all_offboolean
choicesarray of PreferenceChoice
wordingstring

Answers

StatusBodyMeaning
200PublicPreferencesOK
303noneA redirect
404problemNot found, or the part is switched off.
429problemToo many requests: wait for Retry-After.