> ## 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.

# Create import destination

> Add a new import destination.



## OpenAPI

````yaml /generated/openapi-import-generated-2023-12-01.json post /import/destinations
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:
    post:
      tags:
        - Import Destinations
      summary: Create import destination
      description: Add a new import destination.
      operationId: create-import-destination
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDestinationRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/import/api/models/create-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:
    CreateDestinationRequest:
      properties:
        destination:
          $ref: '#/components/schemas/DestinationOptions'
      additionalProperties: false
      type: object
      required:
        - destination
    GetDestinationResponse:
      properties:
        destination:
          $ref: '#/components/schemas/DestinationResource'
      additionalProperties: false
      type: object
      required:
        - destination
    DestinationOptions:
      oneOf:
        - properties:
            type:
              const: webhook_record
            webhook_record:
              $ref: '#/components/schemas/WebhookRecordOptions'
              title: HTTP Record Configuration
          required:
            - type
            - webhook_record
          title: HTTP Record Configuration
        - properties:
            type:
              const: webhook_batch
            webhook_batch:
              $ref: '#/components/schemas/WebhookBatchOptions'
              title: HTTP Batch Configuration
          required:
            - type
            - webhook_batch
          title: HTTP Batch Configuration
      properties:
        name:
          type: string
          title: Name
          description: Unique name for this destination.
        record_schema:
          title: Record Schema
          description: JSON Schema for validating records (JSON5 supported).
      type: object
      required:
        - name
        - record_schema
      unevaluatedProperties: false
    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
    WebhookRecordOptions:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
          title: Request Template
          description: HTTP request template for records.
        max_records_per_minute:
          type: integer
          title: Max Records Per Minute
          description: Rate limit for records per minute.
          default: 3000
        max_concurrency:
          type: integer
          title: Max Concurrency
          description: Maximum concurrent request clients.
          default: 1
      additionalProperties: false
      type: object
      required:
        - request_template
    WebhookBatchOptions:
      properties:
        request_template:
          $ref: '#/components/schemas/HTTPRequestTemplate'
          title: Request Template
          description: HTTP request template for sending batch data.
        format:
          type: string
          enum:
            - parquet
            - csv
            - json
          title: Format
          description: Batch file format.
        max_size_per_batch:
          type: integer
          title: Max Size Per Batch
          description: Maximum records per batch.
          default: 24000
        max_batches_per_minute:
          type: integer
          title: Max Batches Per Minute
          description: Rate limit for batches per minute.
          default: 10
        max_concurrency:
          type: integer
          title: Max Concurrency
          description: Maximum concurrent request clients.
          default: 1
      additionalProperties: false
      type: object
      required:
        - request_template
        - format
    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

````