Skip to content
Back

Attribute not found in schema on REST API query

  • 0
  • Databases
  • REST API
jseph
9 Jun, 2026, 22:16

I'm querying a appwrite collection via the REST API on appwrite cloud 1.9.5 (no SDK) via a cloudflare worker and keep getting:

TypeScript
{"message":"Invalid query: Attribute not found in schema: ","code":400,"type":"general_query_invalid","version":"1.9.5"}

This was my https request: https://fra.cloud.appwrite.io/v1/databases/<DB_ID>/collections/<COLLECTION_ID>/documents?queries[]={"method":"equal","column":"userId","values":["<USER_ID>"]}.

To my understanding, it is the correct format.

I can confirm that the attribute userId exists in the collection and userId is indexed. DB ID, Collection ID, and Project ID are all correct. JWT auth is working. Fetching ALL documents with no query works fine. With a query, there is a problem.

Why do I get the Attribute not found in schema error? How can I resolve this?

TL;DR
Issue: Getting "Attribute not found in schema" error when querying an Appwrite collection via REST API, despite attribute existing in the collection and being indexed. Solution: The issue may be due to encoding the query improperly in the fetch request. Try updating the fetch code to correctly encode the query string, ensuring proper formatting and encoding of the JSON object.
jseph
9 Jun, 2026, 22:16

Here was my code for the fetch

jseph
9 Jun, 2026, 22:17

const query = JSON.stringify({ method: "equal", column: "userId", values: [userId], });

const userProfileResponse = await fetch( ${env.APPWRITE_ENDPOINT}/databases/${env.DB_ID}/collections/${env.USER_PROFILE_ID}/documents?queries[]=${encodeURIComponent(query)}, { method: "GET", headers: { "X-Appwrite-Project": env.PROJECT_ID, "X-Appwrite-JWT": jwt, }, } );

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more