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

# Create Custom Secret

> Create or update a custom secret.

Creates a new custom secret, or overwrites it if it already exists.

Returns:
    201: Secret saved successfully
    500: Error saving secret



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/v1/secrets
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/v1/secrets:
    post:
      tags:
        - Secrets
      summary: Create Custom Secret
      description: |-
        Create or update a custom secret.

        Creates a new custom secret, or overwrites it if it already exists.

        Returns:
            201: Secret saved successfully
            500: Error saving secret
      operationId: create_custom_secret_api_v1_secrets_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomSecretCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CustomSecretCreate:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        value:
          type: string
          format: password
          title: Value
          writeOnly: true
      type: object
      required:
        - name
        - value
      title: CustomSecretCreate
      description: Custom secret model with value (for creating secrets).
    EditResponse:
      properties:
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: EditResponse
      description: General response to an edit operation
    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

````