err:user:bad_request:invalid_analytics_query_typeExample
What Happened?
You tried to run a query that modifies data or isn’t a SELECT! Analytics queries are read-only - you can only SELECT data, not modify it. Blocked query types:INSERT- Adding new dataUPDATE- Modifying existing dataDELETE- Removing dataDROP- Deleting tablesCREATE- Creating tablesALTER- Modifying table structureTRUNCATE- Clearing tables
How to Fix It
1. Use SELECT Instead
Analytics is for querying data, not modifying it:2. Query Your Data
The analytics endpoint is for analyzing your verification data:3. Use the Correct API for Data Modification
If you need to modify data, use the appropriate Unkey API endpoints:| What You Want | Use This API |
|---|---|
| Create a key | POST /v2/keys.createKey |
| Update a key | PATCH /v2/keys.updateKey |
| Delete a key | POST /v2/keys.deleteKey |
| Modify permissions | POST /v2/keys.addPermissions |
Why Read-Only?
Analytics queries are read-only for several reasons:- Data integrity - Verification history should never be modified
- Performance - Read-only queries can be heavily optimized
- Security - Prevents accidental or malicious data corruption
- Audit trail - Preserves accurate historical records
Analytics is for understanding your data, not changing it. Use the main Unkey
API for creating, updating, or deleting resources.

