API Reference - Unsubscribed

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108055

← Back to API Reference | Getting Started

Unsubscribe List

Tracks email addresses that have opted out of receiving emails. Unsubscribed addresses are excluded from all outgoing system emails.

Model name in URL: unsubscribe_list — DB table: unsubscribe_list

The Unsubscribe Record Object

FieldTypeDescription
idintegerUnique record ID (primary key, read-only)
emailstringEmail address that has unsubscribed required on create
codetextSource of unsubscribe: admin, email, or api
typestringType of unsubscribe (e.g. unsubscribe)
datestringDate unsubscribed (format: YYYYMMDDHHmmss) — auto-set on create
definitiveinteger1 for permanent unsubscribe, 0 for standard
website_idintegerWebsite ID — auto-set on create

List Unsubscribe Records

GET /api/v2/unsubscribe_list/get
Copy
curl -X GET "https://www.yourdomain.com/api/v2/unsubscribe_list/get?limit=50" \
  -H "X-Api-Key: your-api-key-here"

Retrieve an Unsubscribe Record

GET /api/v2/unsubscribe_list/get/{id}
Copy
curl -X GET "https://www.yourdomain.com/api/v2/unsubscribe_list/get/18" \
  -H "X-Api-Key: your-api-key-here"

Create an Unsubscribe Record

POST /api/v2/unsubscribe_list/create

Adds an email address to the unsubscribe list. The date, code, and website_id fields are set automatically.

Copy
curl -X POST "https://www.yourdomain.com/api/v2/unsubscribe_list/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "email=optout@example.com" \
  -d "definitive=0"

Update an Unsubscribe Record

PUT /api/v2/unsubscribe_list/update
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/unsubscribe_list/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "id=18" \
  -d "definitive=1"

Delete an Unsubscribe Record

DELETE /api/v2/unsubscribe_list/delete

Removes an email from the unsubscribe list, re-enabling emails to that address.

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/unsubscribe_list/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "id=18"