Docs

Create a team

POST
/teams

Creates a team in the project, with a name no other team in the project has.

A team groups users inside a project and can represent a customer. A taken name is refused with 409 team.already_exists: choose another name. The new team has no members yet.

Authorization

headerAuthorizationBearer <token>

Scope: team.write

Query Parameters

project_id*string

The project ID: the id that createProject (POST /projects) returns. zitadel setup prints it as "Project id" in its summary and as project_id with --json, and writes it to .env.local as ZITADEL_PROJECT_ID.

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

Request Body

application/json
  1. body
name*string

The name of the team. Must be unique within the project, ignoring case.

Length1 <= length <= 200

Response Body

The created team.

application/json
  1. response

Details of a team.

id*string

The unique identifier of the team.

name*string

The name of the team.

status*team-status

The lifecycle state of a team.

  • active: the team is available for use.
  • deactivated: the team is no longer active but is retained for historical and audit purposes.
Value in"active""deactivated"
created_at*string

The time when the team was created.

Formatdate-time
updated_at*string

The time when the team was last updated.

Formatdate-time
Example Request
import { createZitadelApi } from "@zitadel/api/client";import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const session = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));// A write the session cookie authenticates carries the session's CSRF token.const { csrf_token } = await session.getMySessionCsrfToken();const api = createZitadelApi(  session.client.with({    fetch: (input, init) => {      const headers = new Headers(init?.headers);      headers.set("X-Zitadel-CSRF", csrf_token);      return fetch(input, { ...init, headers });    },  }),);const team = await api.createTeam({ name: "string" }, { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" });
Example Response
{  "id": "string",  "name": "string",  "status": "active",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}

Was this helpful?