Docs

Initialize a project claim

POST
/projects/{project_id}/claim/init

Starts a claim, which attaches a project created before sign-in to a team, and returns the claim_url to open in a browser.

A claim attaches a project to a team so that the team's members administer it. This operation mints a single-use, short-lived challenge for an unclaimed project. The developer opens claim_url, signs in and completes the claim in the browser; see completeProjectClaim (POST /projects/{project_id}/claim/complete). Poll getProjectClaimStatus (GET /projects/{project_id}/claim/status) with the returned challenge_id, as zitadel claim does. The response's expires_at carries the exact expiry.

Authenticate with the project secret that createProject (POST /projects) returns as project_secret.

A 409 means a team already claimed the project, and its details name that team. A 410 means the project's 14-day claim window has closed, which is final.

Authorization

oauth2 project.write
headerAuthorizationBearer <token>

Scope: project.write

Path Parameters

project_id*string

The project ID: the id that createProject (POST /projects) returns, which zitadel setup also prints as project_id.

Match^[a-zA-Z0-9_-]+$

Response Body

The claim challenge, with the browser URL to open.

application/json
  1. response

The claim challenge for a project.

claim_url*string

The browser URL a developer opens to complete the claim. It embeds the challenge_id, so the browser needs no project secret.

Formaturi
challenge_id*challenge-id

The unique identifier of this challenge, an opaque string with a ch_ prefix.

Match^ch_[a-zA-Z0-9_-]+$
expires_at*string

The time when the claim challenge expires.

Formatdate-time
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 projectClaim = await client.createProjectClaim("proj_01KWH1P4MYS7F0N9WD3P2E4YM5");
Example Response
{  "claim_url": "http://example.com",  "challenge_id": "string",  "expires_at": "2019-08-24T14:15:22Z"}

Was this helpful?