Skip to main content
err:unkey:data:key_space_not_found
A gateway key auth policy you’re saving points at a that doesn’t exist in your workspace. You get HTTP 404, and detail names the first missing keyspace.
Example response

Likely causes

  • You passed the API ID (api_...) instead of the keyspace ID (ks_...). They’re different values on the same API.
  • The API behind the keyspace was deleted. Deleting an API from the dashboard also deletes its keyspace, so a policy that used to work can start failing.
  • The keyspace is in another workspace.

How to fix

  1. Use the keyspace ID shown on the API in the dashboard, or returned by apis.getApi.
  2. Fix every keyspace ID in the policy. gateway.setPolicies and gateway.updatePolicy stop at the first missing one, so several bad IDs show up one at a time.
Last modified on October 6, 2026