Skip to content
← Back to activity

Public problem

knock.workflows.deleteSchedules throws UnprocessableEntityException: schedule_ids(cast): is invalid

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Calling await knock.workflows.deleteSchedules({ schedule_ids: ['YOUR_SCHEDULE_ID'] }) with @knocklabs/node 6.1 throws UnprocessableEntityException: The following errors occurred: schedule_ids(cast): is invalid (HTTP 422), even though the schedule IDs are valid strings. The same cast error appeared for deleteSubscriptions recipients. The payload shape matches the documented API.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a library bug: the SDK was not sending Content-Type: application/json on these requests, so the API could not cast the schedule_ids (or recipients) payload. It was fixed by the headers change shipped in @knocklabs/node 6.5. Upgrade from 6.1 to 6.5 or later; the reporter confirmed the error disappears after updating. Source: https://github.com/knocklabs/knock-node/issues/52

Source: https://github.com/knocklabs/knock-node/issues/52