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

# Update Upload Schedule

> ### Description
Updates a upload schedule

### Details
This API can be used to update the upload schedule that matches the ID that was passed in as a path parameter. To use this API, pass in the `id` that was returned from your Create Upload Schedule API call as a path parameter.

Review the request schema to see the fields that can be updated.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml patch /v4/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}:
    patch:
      tags:
        - Knowledge Bases
      summary: Update Upload Schedule
      description: >-
        ### Description

        Updates a upload schedule


        ### Details

        This API can be used to update the upload schedule that matches the ID
        that was passed in as a path parameter. To use this API, pass in the
        `id` that was returned from your Create Upload Schedule API call as a
        path parameter.


        Review the request schema to see the fields that can be updated.
      operationId: >-
        PATCH-V4-/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          schema:
            type: string
            title: Knowledge Base Id
        - name: upload_schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Upload Schedule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartialKnowledgeBaseUploadScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseUploadScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from scale_gp import SGPClient

            client = SGPClient(
                api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
            )
            upload_schedule = client.knowledge_bases.upload_schedules.update(
                upload_schedule_id="upload_schedule_id",
                knowledge_base_id="knowledge_base_id",
            )
            print(upload_schedule.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/sgp-go\"\n\t\"github.com/stainless-sdks/sgp-go/option\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuploadSchedule, err := client.KnowledgeBases.UploadSchedules.Update(\n\t\tcontext.TODO(),\n\t\t\"knowledge_base_id\",\n\t\t\"upload_schedule_id\",\n\t\tsgp.KnowledgeBaseUploadScheduleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", uploadSchedule.ID)\n}\n"
