err:unkey:data:environment_not_foundExample response
Likely causes
- The environment slug is wrong.
- The project or app slug is wrong. That’s also reported as a missing environment. On
deployments.createDeploymentthe message says so:The requested project, app, or environment does not exist. - Your root key can’t read the environment.
environments.getEnvironment,domains.createDomain, anddeployments.createDeploymentreturn this 404 instead of a 403. A key that can read the environment but lacks the action gets a 403err:unkey:authorization:insufficient_permissionsthat names the missing permission.
How to fix
- List the app’s environments with
environments.listEnvironmentsand use the returned slug. - Check all three parts: project, app, and environment.
- Check that the root key has the permission the endpoint needs on the environment.
Related errors
err:unkey:data:app_not_found: the app doesn’t exist.err:unkey:application:invalid_environment_settings: the environment exists but its settings block deployments.err:unkey:data:policy_not_found: a gateway policy within the environment doesn’t exist.