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

# Update Schema

> Update an existing schema.



## OpenAPI

````yaml api-reference/openapi.json put /extract/schemas/{schema_id}
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /extract/schemas/{schema_id}:
    put:
      tags:
        - /extract
      summary: Update Schema
      description: Update an existing schema.
      operationId: update_schema_extract_schemas__schema_id__put
      parameters:
        - name: schema_id
          in: path
          required: true
          schema:
            type: string
            title: Schema Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SchemaUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the schema
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the schema
        schema_definition:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema Definition
          description: JSON schema definition
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Additional metadata
      additionalProperties: false
      type: object
      title: SchemaUpdateRequest
      description: Request model for updating a schema.
    SchemaResponse:
      properties:
        schema_id:
          type: string
          title: Schema Id
          description: Unique ID of the schema
        name:
          type: string
          title: Name
          description: Name of the schema
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the schema
        schema_definition:
          additionalProperties: true
          type: object
          title: Schema Definition
          description: JSON schema definition
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Schema metadata
        created_at:
          type: string
          title: Created At
          description: Timestamp when the schema was created
        updated_at:
          type: string
          title: Updated At
          description: Timestamp when the schema was last updated
      type: object
      required:
        - schema_id
        - name
        - schema_definition
        - metadata
        - created_at
        - updated_at
      title: SchemaResponse
      description: Response model for schema information.
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````