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

# Update Extraction Schema

> Update extraction schema. Optionally create a new version.



## OpenAPI

````yaml https://www.datalab.to/openapi.json put /api/v1/extraction_schemas/{schema_id}
openapi: 3.1.0
info:
  title: Datalab API
  version: 0.0.1
servers:
  - url: https://www.datalab.to
    description: Datalab API
security: []
paths:
  /api/v1/extraction_schemas/{schema_id}:
    put:
      tags:
        - extraction_schemas
      summary: Update Extraction Schema
      description: Update extraction schema. Optionally create a new version.
      operationId: update_extraction_schema_api_v1_extraction_schemas__schema_id__put
      parameters:
        - name: schema_id
          in: path
          required: true
          schema:
            type: string
            title: Schema Id
        - name: wos-session
          in: cookie
          required: false
          schema:
            type: string
            title: Wos-Session
        - name: datalab_active_team
          in: cookie
          required: false
          schema:
            type: string
            title: Datalab Active Team
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateExtractionSchemaRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UpdateExtractionSchemaRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        schema_json:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema Json
        archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Archived
        create_new_version:
          type: boolean
          title: Create New Version
          description: If true, creates a new version instead of updating the current one
          default: false
      type: object
      title: UpdateExtractionSchemaRequest
    ExtractionSchemaResponse:
      properties:
        id:
          type: integer
          title: Id
        schema_id:
          type: string
          title: Schema Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        schema_json:
          additionalProperties: true
          type: object
          title: Schema Json
        version:
          type: integer
          title: Version
        version_history:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Version History
        archived:
          type: boolean
          title: Archived
        created:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created
        updated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated
      type: object
      required:
        - id
        - schema_id
        - name
        - description
        - schema_json
        - version
        - archived
        - created
        - updated
      title: ExtractionSchemaResponse
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````