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

# Perform a Patch on a secret by name



## OpenAPI

````yaml patch /org/{org}/secret/{name}
openapi: 3.0.3
info:
  title: Control Plane Core API
  description: Copyright © 2023 Control Plane Corporation. All rights reserved.
  version: 1.0.0
servers:
  - url: https://api.cpln.io
    description: ''
security:
  - {}
  - serviceAccountKey: []
  - jwt: []
externalDocs:
  url: https://docs.controlplane.com/
  description: End-user documentation
paths:
  /org/{org}/secret/{name}:
    patch:
      tags:
        - secret
      summary: Perform a Patch on a secret by name
      parameters:
        - in: path
          name: org
          required: true
          schema:
            type: string
        - in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patch_secret'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/secret'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    patch_secret:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - description
              - tags
              - type
              - data
        name:
          type: string
          maxLength: 64
        description:
          type: string
          maxLength: 250
        tags:
          type: object
          properties: {}
        $replace/tags:
          type: object
        type:
          type: string
          enum:
            - opaque
            - tls
            - gcp
            - aws
            - ecr
            - userpass
            - keypair
            - azure-sdk
            - azure-connector
            - docker
            - dictionary
            - nats-account
        $replace/data:
          oneOf:
            - $ref: '#/components/schemas/secret_opaque'
            - $ref: '#/components/schemas/secret_tls'
            - type: string
            - $ref: '#/components/schemas/secret_awskey'
            - type: object
              properties:
                accessKey:
                  type: string
                secretKey:
                  type: string
                roleArn:
                  type: string
                externalId:
                  type: string
                repos:
                  type: array
                  items:
                    type: string
              additionalProperties: false
            - $ref: '#/components/schemas/secret_userpass'
            - $ref: '#/components/schemas/secret_keypair'
            - $ref: '#/components/schemas/secret_dictionary'
            - type: object
              properties:
                url:
                  type: string
                  description: Url to the iam-broker Azure connection
                code:
                  type: string
                  description: Access code to call the function
              additionalProperties: false
            - type: object
              properties:
                accountId:
                  type: string
                privateKey:
                  type: string
              additionalProperties: false
        data:
          oneOf:
            - $ref: '#/components/schemas/patch_secret_opaque'
            - $ref: '#/components/schemas/patch_secret_tls'
            - $ref: '#/components/schemas/patch_secret_awskey'
            - $ref: '#/components/schemas/patch_secret_userpass'
            - $ref: '#/components/schemas/patch_secret_keypair'
            - $ref: '#/components/schemas/patch_secret_dictionary'
    secret:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          maxLength: 64
        kind:
          type: string
          readOnly: true
        version:
          type: integer
          readOnly: true
        description:
          type: string
          maxLength: 250
        tags:
          type: object
        created:
          type: string
          format: date-time
          readOnly: true
        lastModified:
          type: string
          format: date-time
          readOnly: true
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
          readOnly: true
        type:
          type: string
          enum:
            - opaque
            - tls
            - gcp
            - aws
            - ecr
            - userpass
            - keypair
            - azure-sdk
            - azure-connector
            - docker
            - dictionary
            - nats-account
        data:
          oneOf:
            - $ref: '#/components/schemas/secret_opaque'
            - $ref: '#/components/schemas/secret_tls'
            - type: string
            - $ref: '#/components/schemas/secret_awskey'
            - type: object
              properties:
                accessKey:
                  type: string
                secretKey:
                  type: string
                roleArn:
                  type: string
                externalId:
                  type: string
                repos:
                  type: array
                  items:
                    type: string
              additionalProperties: false
            - $ref: '#/components/schemas/secret_userpass'
            - $ref: '#/components/schemas/secret_keypair'
            - $ref: '#/components/schemas/secret_dictionary'
            - type: object
              properties:
                url:
                  type: string
                  description: Url to the iam-broker Azure connection
                code:
                  type: string
                  description: Access code to call the function
              additionalProperties: false
            - type: object
              properties:
                accountId:
                  type: string
                privateKey:
                  type: string
              additionalProperties: false
      additionalProperties: false
    error:
      type: object
      properties:
        status:
          type: integer
        message:
          type: string
        code:
          type: string
        details:
          type: object
        id:
          type: string
      additionalProperties: false
    secret_opaque:
      type: object
      properties:
        payload:
          type: string
        encoding:
          type: string
          enum:
            - plain
            - base64
          default: plain
      additionalProperties: false
    secret_tls:
      type: object
      properties:
        key:
          type: string
        cert:
          type: string
        chain:
          type: string
      additionalProperties: false
    secret_awskey:
      type: object
      properties:
        accessKey:
          type: string
        secretKey:
          type: string
        roleArn:
          type: string
        externalId:
          type: string
      additionalProperties: false
    secret_userpass:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
        encoding:
          type: string
          enum:
            - plain
            - base64
          default: plain
      additionalProperties: false
    secret_keypair:
      type: object
      properties:
        secretKey:
          type: string
        publicKey:
          type: string
        passphrase:
          type: string
      additionalProperties: false
    secret_dictionary:
      type: object
    patch_secret_opaque:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - payload
              - encoding
        payload:
          type: string
        encoding:
          type: string
          enum:
            - plain
            - base64
          default: plain
    patch_secret_tls:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - key
              - cert
              - chain
        key:
          type: string
        cert:
          type: string
        chain:
          type: string
    patch_secret_awskey:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - accessKey
              - secretKey
              - roleArn
              - externalId
        accessKey:
          type: string
        secretKey:
          type: string
        roleArn:
          type: string
        externalId:
          type: string
    patch_secret_userpass:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - username
              - password
              - encoding
        username:
          type: string
        password:
          type: string
        encoding:
          type: string
          enum:
            - plain
            - base64
          default: plain
    patch_secret_keypair:
      type: object
      properties:
        $drop:
          type: array
          items:
            type: string
            enum:
              - secretKey
              - publicKey
              - passphrase
        secretKey:
          type: string
        publicKey:
          type: string
        passphrase:
          type: string
    patch_secret_dictionary:
      type: object
      properties: {}
    link:
      type: object
      properties:
        rel:
          type: string
        href:
          type: string
      additionalProperties: false
  securitySchemes:
    serviceAccountKey:
      type: apiKey
      in: header
      name: Authorization
      description: Service account key can be used as API keys
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: IDP-provided token

````