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

# Update Schema

> Updates an existing event schema. All fields are optional. The `fields` array replaces existing fields entirely.



## OpenAPI

````yaml PATCH /apps/{appId}/schemas/{schemaId}
openapi: 3.1.0
info:
  title: Vela API
  description: Event ingestion, schema management, and notification rules for Vela.
  version: 1.0.0
  contact:
    name: Vela Support
    email: support@vela.dev
servers:
  - url: https://api.vela.dev/v1
    description: Production
  - url: http://localhost:3000/v1
    description: Local development
security:
  - clientSecret: []
paths:
  /apps/{appId}/schemas/{schemaId}:
    patch:
      tags:
        - Schemas
      summary: Update Schema
      description: >-
        Updates an existing event schema. All fields are optional. The `fields`
        array replaces existing fields entirely.
      operationId: update-schema
      parameters:
        - $ref: '#/components/parameters/AppId'
        - name: schemaId
          in: path
          required: true
          description: Schema identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  description: Human-readable description
                fields:
                  type: array
                  description: Replaces existing fields entirely
                  items:
                    $ref: '#/components/schemas/SchemaField'
                metadataFields:
                  type: array
                  description: Replaces existing metadata fields entirely
                  items:
                    $ref: '#/components/schemas/SchemaField'
            example:
              description: Updated description
              fields:
                - id: fld-order-id
                  name: orderId
                  type: string
                  required: true
                - id: fld-amount
                  name: amountCents
                  type: number
                  required: true
                - id: fld-currency
                  name: currency
                  type: enum
                  required: true
                  enumValues:
                    - USD
                    - EUR
                    - GBP
      responses:
        '200':
          description: Updated schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventSchema'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - clientSecret: []
components:
  parameters:
    AppId:
      name: appId
      in: path
      required: true
      description: App UUID or slug
      schema:
        type: string
      example: order-service
  schemas:
    SchemaField:
      type: object
      required:
        - id
        - name
        - type
      properties:
        id:
          type: string
          description: Field identifier
        name:
          type: string
          description: Field name
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - enum
          description: Field data type
        required:
          type: boolean
          description: Whether the field is required
          default: false
        enumValues:
          type: array
          items:
            type: string
          description: Allowed values (only for `enum` type)
    EventSchema:
      type: object
      properties:
        id:
          type: string
          description: Schema identifier
        appId:
          type: string
          format: uuid
          description: Associated app
        eventName:
          type: string
          description: Event name (unique per app)
        description:
          type: string
          description: Human-readable description
        fields:
          type: array
          items:
            $ref: '#/components/schemas/SchemaField'
          description: Event data field definitions
        metadataFields:
          type: array
          items:
            $ref: '#/components/schemas/SchemaField'
          description: Metadata field definitions
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        message:
          type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            error: Not Found
            message: Resource not found
  securitySchemes:
    clientSecret:
      type: http
      scheme: bearer
      description: 'Client secret for management API access. Format: `vela_cs_...`'

````