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

# Update team

> Renames a team or transfers its ownership to one of its members. Only the team owner or the organization owner can update it.



## OpenAPI

````yaml /assets/cloud-assets/meilisearch-cloud-openapi-mintlify.json patch /api/v2/teams/{id}
openapi: 3.0.1
info:
  title: Meilisearch Cloud API V2
  version: v2
  contact:
    name: Meilisearch support
    email: support@meilisearch.com
  description: >-
    Manages Meilisearch Cloud organizations, teams and projects. Request and
    response fields are camelCase.


    ## Authentication


    Send `Authorization: Bearer <token>` with a Personal Access Token or an
    OAuth2 access token. OAuth2 tokens need the `read` scope for GET requests
    and `write` for every other method. See
    [Authentication](https://www.meilisearch.com/docs/reference/management-api/authentication).


    ## Pagination


    List endpoints take `offset` and `limit` and return `{ results, offset,
    limit, total }`.


    ## Errors


    Every non-2xx response has the `Error` body. Read its `code` field to know
    the exact error. Each operation documents the statuses it can answer. Every
    endpoint can also answer:


    - `400` `invalid_id`: an id in the path or the query is not an integer.

    - `400` `invalid_body`: the body is not valid JSON.

    - `400` `unknown_field`: the body has a field the endpoint does not accept.

    - `400` `invalid_offset`, `invalid_limit`: invalid pagination parameter on a
    list endpoint.

    - `401` `missing_authorization_header`, `invalid_token`: no token, or an
    invalid, expired or revoked one.

    - `403` `forbidden`: the OAuth2 token does not have the scope the method
    needs.

    - `429` `rate_limited`: over 30 requests per minute per token. Retry after
    the number of seconds in the `Retry-After` header.

    - `500` `internal`: unexpected error.
servers:
  - url: https://api.meilisearch.com
security:
  - personal_access_token: []
  - oauth2:
      - read
      - write
tags:
  - name: Authentication
    description: Identity of the token owner.
  - name: Organizations
    description: Organizations hold teams and billing.
  - name: Teams
    description: Teams hold projects and members.
  - name: Projects
    description: Meilisearch instances.
  - name: Cost monitoring
    description: Usage and estimated cost of projects.
  - name: Regions
    description: Regions where a project can be created.
  - name: Resources
    description: Machine sizes and their plans, to create a project or change its plan.
  - name: Meilisearch Versions
    description: Meilisearch versions a project can run.
paths:
  /api/v2/teams/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: integer
          minimum: 0
        description: Id of the team.
        required: true
    patch:
      tags:
        - Teams
      summary: Update team
      description: >-
        Renames a team or transfers its ownership to one of its members. Only
        the team owner or the organization owner can update it.
      operationId: updateTeam
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New name of the team.
                  example: Search team
                ownerId:
                  type: string
                  format: uuid
                  example: 7d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a
                  description: >-
                    `id` of the new owner, as returned by the members list. Must
                    already be a member of the team.
      responses:
        '200':
          description: Team updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Team'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                invalid_body:
                  value:
                    message: The request body is not valid JSON.
                    code: invalid_body
                    type: invalid_request
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#invalid_body
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                invalid_token:
                  value:
                    message: The provided token is invalid.
                    code: invalid_token
                    type: auth
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#invalid_token
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                forbidden:
                  value:
                    message: You are not allowed to perform this action.
                    code: forbidden
                    type: invalid_request
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#forbidden
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                team_not_found:
                  value:
                    message: Team not found.
                    code: team_not_found
                    type: invalid_request
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#team_not_found
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              examples:
                team_user_is_not_member:
                  value:
                    message: The user must already be a member of the team.
                    code: team_user_is_not_member
                    type: invalid_request
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#team_user_is_not_member
                    details:
                      - field: ownerId
                        code: invalid
                        message: The user must already be a member of the team.
                validation_failed:
                  value:
                    message: The request contains invalid values.
                    code: validation_failed
                    type: invalid_request
                    link: >-
                      https://www.meilisearch.com/docs/reference/management-api-errors#validation_failed
                    details:
                      - field: name
                        code: invalid
                        message: The request contains invalid values.
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - personal_access_token: []
        - oauth2:
            - write
      x-codeSamples:
        - lang: cURL
          label: HTTP request
          source: |-
            curl \
              -X PATCH 'https://api.meilisearch.com/api/v2/teams/12' \
              -H 'Authorization: Bearer MANAGEMENT_API_TOKEN' \
              -H 'Content-Type: application/json' \
              --data-binary '{
                "name": "Search team"
              }'
        - lang: cURL
          label: Meili CLI
          source: meili team update --id 12 --name 'Search team'
components:
  schemas:
    Team:
      type: object
      properties:
        id:
          type: integer
          description: Id of the team.
          example: 34
        name:
          type: string
          description: Name of the team.
          example: Search team
        organizationId:
          type: integer
          description: Id of the organization of the team.
          example: 12
        ownerId:
          type: string
          format: uuid
          description: '`id` of the user who owns the team.'
          example: 3f1c8a2e-5b7d-4e9a-9c1f-2a6b8d4e0f13
        isAdmin:
          type: boolean
          example: true
          description: >-
            Whether the authenticated user owns the team or its organization,
            and can manage it.
      required:
        - id
        - name
        - organizationId
        - ownerId
        - isAdmin
    Error:
      type: object
      description: >-
        Error body returned by every non-2xx response. Switch on `code`, never
        on `message`.
      properties:
        message:
          type: string
          description: Human-readable description of the error.
          example: Project not found.
        code:
          type: string
          description: Stable snake_case identifier of the error.
          example: project_not_found
        type:
          type: string
          enum:
            - invalid_request
            - auth
            - internal
          description: Category of the error, derived from the HTTP status.
          example: invalid_request
        link:
          type: string
          format: uri
          description: Documentation of this error code.
          example: >-
            https://www.meilisearch.com/docs/reference/management-api-errors#project_not_found
        details:
          type: array
          description: >-
            Request fields the error is about. Present whenever the error
            involves request fields.
          items:
            type: object
            properties:
              field:
                type: string
                description: Name of the field, in camelCase.
                example: name
              code:
                type: string
                description: Reason the field was rejected, e.g. `missing` or `unknown`.
                example: blank
              message:
                type: string
                description: Human-readable description of the problem.
                example: Name can't be blank
            required:
              - field
              - code
              - message
      required:
        - message
        - code
        - type
        - link
  securitySchemes:
    personal_access_token:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <token>`, where `<token>` is a personal
        access token (PAT) or an OAuth2 access token. A PAT authenticates as the
        user who owns it. See
        [Authentication](https://www.meilisearch.com/docs/reference/management-api/authentication).
    oauth2:
      type: oauth2
      description: >-
        OAuth2 authorization code flow with PKCE, for partner applications
        acting on behalf of a user. Send the user to the authorization URL in
        their browser. `read` allows GET requests, `write` allows every other
        method. See
        [Authentication](https://www.meilisearch.com/docs/reference/management-api/authentication).
      flows:
        authorizationCode:
          authorizationUrl: https://cloud.meilisearch.com/oauth/authorize
          tokenUrl: https://api.meilisearch.com/oauth/token
          refreshUrl: https://api.meilisearch.com/oauth/token
          scopes:
            read: Read access (GET requests)
            write: Write access (all other requests)

````

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