Subscribe or unsubscribe a profile’s email
Records the change (source `manual` in the dashboard, `api` with an API key) on the person’s email address and writes it back to every store that knows them. Answers the latest email change; when the person already has this state nothing new is recorded. 409 `no_email` when the profile has no email address. Pass `proof` when the person gave or withdrew consent themselves (e.g. on your own form).
Records the change (source manual in the dashboard, api with an API key) on the person’s email address and writes it back to every store that knows them. Answers the latest email change; when the person already has this state nothing new is recorded. 409 no_email when the profile has no email address. Pass proof when the person gave or withdrew consent themselves (e.g. on your own form).
apiKey writeAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
id*stringuuididempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
1 <= length <= 255application/json- body
state*string"subscribed""unsubscribed"occurredAt?stringWhen the person changed it; defaults to now. Not in the future.
date-timeproof?OK
application/json- response
id*stringuuidchannel*string"email""sms"state*string"subscribed""not_subscribed""unsubscribed""pending"source*string"shopify""unsubscribe_link""one_click""import""api""manual"store*|nulladdress*string|nullproof*by*string|nulloccurredAt*stringdate-timerecordedAt*stringdate-timewriteBacks*array<>curl -X PUT 'https://api.postforge.dev/v1/profiles/497f6eca-6276-4993-bfeb-53cbbbba6f08/consent/email' \ -H 'Content-Type: application/json' \ -d '{ "state": "subscribed"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "channel": "email", "state": "subscribed", "source": "shopify", "store": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "address": "string", "proof": { "ip": "string", "userAgent": "string", "userId": "string", "apiKeyId": "string", "reference": "string" }, "by": "string", "occurredAt": "2019-08-24T14:15:22Z", "recordedAt": "2019-08-24T14:15:22Z", "writeBacks": [ { "store": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "status": "pending", "skipReason": "already_current", "error": "string", "doneAt": "2019-08-24T14:15:22Z" } ]}