Initialize a project claim
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.
oauth2 project.writeAuthorizationBearer <token>Scope: project.write
project_id*stringThe project ID: the id that createProject (POST /projects) returns, which zitadel setup
also prints as project_id.
^[a-zA-Z0-9_-]+$The claim challenge, with the browser URL to open.
application/json- response
The claim challenge for a project.
claim_url*stringThe browser URL a developer opens to complete the claim. It embeds the
challenge_id, so the browser needs no project secret.
urichallenge_id*challenge-idThe unique identifier of this challenge, an opaque string with a ch_ prefix.
^ch_[a-zA-Z0-9_-]+$expires_at*stringThe time when the claim challenge expires.
date-timeimport { 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");{ "claim_url": "http://example.com", "challenge_id": "string", "expires_at": "2019-08-24T14:15:22Z"}Was this helpful?