consents

Create a consent event

Changed on

Email consent only.

post/consent-events

Request

  • Base URL
    https://api.pscrpt.com/v1
  • URL
    https://api.pscrpt.com/v1/consent-events
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://api.pscrpt.com/oauth/authorize
      Token URL: https://api.pscrpt.com/oauth/token scopes: consent:write

Headers

Idempotency-Keystring

Deduplicates retries for 24 hours: the same key returns the original response with Idempotency-Replayed: true; the same key with a different body returns 409 idempotency_key_reused.

Postscript-Versionstring date
Example:2026-07-23

Overrides the key's pinned API revision for this request.

Request body

action'subscribe' | 'unsubscribe' | 'mark_pending' | 'expire' required
channel'email' required
occurred_atstring date-time
profile_idstring
source_referencestring nullable

Your own label for the write, returned on the event and the consent.

Example request

{
  "evidence": {
    "lawful_basis": "express_written_consent",
    "method": "checkout"
  },
  "occurred_at": "2026-07-23T17:32:01.123456Z"
}

Response

The consent already had this status; returns the stored event.

Example response

{
  "data": {
    "channel": "sms",
    "consent": {
      "channel": "sms",
      "consented_at": "2026-07-23T17:32:01.123456Z",
      "identifier": {
        "created_at": "2026-07-23T17:32:01.123456Z",
        "type": "email",
        "updated_at": "2026-07-23T17:32:01.123456Z",
        "verified_at": "2026-07-23T17:32:01.123456Z"
      },
      "method": "checkout",
      "updated_at": "2026-07-23T17:32:01.123456Z"
    },
    "created_at": "2026-07-23T17:32:01.123456Z",
    "evidence": {
      "lawful_basis": "express_written_consent",
      "method": "checkout"
    },
    "occurred_at": "2026-07-23T17:32:01.123456Z"
  }
}

Changes

    • breaking

      request property ///// was restricted to a list of enum values

    • breaking

      added subschema #2 to the / response property oneOf list for the response status

    • breaking

      added subschema #2 to the / response property oneOf list for the response status

    • breaking

      the / response's property type changed from string to no type, and format from date-time to no format for status

    • breaking

      the / response's property type changed from string to no type, and format from date-time to no format for status

    • warning

      the ///// request property's maxLength was set to 255

    • warning

      removed the request property /////

    • info

      added the new email enum value to the request property /////

    • info

      removed the pattern ^[a-z][a-z0-9_.]*$ from the request property /////

    • info

      endpoint added