Docs

Query projects

POST
/projects/query

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.

Authorization

oauth2 project.write
headerAuthorizationBearer <token>

Scope: project.write

Request Body

Request to query projects.

application/json
  1. body

Request to query projects.

limit?limit
Range1 <= value <= 100
Default20
page_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.

Response Body

The list of projects was returned successfully

application/json
  1. 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).

Example Request
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({});
Example Response
{  "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?