> ## 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.

# Save Agent Profile

> Create or update an agent profile under ``name`` (path name is authoritative).

Server-managed id/revision: overwrite keeps the namesake's id and bumps
revision; create mints a fresh id (``save_profile_preserving_identity``).
Returns 422 on invalid payloads (secret-safe detail) and 409 when creating a
new profile would exceed ``MAX_AGENT_PROFILES``.



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/agent-profiles/{name}
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/agent-profiles/{name}:
    post:
      tags:
        - Agent Profiles
      summary: Save Agent Profile
      description: >-
        Create or update an agent profile under ``name`` (path name is
        authoritative).


        Server-managed id/revision: overwrite keeps the namesake's id and bumps

        revision; create mints a fresh id
        (``save_profile_preserving_identity``).

        Returns 422 on invalid payloads (secret-safe detail) and 409 when
        creating a

        new profile would exceed ``MAX_AGENT_PROFILES``.
      operationId: save_agent_profile_api_agent_profiles__name__post
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
            title: Name
        - name: org_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Org Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Body
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentProfileMutationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentProfileMutationResponse:
      properties:
        name:
          type: string
          title: Name
        message:
          type: string
          title: Message
      type: object
      required:
        - name
        - message
      title: AgentProfileMutationResponse
    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

````