> ## Documentation Index
> Fetch the complete documentation index at: https://developers.projectcor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Team

> Creates a new team in your COR instance with external ID mapping

Creates a new team in your COR instance through the integrations service. Validates team name, ID, workspace ID, and metadata before creating.

## Request Body Requirements

<ParamField body="metadata" type="object" required>
  <Expandable title="properties">
    <ParamField body="source" type="string" required>
      Integration source identifier
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="id" type="string" required>
  External team ID from your source system
</ParamField>

<ParamField body="name" type="string" required>
  Team name
</ParamField>

<ParamField body="workspace_id" type="string">
  External workspace ID that the team belongs to
</ParamField>

<ParamField body="description" type="string">
  Team description
</ParamField>

## Known Errors

* `ValidationError` — Missing required fields
* `ZC004` — Association already exists (team with this external ID already exists)

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://integrations.projectcor.com/v2/integrations/teams' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "{{external_team_id}}",
    "name": "Team test",
    "description": "description",
    "workspace_id": "{{workspace-external-id}}",
    "metadata": {
      "source": "GLOBANT"
    }
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://integrations.projectcor.com/v2/integrations/teams"

  payload = {
      "id": "{{external_team_id}}",
      "name": "Team test",
      "description": "description",
      "workspace_id": "{{workspace-external-id}}",
      "metadata": {
          "source": "GLOBANT"
      }
  }

  headers = {
      "Authorization": "Bearer YOUR_ACCESS_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://integrations.projectcor.com/v2/integrations/teams',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        id: '{{external_team_id}}',
        name: 'Team test',
        description: 'description',
        workspace_id: '{{workspace-external-id}}',
        metadata: {
          source: 'GLOBANT'
        }
      })
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": 5001,
    "name": "Team test",
    "description": "description",
    "workspace_id": 1234,
    "company_id": 1234,
    "created_at": "2025-01-10T14:30:00Z",
    "updated_at": "2025-01-10T14:30:00Z"
  }
  ```

  ```json 400 theme={null}
  {
    "status": "ERROR",
    "code": "ZC004",
    "message": "Association already exists"
  }
  ```
</ResponseExample>
