---
title: "Create Team"
method: POST
path: "/api/metrics/developer/teams/create"
tags: ["Developer Metrics - Teams"]
---

# Create Team

`POST /api/metrics/developer/teams/create`

Creates a new developer team. Teams can be organized around **developers** (by adding members), **repositories** (by assigning repos), or **both**. You can also create empty teams and add members/repos later via the update and member endpoints.

Use cases:
- **Developer-based team**: Pass `members` to group developers (e.g. a frontend squad). You can optionally pass `repositories` as a filter to scope metrics to specific repos for this team.
- **Repository-based team**: Pass only `repositories` to group repos (e.g. all microservices). No members - metrics are aggregated across the listed repos.
- **Mixed team**: Pass both `members` and `repositories` - metrics are scoped to these members across these repos.
- **Disabled lists**: Create special teams named `codeant-disabled-members` or `codeant-disabled-repos` to exclude specific developers or repositories from all metrics calculations across the organization.

Optionally assign one or more `team_leads` (by login) and categorize teams with `tags`. Teams can be nested using `parent_team_id`.

## Request body

- CreateTeamRequest
  - `platform` 'github' | 'gitlab' | 'bitbucket' | 'azure_devops' | 'azuredevops', required — Version control platform
  - `org` string, required — Organization, workspace, or group name on the platform
  - `github_base_url` string — Base URL for GitHub (use for GitHub Enterprise Server)
  - `gitlab_base_url` string — Base URL for GitLab (use for self-hosted GitLab instances)
  - `azure_devops_base_url` string — Base URL for Azure DevOps (use for Azure DevOps Server)
  - `bitbucket_base_url` string — Base URL for Bitbucket (use for Bitbucket Data Center/Server)
  - `name` string, required — Team name (min 2 characters)
  - `description` string — Team description
  - `color` string — Hex color code
  - `team_leads` string[]
  - `repositories` string[]
  - `members` object[] — Initial team members to add at creation. You can create a team with members, repositories, or both.
    - `user_login` string, required — Unique login or email of the developer
    - `user_name` string — Display name (defaults to user_login if omitted)
    - `role` 'member' | 'lead' — Role within the team
  - `tags` string[] — Tags for categorizing the team
  - `parent_team_id` string, uuid — Parent team ID for creating nested/sub-teams
  - `created_by` string — Identifier of who created the team

## Response `201`

Team created successfully

- object
  - `status` string
  - `message` string
  - `team` Team — A developer team with members, metadata, and repository assignments
    - `id` string, uuid — Unique team identifier
    - `name` string — Team name
    - `description` string — Team description
    - `color` string — Hex color for UI display
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `created_by` string
    - `team_leads` string[] — List of team lead identifiers
    - `members` TeamMember[]
      - `user_login` string — Unique login/email identifier of the member
      - `user_name` string — Display name of the member
      - `joined_at` string, date-time — When the member joined the team
      - `role` 'member' | 'lead' — Role within the team
    - `tags` string[]
    - `parent_team_id` string — Parent team ID for nested teams
    - `repositories` string[] — Assigned repository names
    - `is_active` boolean — Whether the team is active

## Other responses

- `400` — Bad request - missing or invalid parameters
- `401` — Unauthorized - missing, invalid, or insufficient access token
- `500` — Internal server error

---

[API](https://skmtc.dev/codeant/apis/codeant-ai-api.md) · [All operations](https://skmtc.dev/codeant/apis/codeant-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/codeant/codeant-ai-api/revisions/d1eb7c083a39/schema)
