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

# チームを作成

> チームを作成します。必要に応じて、メンバー、直接割り当てるプロジェクト、プロジェクトタグのセレクター、リポジトリURLの部分文字列のセレクターも設定できます。`user_management.change_content_access`権限が必要です。



## OpenAPI

````yaml /ja/api-reference/openapi.json post /teams
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
  - url: https://eu.corgea.app/api/v1
    description: EU本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /teams:
    post:
      tags:
        - チーム
      summary: チームを作成
      description: >-
        チームを作成します。必要に応じて、メンバー、直接割り当てるプロジェクト、プロジェクトタグのセレクター、リポジトリURLの部分文字列のセレクターも設定できます。`user_management.change_content_access`権限が必要です。
      operationId: createTeam
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTeamRequest'
      responses:
        '201':
          description: チームを正常に作成しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: 一部のユーザーまたはプロジェクトが見つかりません
        '409':
          description: 同じ名前のチームがすでに存在します
components:
  schemas:
    CreateTeamRequest:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
        member_ids:
          type: array
          items:
            type: integer
        project_ids:
          type: array
          description: 直接割り当てるプロジェクトのIDです。
          items:
            type: integer
        project_tags:
          type: array
          description: 一致するプロジェクトへのアクセス権を動的に付与するタグです。
          items:
            type: string
        repo_url_patterns:
          type: array
          description: 一致するプロジェクトへのアクセス権を動的に付与するリポジトリURLの部分文字列です。
          items:
            type: string
            minLength: 3
      example:
        name: Payments Team
        member_ids:
          - 12
          - 34
        project_ids:
          - 101
        project_tags:
          - payments
          - backend
        repo_url_patterns:
          - github.com/acme/payments-
    TeamResponse:
      type: object
      required:
        - team
      properties:
        team:
          $ref: '#/components/schemas/Team'
    Team:
      type: object
      required:
        - id
        - name
        - active
        - members
        - project_ids
        - project_tags
        - repo_url_patterns
        - project_count
        - created_at
        - updated_at
      properties:
        id:
          type: integer
        name:
          type: string
        active:
          type: boolean
        members:
          type: array
          items:
            $ref: '#/components/schemas/TeamMember'
        project_ids:
          type: array
          description: チームに直接割り当てられたプロジェクトです。
          items:
            type: integer
        project_tags:
          type: array
          description: 指定したタグのいずれかを持つプロジェクトが一致します。
          items:
            type: string
        repo_url_patterns:
          type: array
          description: リポジトリURLに指定した文字列のいずれかを含むプロジェクトが一致します（大文字と小文字を区別しません）。
          items:
            type: string
            minLength: 3
        project_count:
          type: integer
          description: 直接割り当てまたはセレクターによって現在対象となっているプロジェクトの数（重複を除く）です。
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    TeamMember:
      type: object
      required:
        - id
        - email
        - first_name
        - last_name
      properties:
        id:
          type: integer
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
  responses:
    BadRequest:
      description: リクエストが無効です
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Invalid JSON body
    Unauthorized:
      description: トークンが無効か、指定されていません
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
    Forbidden:
      description: 権限がないか、機能を利用できません
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Permission denied
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー 無効なユーザーのAPIトークンは拒否されます。
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.