Consent 3rd party API
Let an external system register or withdraw a member's consent in Subrite through the consents API, using an M2M token and the integration ID of the consent.
ArticleView as Markdown
Step 1: Create a consent#
Create a consent with 3rd party integration and collect the Integration Id from the UI.

Step 2: Create an M2M token#
Create an M2M token granting Consent permissions. You will receive the token once you click save.

Step 3: Call the API#
- Method:
POST - Route:
{baseUrl}/api/v1/consents/{integrationId} - Authorization: Bearer token (use the M2M token from step 2)
- Body: see the examples below
Example body 1#
{
"email": "test1@subrite.no",
"status": "accepted"
}Example body 2#
{
"email": "test2@subrite.no",
"status": "withdrawn"
}Example body 3 (with reference)#
{
"email": "test3@subrite.no",
"status": "accepted",
"reference": "external-reference"
}Request body fields#
| Field | Required | Description |
|---|---|---|
email | Yes | Email address of the subscriber |
status | Yes | Consent status: accepted or withdrawn |
reference | No | Custom reference string for tracking purposes, for example an external system ID, campaign reference, URL or any custom identifier |