Skip to content
DocsSDKGDPR & consent

GDPR & consent

Updated Jul 2026·1 min

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

The account settings page of a Medal Social workspace.The account settings page of a Medal Social workspace.

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

medal.gdpr.cookieConsent()

Record cookie consent from an external site (legacy endpoint).

ts
cookieConsent(input: CookieConsentInput): Promise<{ success: boolean; logId?: string; }>
Added in v1.0.0