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

# Initialize import extract

> Manually initialize an extract for an import dataset.



## OpenAPI

````yaml /generated/openapi-import-generated-2023-12-01.json post /import/datasets/{id}/extract
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/datasets/{id}/extract:
    post:
      tags:
        - Import Datasets
      summary: Initialize import extract
      description: Manually initialize an extract for an import dataset.
      operationId: initialize-extract
      parameters:
        - name: id
          in: path
          required: true
          description: Import Dataset ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitializeExtractRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/import/api/models/initialize-extract-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/InitializeExtractResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/import/api/models/initialize-extract-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:
    InitializeExtractRequest:
      properties:
        filter:
          $ref: '#/components/schemas/ExtractFilterOptions'
          title: Filter Configuration
      additionalProperties: false
      type: object
    InitializeExtractResponse:
      properties:
        extract:
          $ref: '#/components/schemas/ExtractResource'
      additionalProperties: false
      type: object
      required:
        - extract
    ExtractFilterOptions:
      allOf:
        - oneOf:
            - properties:
                type:
                  const: last_modified
                last_modified:
                  $ref: '#/components/schemas/LastModifiedFilter'
                  title: Last Modified
              required:
                - type
                - last_modified
              title: Last Modified
            - properties:
                type:
                  const: records
                records:
                  $ref: '#/components/schemas/RecordsFilter'
                  title: Record IDs
              required:
                - type
                - records
              title: Record IDs
      properties: {}
      type: object
      unevaluatedProperties: false
    ExtractResource:
      properties:
        id:
          type: string
        dataset_id:
          type: string
        submitted_at:
          type: string
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        records_processed:
          type: integer
        records_existing_updated:
          type: integer
        records_existing_unchanged:
          type: integer
        records_existing_deleted:
          type: integer
        records_new_inserted:
          type: integer
        records_errored:
          type: integer
        error:
          $ref: '#/components/schemas/ErrorResource'
      additionalProperties: false
      type: object
      required:
        - id
        - dataset_id
        - submitted_at
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    LastModifiedFilter:
      properties:
        start:
          type: string
          format: date-time
          title: Start bounds
        end:
          type: string
          format: date-time
          title: End bounds
      additionalProperties: false
      type: object
    RecordsFilter:
      properties:
        record_ids:
          items:
            type: string
          type: array
          maxItems: 100
          minItems: 1
          title: Record IDs
      additionalProperties: false
      type: object
      required:
        - record_ids
    ErrorResource:
      properties:
        error_code:
          type: string
        title:
          type: string
        blame:
          type: string
        documentation_url:
          type: string
        trace:
          type: string
        message:
          type: string
      additionalProperties: false
      type: object
      required:
        - error_code
        - title
        - blame
        - documentation_url
        - trace
        - message
  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

````