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

# Update repository

> Update repository name, default bookmark, or tags. Tags are patched: omitted keys are unchanged, string values add or update a tag, and null values remove a tag.

<Note>**Required scope:** `write`</Note>


## OpenAPI

````yaml /openapi.json patch /{org}/{repo}
openapi: 3.1.0
info:
  title: Depot API
  description: Depot HTTP API v1
  version: 1.0.0
servers:
  - url: https://api.mesa.dev/v1
security:
  - apiKey: []
paths:
  /{org}/{repo}:
    patch:
      tags:
        - Repo
      summary: Update repository
      description: >-
        Update repository name, default bookmark, or tags. Tags are patched:
        omitted keys are unchanged, string values add or update a tag, and null
        values remove a tag.
      operationId: updateRepo
      parameters:
        - in: path
          name: org
          schema:
            type: string
            minLength: 1
          required: true
          description: Organization slug
        - in: path
          name: repo
          schema:
            type: string
            minLength: 1
          required: true
          description: Repository name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                default_bookmark:
                  type: string
                  minLength: 1
                tags:
                  description: >-
                    Tag patch: string values set tags, null removes them. Keys
                    must not start with "$" (reserved for tag filter operators).
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: 'null'
                upstream:
                  description: >-
                    Set, replace, or remove the upstream remote. Pass an object
                    to attach or update. Pass `null` to remove. Omit to leave
                    unchanged.
                  anyOf:
                    - type: object
                      properties:
                        url:
                          type: string
                          format: uri
                        auth:
                          description: >-
                            Authentication for the upstream remote. On PATCH:
                            omit to leave any existing credential unchanged,
                            pass `null` to clear and make the upstream public,
                            pass an object to set/replace. On POST, both omit
                            and `null` create a public upstream.
                          anyOf:
                            - oneOf:
                                - type: object
                                  properties:
                                    kind:
                                      type: string
                                      const: token
                                    token:
                                      type: string
                                      minLength: 1
                                    token_username:
                                      type: string
                                      minLength: 1
                                  required:
                                    - kind
                                    - token
                                - type: object
                                  properties:
                                    kind:
                                      type: string
                                      const: username_password
                                    username:
                                      type: string
                                      minLength: 1
                                    password:
                                      type: string
                                      minLength: 1
                                  required:
                                    - kind
                                    - username
                                    - password
                            - type: 'null'
                      required:
                        - url
                    - type: 'null'
      responses:
        '200':
          description: Repository updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  org:
                    type: string
                  name:
                    type: string
                  default_bookmark:
                    type: string
                  head_change_id:
                    type: string
                    pattern: ^[zyxwvutsrqponmlk]{32}$
                    description: >-
                      Current change id at the default bookmark tip. On empty
                      repositories this is the virtual root change id
                      (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz).
                  upstream:
                    anyOf:
                      - type: object
                        properties:
                          url:
                            type: string
                            format: uri
                          auth_kind:
                            anyOf:
                              - type: string
                                enum:
                                  - token
                                  - username_password
                              - type: 'null'
                            description: >-
                              Kind of credentials stored for this upstream, or
                              null if it is public. Auth payloads are write-only
                              — secrets are never returned.
                          latest_sync:
                            anyOf:
                              - type: object
                                properties:
                                  id:
                                    type: string
                                  repo_id:
                                    type: string
                                  direction:
                                    type: string
                                    enum:
                                      - pull
                                      - push
                                  status:
                                    type: string
                                    enum:
                                      - queued
                                      - in_progress
                                      - completed
                                      - failed
                                  attempt:
                                    type: integer
                                  ref_globs:
                                    type: object
                                    properties:
                                      branches:
                                        type: string
                                      tags:
                                        type: string
                                    required:
                                      - branches
                                      - tags
                                    additionalProperties: false
                                  stats:
                                    anyOf:
                                      - type: object
                                        properties:
                                          refs:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                before:
                                                  anyOf:
                                                    - type: string
                                                    - type: 'null'
                                                after:
                                                  type: string
                                                outcome:
                                                  type: string
                                                  enum:
                                                    - updated
                                                    - unchanged
                                                    - filtered
                                                    - rejected
                                              required:
                                                - name
                                                - before
                                                - after
                                                - outcome
                                        required:
                                          - refs
                                      - type: 'null'
                                  error:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                  created_at:
                                    type: string
                                    format: date-time
                                  started_at:
                                    anyOf:
                                      - type: string
                                        format: date-time
                                      - type: 'null'
                                  finished_at:
                                    anyOf:
                                      - type: string
                                        format: date-time
                                      - type: 'null'
                                required:
                                  - id
                                  - repo_id
                                  - direction
                                  - status
                                  - attempt
                                  - ref_globs
                                  - stats
                                  - error
                                  - created_at
                                  - started_at
                                  - finished_at
                              - type: 'null'
                            description: >-
                              Most recent sync for this upstream, or null if no
                              sync has started yet.
                        required:
                          - url
                          - auth_kind
                          - latest_sync
                        description: >-
                          Upstream git remote configuration. Each repository has
                          at most one upstream.
                      - type: 'null'
                    description: >-
                      Upstream remote configured for this repository, or null if
                      none is configured.
                  created_at:
                    type: string
                    format: date-time
                  tags:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - id
                  - org
                  - name
                  - default_bookmark
                  - head_change_id
                  - upstream
                  - created_at
                  - tags
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key

````