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

# Update Knowledge Settings

> Update your knowledge context settings; sections you don't send are
unchanged. Changing `temporal_settings` starts a full rebuild of your
context right away; poll `GET /v1/knowledge/status` until `up_to_date` is
true. Other changes take effect on the next context refresh (`POST
/v1/knowledge/refresh` to trigger one immediately).

`temporal_settings` controls how far back (and ahead) your context goes.
By default it's one year back and one year ahead. A more recent range
keeps your context smaller, so it uses less memory and refreshes faster; if
you work with historical data, widen it to fit: set `start` to `null` for
your full history, or to `{"type": "date", "date": "2020-01-01"}` to start
from a fixed date. A range can only include data you've synced, so to go
further back also raise your connections' sync range. Data outside the
range stays stored and searchable. Returns the full settings after the
update.

<Snippet file="api/knowledge/update-knowledge-settings.mdx" />


## OpenAPI

````yaml PATCH /v1/knowledge/settings
openapi: 3.1.0
info:
  title: Adapter API
  description: Connect and sync data from any SaaS tool.
  version: 0.1.0
servers:
  - url: https://api.adapter.com
security:
  - ApiKeyAuth: []
tags:
  - name: connections
    description: Manage OAuth connections to data sources.
paths:
  /v1/knowledge/settings:
    patch:
      tags:
        - knowledge
      summary: Update Knowledge Settings
      description: >-
        Update your knowledge context settings; sections you don't send are

        unchanged. Changing `temporal_settings` starts a full rebuild of your

        context right away; poll `GET /v1/knowledge/status` until `up_to_date`
        is

        true. Other changes take effect on the next context refresh (`POST

        /v1/knowledge/refresh` to trigger one immediately).


        `temporal_settings` controls how far back (and ahead) your context goes.

        By default it's one year back and one year ahead. A more recent range

        keeps your context smaller, so it uses less memory and refreshes faster;
        if

        you work with historical data, widen it to fit: set `start` to `null`
        for

        your full history, or to `{"type": "date", "date": "2020-01-01"}` to
        start

        from a fixed date. A range can only include data you've synced, so to go

        further back also raise your connections' sync range. Data outside the

        range stays stored and searchable. Returns the full settings after the

        update.
      operationId: update_knowledge_settings
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchKnowledgeSettingsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeSettingsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationErrorModel'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionDeniedErrorModel'
          description: Forbidden
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorModel'
          description: Internal Server Error
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableErrorModel'
components:
  schemas:
    PatchKnowledgeSettingsRequest:
      properties:
        temporal_settings:
          anyOf:
            - $ref: '#/components/schemas/KnowledgeTemporalSettings'
            - type: 'null'
          description: >-
            How far back (and ahead) your knowledge context goes. A more recent
            range keeps your context smaller, so it uses less memory and
            refreshes faster. If you work with historical data, widen the range
            to cover the period you need. Data outside the range stays stored
            and searchable; it just isn't part of the context. Replaces your
            current range; send both `start` and `end`. Omit to leave it
            unchanged.
          examples:
            - end:
                days: 365
                type: relative
      additionalProperties: false
      type: object
      title: PatchKnowledgeSettingsRequest
    KnowledgeSettingsResponse:
      properties:
        temporal_settings:
          $ref: '#/components/schemas/KnowledgeTemporalSettings'
          description: >-
            How far back (and ahead) your knowledge context goes. A more recent
            range keeps your context smaller, so it uses less memory and
            refreshes faster. If you work with historical data, widen the range
            to cover the period you need. Data outside the range stays stored
            and searchable; it just isn't part of the context.
      type: object
      required:
        - temporal_settings
      title: KnowledgeSettingsResponse
    BadRequestErrorModel:
      properties:
        error_code:
          type: string
          const: bad_request
          title: Error Code
          default: bad_request
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      required:
        - message
      title: BadRequestErrorModel
    AuthenticationErrorModel:
      properties:
        error_code:
          type: string
          const: authentication_error
          title: Error Code
          default: authentication_error
        message:
          type: string
          title: Message
          default: Invalid or missing credentials.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      title: AuthenticationErrorModel
    PermissionDeniedErrorModel:
      properties:
        error_code:
          type: string
          const: permission_denied
          title: Error Code
          default: permission_denied
        message:
          type: string
          title: Message
          default: You do not have permission to perform this action.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      title: PermissionDeniedErrorModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InternalServerErrorModel:
      properties:
        error_code:
          type: string
          const: internal_server_error
          title: Error Code
          default: internal_server_error
        message:
          type: string
          title: Message
          default: An unexpected error occurred.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      title: InternalServerErrorModel
    ServiceUnavailableErrorModel:
      properties:
        error_code:
          type: string
          const: service_unavailable
          title: Error Code
          default: service_unavailable
        message:
          type: string
          title: Message
          default: >-
            The service is currently experiencing issues. Please try again
            later.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      title: ServiceUnavailableErrorModel
    KnowledgeTemporalSettings:
      properties:
        start:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/RelativeBound'
                - $ref: '#/components/schemas/DateBound'
              discriminator:
                propertyName: type
                mapping:
                  date:
                    $ref: '#/components/schemas/DateBound'
                  relative:
                    $ref: '#/components/schemas/RelativeBound'
            - type: 'null'
          title: Start
          description: >-
            Earliest data built into your knowledge context. `null` includes
            everything, however old.
          examples:
            - days: 365
              type: relative
        end:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/RelativeBound'
                - $ref: '#/components/schemas/DateBound'
              discriminator:
                propertyName: type
                mapping:
                  date:
                    $ref: '#/components/schemas/DateBound'
                  relative:
                    $ref: '#/components/schemas/RelativeBound'
            - type: 'null'
          title: End
          description: >-
            Latest dated data (like upcoming calendar events) built into your
            knowledge context. `null` includes everything, however far ahead.
          examples:
            - days: 365
              type: relative
      additionalProperties: false
      type: object
      required:
        - start
        - end
      title: KnowledgeTemporalSettings
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    RelativeBound:
      properties:
        type:
          type: string
          const: relative
          title: Type
        days:
          type: integer
          maximum: 36500
          minimum: 1
          title: Days
          description: >-
            Days from now: back from today for `start`, ahead of today for
            `end`.
      additionalProperties: false
      type: object
      required:
        - type
        - days
      title: RelativeBound
    DateBound:
      properties:
        type:
          type: string
          const: date
          title: Type
        date:
          type: string
          format: date
          title: Date
          description: A fixed calendar date.
          examples:
            - '2020-01-01'
      additionalProperties: false
      type: object
      required:
        - type
        - date
      title: DateBound
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Pass your `pk_live_...` API key as a Bearer token.

````