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

# Update error code

> Updates fields of an error code. Only the fields you send are changed.

Renaming (`error_code`) fails with `409` if another code in the workspace already has that name (case- and whitespace-insensitive).



## OpenAPI

````yaml workflow-api/workflow-api.yaml patch /error-codes/{error_code_id}
openapi: 3.0.0
info:
  title: Workflow API
  version: 1.0.0
  description: API for managing workflows and their metadata
servers:
  - url: https://api.cloudcruise.com
    description: CloudCruise Platform Production API Server
security:
  - AuthScheme: []
paths:
  /error-codes/{error_code_id}:
    patch:
      summary: Update error code
      description: >-
        Updates fields of an error code. Only the fields you send are changed.


        Renaming (`error_code`) fails with `409` if another code in the
        workspace already has that name (case- and whitespace-insensitive).
      operationId: updateErrorCode
      parameters:
        - name: error_code_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the error code
        - name: cc-key
          in: header
          required: false
          schema:
            type: string
          description: CloudCruise API key for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ErrorCodeUpdatePayload'
      responses:
        '200':
          description: Error code updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCode'
        '400':
          description: >-
            Bad request - `error_code_id` is not a valid UUID, the body is
            empty, or a field is invalid
        '401':
          description: Unauthorized - Invalid or missing authentication
        '404':
          description: Error code not found in this workspace
        '409':
          description: Conflict - Another error code in the workspace already has this name
        '500':
          description: Internal server error
components:
  schemas:
    ErrorCodeUpdatePayload:
      type: object
      minProperties: 1
      properties:
        error_code:
          type: string
          maxLength: 100
          description: New name. Must not be blank or match another code in the workspace.
        description:
          type: string
          description: Short description of the error
        enriched_description:
          type: string
          description: Longer description used to classify errors against this code
        error_action:
          type: string
          enum:
            - alert
            - cancel
            - pause
            - retry
            - input_required
          description: What CloudCruise does when a run fails with this code
        retries:
          type: integer
          minimum: 0
          description: Number of retries when `error_action` is `retry`
        retry_after:
          type: integer
          minimum: 0
          description: Seconds to wait between retries when `error_action` is `retry`
    ErrorCode:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier. Use this value in a node's error-code parameter.
        error_code:
          type: string
          description: Name of the error code, e.g. `CLAIM_NOT_FOUND`
        description:
          type: string
          nullable: true
          description: Short description of the error
        enriched_description:
          type: string
          nullable: true
          description: Longer description used to classify errors against this code
        error_action:
          type: string
          nullable: true
          enum:
            - alert
            - cancel
            - pause
            - retry
            - input_required
          description: What CloudCruise does when a run fails with this code
        retries:
          type: integer
          nullable: true
          description: Number of retries when `error_action` is `retry`
        retry_after:
          type: integer
          nullable: true
          description: Seconds to wait between retries when `error_action` is `retry`
        workspace_id:
          type: string
          format: uuid
          description: ID of the workspace this error code belongs to
        created_at:
          type: string
          format: date-time
          description: Timestamp when the error code was created
  securitySchemes:
    AuthScheme:
      type: apiKey
      name: cc-key
      in: header
      description: >-
        API key-based authentication. Provide your CloudCruise API key in the
        cc-key header.

````