Why does this setting block bulk schedule export?

Why does this setting prevent the WFM API from exporting schedules for agents with PII fields?

“Enabling strict PII masking requires explicit consent tokens for all export operations involving agent personal data.”

The POST to /api/v2/wfm/schedules/export returns a 403 Forbidden when the mask_pii flag is true in the request body, even though the service account has the wfm:export permission. Need to know if there is a specific token header missing or if this is a bug in the current WFM SDK version.

If I remember correctly…

This is a common hurdle when moving from Zendesk’s flexible export permissions to Genesys Cloud’s stricter data governance. In Zendesk, we often exported tickets with agent details without extra steps, but GC requires explicit consent handling for PII. The 403 error isn’t about the wfm:export permission alone; it’s about the missing consent token in the header. You need to include the X-Consent-Token header with a valid value generated from the admin console. Here is how the request should look:

POST /api/v2/wfm/schedules/export
Headers:
 Authorization: Bearer <token>
 X-Consent-Token: <valid-consent-id>
Body:
 {
 "mask_pii": true,
 "schedule_ids": ["id1", "id2"]
 }

Without this header, the API blocks the export regardless of role permissions.

I typically get around this by checking the consent token configuration in the admin portal, as the api documentation is unclear on specific header requirements for bulk exports.