components:
  schemas:
    PartialKnowledgeBaseUploadScheduleRequest:
      properties:
        chunking_strategy_config:
          $ref: '#/components/schemas/ChunkingStrategyConfig'
        interval:
          type: number
          title: Interval
        next_run_at:
          title: Next Run At
          type: string
          format: date-time
      additionalProperties: false
      type: object
      title: PartialKnowledgeBaseUploadScheduleRequest
    KnowledgeBaseUploadScheduleResponse:
      properties:
        knowledge_base_id:
          type: string
          title: Knowledge Base Id
          can_patch: false
        knowledge_base_data_source_id:
          type: string
          title: Knowledge Base Data Source Id
          can_patch: false
        chunking_strategy_config:
          $ref: '#/components/schemas/ChunkingStrategyConfig'
        status:
          $ref: '#/components/schemas/KnowledgeBaseUploadScheduleStatus'
        status_reason:
          title: Status Reason
          type: string
        interval:
          type: number
          title: Interval
        next_run_at:
          title: Next Run At
          type: string
          format: date-time
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the entity was last updated in ISO format.
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
        account_id:
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
          optional_in_request: true
          type: string
      type: object
      required:
        - knowledge_base_id
        - knowledge_base_data_source_id
        - chunking_strategy_config
        - status
        - interval
        - id
        - created_at
        - updated_at
        - created_by_user_id
        - created_by_identity_type
        - account_id
      title: KnowledgeBaseUploadScheduleResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChunkingStrategyConfig:
      oneOf:
        - $ref: '#/components/schemas/CharacterChunkingStrategyConfig'
        - $ref: '#/components/schemas/TokenChunkingStrategyConfig'
        - $ref: '#/components/schemas/CustomChunkingStrategyConfig'
        - $ref: '#/components/schemas/PreChunkedStrategyConfig'
        - $ref: '#/components/schemas/EnhancedChunkingStrategyConfig'
      title: ChunkingStrategyConfig
      discriminator:
        propertyName: strategy
        mapping:
          character:
            $ref: '#/components/schemas/CharacterChunkingStrategyConfig'
          custom:
            $ref: '#/components/schemas/CustomChunkingStrategyConfig'
          enhanced:
            $ref: '#/components/schemas/EnhancedChunkingStrategyConfig'
          pre_chunked:
            $ref: '#/components/schemas/PreChunkedStrategyConfig'
          token:
            $ref: '#/components/schemas/TokenChunkingStrategyConfig'
    KnowledgeBaseUploadScheduleStatus:
      type: string
      enum:
        - HEALTHY
        - UNHEALTHY
        - ERROR
        - PAUSED
      title: KnowledgeBaseUploadScheduleStatus
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CharacterChunkingStrategyConfig:
      properties:
        strategy:
          type: string
          const: character
          title: Strategy
        separator:
          title: Separator
          description: >-
            Character designating breaks in input data. Text data will first be
            split into sections by this separator, then each section will be
            split into chunks of size `chunk_size`.
          default: |+


          type: string
        chunk_size:
          title: Chunk Size
          description: >-
            Maximum number of characters in each chunk. If not specified, a
            chunk size of 1000 will be used.
          default: 1000
          type: integer
          minimum: 1
        chunk_overlap:
          title: Chunk Overlap
          description: >-
            Number of characters to overlap between chunks. If not specified, an
            overlap of 200 will be used. For example if the chunk size is 3 and
            the overlap size is 1, and the text to chunk is 'abcde', the chunks
            will be 'abc', 'cde'.
          default: 200
          type: integer
          minimum: 0
      type: object
      required:
        - strategy
      title: CharacterChunkingStrategyConfig
    TokenChunkingStrategyConfig:
      properties:
        strategy:
          type: string
          const: token
          title: Strategy
        separator:
          title: Separator
          description: >-
            Character designating breaks in input data. Text data will first be
            split into sections by this separator, then each section will be
            split into chunks of size `chunk_size`.
          default: |+


          type: string
        target_chunk_size:
          title: Target Chunk Size
          description: >-
            Target number of tokens in each chunk. If not specified, a target
            chunk size of 200 will be used.
          default: 200
          type: integer
          minimum: 1
        max_chunk_size:
          title: Max Chunk Size
          description: >-
            Maximum number of tokens in each chunk. If not specified, a maximum
            chunk size of 600 will be used.
          default: 600
          type: integer
          minimum: 1
        chunk_overlap:
          title: Chunk Overlap
          description: >-
            Number of tokens to overlap between chunks. If not specified, an
            overlap of 0 will be used. Not this if only followed approximately.
          default: 0
          type: integer
          minimum: 0
      type: object
      required:
        - strategy
      title: TokenChunkingStrategyConfig
    CustomChunkingStrategyConfig:
      properties:
        strategy:
          type: string
          const: custom
          title: Strategy
        endpoint:
          type: string
          title: Endpoint
          description: Endpoint path to call for custom chunking
        params:
          title: Params
          description: >-
            Parameters that will be appended to the body of the request for the
            chunk.
          default: {}
          additionalProperties: true
          type: object
      type: object
      required:
        - strategy
        - endpoint
      title: CustomChunkingStrategyConfig
    PreChunkedStrategyConfig:
      properties:
        strategy:
          type: string
          const: pre_chunked
          title: Strategy
      type: object
      required:
        - strategy
      title: PreChunkedStrategyConfig
      description: Only compliant with the .chunks file type
    EnhancedChunkingStrategyConfig:
      properties:
        strategy:
          type: string
          const: enhanced
          title: Strategy
          default: enhanced
        chunk_mode:
          type: string
          enum:
            - variable
            - section
            - page
            - page_sections
            - block
          title: Chunk Mode
          description: Enhanced internal chunking method
          default: section
        options:
          title: Options
          description: Options for enhanced parsing
          additionalProperties: true
          type: object
        advanced_options:
          title: Advanced Options
          description: Advanced options for enhanced parsing
          additionalProperties: true
          type: object
        experimental_options:
          title: Experimental Options
          description: Experimental options for enhanced parsing
          additionalProperties: true
          type: object
        use_async_parsing:
          type: boolean
          title: Use Async Parsing
          default: false
      type: object
      title: EnhancedChunkingStrategyConfig
      description: Enhanced document parsing and chunking

````