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

# Update import destination

> Update an existing import destination.



## OpenAPI

````yaml /generated/openapi-import-generated-2023-12-01.json patch /import/destinations/{id}
openapi: 3.1.0
info:
  title: Prequel Data Import
  description: Data Import API spec
  version: '2023-12-01'
servers:
  - url: https://api.prequel.co
    description: Cloud-hosted server (US)
  - url: https://eu-api.prequel.co
    description: Cloud-hosted server (EU)
  - url: https://{custom_host}
    description: Self-hosted Prequel API host
security:
  - ApiKeyAuth: []
paths:
  /import/destinations/{id}:
    patch:
      tags:
        - Import Destinations
      summary: Update import destination
      description: Update an existing import destination.
      operationId: update-import-destination
      parameters:
        - name: id
          in: path
          required: true
          description: Import Destination ID.
          schema:
            type: string
        - name: force
          in: query
          required: false
          description: Allow updating immutable fields in staging.
          schema:
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDestinationRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/import/api/models/update-destination-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/GetDestinationResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/import/api/models/get-destination-response
                  message:
                    type: string
                type: object
                required:
                  - status
                  - data
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateDestinationRequest:
      properties:
        destination:
          $ref: '#/components/schemas/UpdateDestinationOptions'
      additionalProperties: false
      type: object
      required:
        - destination
    GetDestinationResponse:
      properties:
        destination:
          $ref: '#/components/schemas/DestinationResource'
      additionalProperties: false
      type: object
      required:
        - destination
    UpdateDestinationOptions:
      properties:
        name:
          type: string
          description: Unique name for this destination.
        type:
          type: string
          enum:
            - webhook_record
            - webhook_batch
          description: Destination type.
        record_schema:
          description: JSON Schema for validating records (JSON5 supported).
        webhook_record:
          $ref: '#/components/schemas/UpdateWebhookRecordOptions'
          description: HTTP Record Configuration
        webhook_batch:
          $ref: '#/components/schemas/UpdateWebhookBatchOptions'
          description: HTTP Batch Configuration
      additionalProperties: false
      type: object
    DestinationResource:
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
        record_schema: true
        created_at:
          type: string
        updated_at:
          type: string
        webhook_record:
          $ref: '#/components/schemas/WebhookRecordResource'
        webhook_batch:
          $ref: '#/components/schemas/WebhookBatchResource'
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - type
        - record_schema
        - created_at
        - updated_at
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    UpdateWebhookRecordOptions:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
          description: HTTP request template for records.
        max_records_per_minute:
          type: integer
          description: Rate limit for records per minute.
        max_concurrency:
          type: integer
          description: Maximum concurrent request clients.
      additionalProperties: false
      type: object
    UpdateWebhookBatchOptions:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
          description: HTTP request template for sending batch data.
        format:
          type: string
          enum:
            - parquet
            - csv
            - json
        max_size_per_batch:
          type: integer
          description: Maximum records per batch.
        max_batches_per_minute:
          type: integer
          description: Rate limit for batches per minute.
        max_concurrency:
          type: integer
          description: Maximum concurrent request clients.
      additionalProperties: false
      type: object
    WebhookRecordResource:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
        max_records_per_minute:
          type: integer
        max_concurrency:
          type: integer
      additionalProperties: false
      type: object
      required:
        - request_template
        - max_records_per_minute
        - max_concurrency
    WebhookBatchResource:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
        format:
          type: string
        max_size_per_batch:
          type: integer
        max_batches_per_minute:
          type: integer
        max_concurrency:
          type: integer
      additionalProperties: false
      type: object
      required:
        - request_template
        - format
        - max_size_per_batch
        - max_batches_per_minute
        - max_concurrency
    HTTPRequestTemplate:
      properties:
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          title: Method
          description: HTTP method for the request.
        uri:
          type: string
          title: URI
          description: Request URI with template variables.
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: HTTP headers.
        body:
          type: string
          title: Body
          description: Request body template.
      additionalProperties: false
      type: object
      required:
        - method
        - uri
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````