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

# Rename Profile

> Rename an LLM profile, cascading the rename to any Agent Profiles that
reference it.

The SDK ``rename_llm_profile`` renames the LLM profile and repoints every
``agent_profiles.*.llm_profile_ref == name`` to ``new_name`` under the org
row lock, so a referencing Agent Profile never dangles. Both collections are
written back in the same transaction.



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/organizations/{org_id}/profiles/{name}/rename
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/organizations/{org_id}/profiles/{name}/rename:
    post:
      tags:
        - Organization Profiles
      summary: Rename Profile
      description: >-
        Rename an LLM profile, cascading the rename to any Agent Profiles that

        reference it.


        The SDK ``rename_llm_profile`` renames the LLM profile and repoints
        every

        ``agent_profiles.*.llm_profile_ref == name`` to ``new_name`` under the
        org

        row lock, so a referencing Agent Profile never dangles. Both collections
        are

        written back in the same transaction.
      operationId: rename_profile_api_organizations__org_id__profiles__name__rename_post
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Org Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            title: Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/server__routes__org_profiles__RenameProfileRequest
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/server__routes__org_profiles__ProfileMutationResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    server__routes__org_profiles__RenameProfileRequest:
      properties:
        new_name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
          title: New Name
      type: object
      required:
        - new_name
      title: RenameProfileRequest
      description: >-
        Request body for renaming a profile.


        ``new_name`` is constrained to ``PROFILE_NAME_PATTERN`` because

        ``rename_llm_profile`` (the SDK FK-cascade helper backing this endpoint)

        validates the new name against that same pattern before renaming and

        repointing any referencing Agent Profiles — a name outside it always
        422s

        there. Declaring the constraint here makes the schema honest and gives a

        field-level 422 instead of one raised deep inside the handler. ``save``

        (create/update) is intentionally left permissive: it never calls the FK

        helper, so it has no such requirement.
    server__routes__org_profiles__ProfileMutationResponse:
      properties:
        name:
          type: string
          title: Name
        message:
          type: string
          title: Message
      type: object
      required:
        - name
        - message
      title: ProfileMutationResponse
      description: Response for profile mutations (save, delete, rename).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````