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

# update a code version

> update the parent and/or visibility of a code version. For updating the parent, it's required that the parent code version exists in the same project. For updating the visibility, only the creator can make it public, but anyone on the team can make it private.



## OpenAPI

````yaml /api-reference/graph.json patch /graph/versions/{version_id}
openapi: 3.1.2
info:
  title: Bevor Graph API
  version: 1.0.0
servers: []
security: []
tags:
  - name: code
    description: Code versions and their files.
  - name: graph
    description: 'Graph structure of a code version: nodes, edges, and call chains.'
  - name: chat
    description: Chat threads and messages scoped to code versions.
paths:
  /graph/versions/{version_id}:
    patch:
      tags:
        - code
      summary: update a code version
      description: >-
        update the parent and/or visibility of a code version. For updating the
        parent, it's required that the parent code version exists in the same
        project. For updating the visibility, only the creator can make it
        public, but anyone on the team can make it private.
      parameters:
        - name: version_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  title: Name
                  type: string
              required:
                - name
              title: UpdateVersionBody
              type: object
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                properties:
                  id:
                    title: Id
                    type: string
                  network:
                    enum:
                      - eth
                      - bsc
                      - polygon
                      - base
                      - avax
                      - mode
                      - arb
                      - eth_sepolia
                      - bsc_test
                      - polygon_amoy
                      - base_sepolia
                      - avax_fuji
                      - mode_testnet
                      - arb_sepolia
                    type: string
                    nullable: true
                  version_method:
                    enum:
                      - tag
                      - commit
                      - hash
                      - address
                    title: Version Method
                    type: string
                  version_fingerprint:
                    title: Version Fingerprint
                    type: string
                  status:
                    enum:
                      - waiting
                      - processing
                      - failed
                      - success
                    title: Status
                    type: string
                  name:
                    type: string
                    nullable: true
                  branch:
                    type: string
                    nullable: true
                  commit:
                    $ref: '#/components/schemas/GithubCommitSchema'
                    nullable: true
                  repository:
                    $ref: '#/components/schemas/GithubRepositorySchema'
                    nullable: true
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  project_id:
                    title: Project Id
                    type: string
                  project_slug:
                    title: Project Slug
                    type: string
                  user:
                    $ref: '#/components/schemas/UserSchema'
                required:
                  - id
                  - version_method
                  - version_fingerprint
                  - status
                  - created_at
                  - project_id
                  - project_slug
                  - user
                title: CodeMappingSchema
                type: object
        '400':
          description: Error Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - BearerAuth: []
components:
  schemas:
    GithubCommitSchema:
      properties:
        sha:
          title: Sha
          type: string
        author:
          title: Author
          type: string
        message:
          title: Message
          type: string
        timestamp:
          format: date-time
          title: Timestamp
          type: string
      required:
        - sha
        - author
        - message
        - timestamp
      title: GithubCommitSchema
      type: object
    GithubRepositorySchema:
      properties:
        id:
          title: Id
          type: integer
        name:
          title: Name
          type: string
        is_private:
          title: Is Private
          type: boolean
        account:
          $ref: '#/components/schemas/GithubAccountSchema'
      required:
        - id
        - name
        - is_private
        - account
      title: GithubRepositorySchema
      type: object
    UserSchema:
      properties:
        id:
          title: Id
          type: string
        is_self:
          title: Is Self
          type: boolean
        created_at:
          format: date-time
          title: Created At
          type: string
        username:
          title: Username
          type: string
      required:
        - id
        - is_self
        - created_at
        - username
      title: UserSchema
      type: object
    ApiError:
      properties:
        code:
          enum:
            - auth.session_expired
            - auth.session_revoked
            - auth.session_invalid
            - auth.user_does_not_exist
            - auth.invalid_team_membership
            - auth.unauthorized
            - auth.key_revoked
            - auth.key_invalid
            - auth.payment_required
            - auth.team_required
            - auth.invalid_permissions
            - error.not_found
            - error.invalid_scope
            - error.limit
            - error.entity_deleted
            - error.invalid_state
            - error.conflict
            - error.integrity
            - error.database
            - error.validation
            - error.server
            - analysis.entrypoint_failure
            - code.unsupported
            - code.node_invalid
            - code.conflict
            - app.rate_limit
            - payment.error
            - payment.failed
          title: Code
          type: string
        message:
          title: Message
          type: string
      required:
        - code
        - message
      title: ApiError
      type: object
    GithubAccountSchema:
      properties:
        id:
          title: Id
          type: integer
        login:
          title: Login
          type: string
        type:
          title: Type
          type: string
        avatar_url:
          title: Avatar Url
          type: string
      required:
        - id
        - login
        - type
        - avatar_url
      title: GithubAccountSchema
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key in Bearer token format

````