GDPR & consent
Programmatic GDPR tooling: request workspace data exports and keep an auditable consent trail per contact.


On this page
Quick example
Type-checked against @medalsocial/sdk v1.3.0 (2026-07-20). A release that changes a signature fails this page's build.
ts
import { Medal } from '@medalsocial/sdk';
const medal = new Medal(process.env.MEDAL_API_KEY as string);
// Kick off a workspace data export
const { data: request } = await medal.gdpr.requestExport();
console.log(request.request_id, request.status);
// Record consent for a contact
await medal.gdpr.recordConsent({
email: 'nora@solsticecoffee.no',
consent_type: 'marketing_email',
granted: true,
source: 'signup-form',
});
// Look up a contact's consent history
const { data: consents } = await medal.gdpr.getConsent('nora@solsticecoffee.no');
console.log(consents.length, 'consent records');medal.gdpr.requestExport()
Request a workspace data export. Runs asynchronously.
ts
requestExport(): Promise<ApiResponse<{ request_id: string; status: string; }>>Added in v1.0.0
medal.gdpr.listExports()
List all workspace export requests.
ts
listExports(): Promise<ApiResponse<GdprExport[]>>Added in v1.0.0
medal.gdpr.getExport()
Get the status of a specific export.
ts
getExport(id: string): Promise<ApiResponse<GdprExport>>Added in v1.0.0
medal.gdpr.recordConsent()
Record a GDPR consent decision for a contact by email.
ts
recordConsent(input: RecordConsentInput): Promise<ApiResponse<ConsentResult>>Added in v1.0.0
medal.gdpr.getConsent()
Get all consent records for a contact by email.
ts
getConsent(email: string): Promise<ApiResponse<ConsentRecord[]>>Added in v1.0.0