Query projects
Returns the project the project secret belongs to, as a page of at most one project.
A credential is scoped to one project until ADR 036 widens it, so the filters
and sorting apply to that project alone. The projects a signed-in person can
act on are listed by GET /users/me/projects.
oauth2 project.writeAuthorizationBearer <token>Scope: project.write
Request to query projects.
application/json- body
Request to query projects.
limit?limit1 <= value <= 10020page_token?|Token to retrieve the next page of results. Must be sent with the same
sorting as the request that issued the token. Omitting sorting reuses
the default sort and only succeeds when that default matches the token.
sorting?filter?array<>Filter criteria for querying projects.
The list of projects was returned successfully
application/json- response
Paginated list of projects.
projects*array<>next_page_token?|Token to pass as page_token in the next request to fetch the following page.
Absent when there are no more results. The follow-up request must repeat the
same sorting that produced this token (omit only when both pages use the default).
import { createZitadelClient } from "@zitadel/api/client";const client = createZitadelClient({ baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080", token: process.env.ZITADEL_PROJECT_SECRET!, // server-side only});const projects = await client.queryProjects({});{ "projects": [ { "id": "string", "name": "string", "origins": [ { "pattern": "string", "kind": "primary" } ], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "password_hash": { "algorithm": "argon2i", "params": { "time": 0, "memory": 0, "threads": 0, "cost": 0, "rounds": 0, "hash": "sha1" } } } ], "next_page_token": "string"}Was this helpful?