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

# Quickstart guide

> Configure a Prequel Import pipeline end to end and sync your first records

This guide walks through the order in which to create resources for a complete Prequel Import pipeline. Each step links to the corresponding [API reference](/import/import-api/overview) page and includes an expandable curl example.

## Select your onboarding experience

Get started with the Prequel agent skill, the Prequel MCP server, a Postman collection, or curl commands.

<Tabs>
  <Tab title="Agent skill" icon="sparkles">
    Skills are an open standard for packaging reusable agent capabilities. Claude Code, Cursor, and other skill-aware agents can all load the Prequel Import skill.

    <Steps>
      <Step title="Save the skill to your agent's skills directory">
        Open the [raw skill file](https://docs.prequel.co/.well-known/agent-skills/prequel-import-quickstart/SKILL.md), copy the contents, and save the file to your agent's skills directory. For Claude Code use `~/.claude/skills/prequel-import-quickstart/SKILL.md`. For Cursor use `.cursor/skills/prequel-import-quickstart/SKILL.md` in your project root and reload the workspace.
      </Step>

      <Step title="Prompt your agent">
        <Prompt description="Begin an agentic Prequel Import configuration using this prompt." actions={["copy"]}>
          Set up a new Prequel Import pipeline from scratch using the prequel-import-quickstart skill. Walk me through creating each resource in order, run the curl commands as we go, and finish by triggering an Extract and a Load to verify the pipeline end to end.
        </Prompt>
      </Step>
    </Steps>
  </Tab>

  <Tab title="MCP server" icon="plug">
    Mintlify auto-hosts an MCP server for this documentation site, exposing search and filesystem tools your agent can call to look up the right operations and schemas.

    <Steps>
      <Step title="Connect your AI tool to the Prequel Import MCP server">
        Add `https://docs.prequel.co/mcp` to your tool's MCP configuration. Most clients accept the URL directly through their MCP settings.
      </Step>

      <Step title="Prompt your agent">
        <Prompt description="Begin an agentic Prequel Import configuration using this prompt." actions={["copy"]}>
          Set up a new Prequel Import pipeline from scratch. Use the Prequel Import MCP server to look up the correct API operations and request schemas as we go, walk me through creating each resource in order, and finish by triggering an Extract and a Load to verify the pipeline end to end.
        </Prompt>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Postman" icon="send">
    <Steps>
      <Step title="Import the OpenAPI spec into Postman">
        In Postman, click **Import**, paste the [Prequel Import OpenAPI spec URL](https://docs.prequel.co/generated/openapi-import-generated-2023-12-01.json), and confirm. Postman generates a complete collection from the spec with one request per operation.
      </Step>

      <Step title="Set your API key as a collection variable">
        Add a `PREQUEL_API_KEY` variable to the imported collection and reference it from each request's `X-API-Key` header.
      </Step>
    </Steps>
  </Tab>

  <Tab title="curl commands" icon="terminal">
    <Steps>
      <Step title="Open the API reference">
        Browse the [API reference](/import/api-reference/introduction) and select the operation for the resource you want to create.
      </Step>

      <Step title="Copy the sample request body to your clipboard">
        Use the **Copy** button on each operation's example request body, paste it into your shell as the `-d` payload, and substitute your variables and resource IDs as you go.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Prerequisites

<Steps>
  <Step title="Access your Prequel API key">
    You will need a Prequel API key. If you do not have one, contact your Prequel representative to get access. The API key used in the `X-API-Key` header will route your request to either production or staging based on the key.

    ```bash title="Set your API key" icon="terminal" theme={null}
    export PREQUEL_API_KEY="<your-key>"
    ```
  </Step>

  <Step title="Stand up a delivery target">
    Stand up a [spec-compliant API endpoint](/import/destination-specs/webhook-batch) to receive delivered records.
  </Step>

  <Step title="Verify Prequel API access">
    Confirm your key works against the API. A 200 response means your environment is ready.

    ```bash title="Verify API access" icon="terminal" theme={null}
    curl -H "X-API-Key: $PREQUEL_API_KEY" https://api.prequel.co/
    ```
  </Step>
</Steps>

## Setup overview

Prequel Import should follow a three phase setup to prevent errors from missing dependencies:

1. **Prepare your environment** by creating a Datalake. The Datalake is a one-time setup shared across all Providers.
2. **Configure and validate a data source** by creating a Provider, Source, and Dataset, then triggering an Extract to confirm the Source, Dataset, and Datalake are configured correctly before adding delivery.
3. **Connect and deliver** by standing up a delivery endpoint, creating a Destination (and optionally a custom Product), creating a Stream, testing the transform, and triggering a Load.

## Set up your pipeline

<Tip>
  Each call returns a resource ID in the response body. Record the IDs as you go, since later steps reference them with placeholders such as `<DATALAKE_ID>` and `<DESTINATION_ID>`.
</Tip>

### Phase 1: prepare your environment

<Steps>
  <Step title="Create a Datalake">
    Provision a bucket on S3, GCS, Azure Blob Storage, or an S3-compatible store to back the Datalake, then create the Datalake referencing that bucket. Typically, a single multi-tenant Datalake is created and reused across Providers, since Prequel automatically partitions the bucket internally by Provider. You may create and assign additional Datalakes if you prefer bucket-level isolation for Providers. See [Datalake](/import/core-concepts/datalake) for configuration steps and open the [API reference](/import/api-reference/datalakes/create-datalake) for the full request schema.

    ```bash title="Create datalake" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/datalakes \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "datalake": {
          "name": "primary-datalake",
          "storage": "s3",
          "s3": {
            "bucket_name": "<your-bucket>",
            "bucket_region": "us-east-1",
            "prefix": "prequel-import",
            "auth_method": "aws_iam_role",
            "aws_iam_role": {
              "aws_iam_role_arn": "<your-role-arn>"
            }
          }
        }
      }'
    ```
  </Step>
</Steps>

### Phase 2: configure and validate a data source

<Note>
  Repeat this phase for each Provider you onboard. Each Provider can have multiple Sources and multiple Datasets.
</Note>

<Steps>
  <Step title="Create a Provider">
    A Provider represents a customer or tenant of your platform. The Provider references the Datalake by ID and the assigned Products. Pass the special `["all"]` Product to grant access to every Destination when customers share all Destinations. If a customer should only have access to a subset of Destinations, use Products to restrict Destinations by Provider. See [Providers](/import/core-concepts/providers), or open the [API reference](/import/api-reference/providers/create-provider) for the full request schema.

    ```bash title="Create provider" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/providers \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "provider": {
          "name": "Acme Corp",
          "id": "acme",
          "datalake_id": "<DATALAKE_ID>",
          "products": ["all"]
        }
      }'
    ```
  </Step>

  <Step title="Create a Source">
    A Source is the Provider's database Prequel will read from. See [Sources](/import/core-concepts/sources) for the supported vendors and per-vendor fields and open the [API reference](/import/api-reference/import-sources/create-import-source) for the full request schema.

    ```bash title="Create source" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/sources \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "source": {
          "name": "acme-postgres",
          "vendor": "postgres",
          "provider_id": "<PROVIDER_ID>",
          "postgres": {
            "host": "db.acme.example.com",
            "port": 5432,
            "database": "production",
            "auth_method": "password_auth",
            "password_auth": {
              "username": "prequel",
              "password": "<password>"
            }
          }
        }
      }'
    ```
  </Step>

  <Step title="Create a Dataset">
    A Dataset represents a structured table of data that Prequel will replicate from the Source. The Dataset declares its extraction method (`table` for a single table, `sql` for a custom query, `glob` for object-storage paths) and certain special columns and  configuration options. This step is repeated for each Provider's table to be imported. See [Datasets](/import/core-concepts/datasets) and [Change Detection](/import/advanced/change-detection) for incremental sync configuration, or open the [API reference](/import/api-reference/import-datasets/create-import-dataset) for the full request schema.

    ```bash title="Create dataset" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/datasets \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "dataset": {
          "source_id": "<SOURCE_ID>",
          "method": "table",
          "table": {
            "source_table_namespace": "public",
            "source_table_name": "users"
          },
          "type": "dimension",
          "dimension": {
            "primary_key_column": "id",
            "last_modified_column": "updated_at"
          },
          "frequency_minutes": 60
        }
      }'
    ```
  </Step>

  <Step title="Trigger an Extract to validate">
    The Extract pulls Dataset rows into the Datalake. Trigger one now to confirm the Source, Dataset, and Datalake are configured correctly before moving on to delivery. A successful Extract verifies authentication to the Source, read access to the Dataset's table, and write access to the Datalake. Open the [API reference](/import/api-reference/import-datasets/initialize-import-extract) for the full request schema.

    ```bash title="Initialize extract" icon="terminal" theme={null}
    curl -X POST https://api.prequel.co/import/datasets/<DATASET_ID>/extract \
      -H "X-API-Key: $PREQUEL_API_KEY"
    ```
  </Step>
</Steps>

### Phase 3: connect and deliver

<Note>
  Repeat for each Dataset/Destination pair.
</Note>

<Steps>
  <Step title="Create a Destination">
    A Destination is one of your delivery endpoints. Each Destination is configured with a `record_schema` that describes the records your endpoint expects and a `request_template` that defines the URL and auth headers. See [Destinations](/import/core-concepts/destinations) and the [Batch API specification](/import/destination-specs/webhook-batch), or open the [API reference](/import/api-reference/import-destinations/create-import-destination) for the full request schema.

    Repeat this step for each Destination you need.

    <Tip>
      Confirm your delivery endpoint from the prerequisites is reachable. Prequel validates connectivity during creation.
    </Tip>

    ```bash title="Create destination" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/destinations \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "destination": {
          "name": "primary-destination",
          "type": "webhook_record",
          "record_schema": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string" } } },
          "webhook_record": {
            "request_template": {
              "uri": "https://your-app.example.com/prequel/records",
              "method": "POST"
            }
          }
        }
      }'
    ```
  </Step>

  <Step title="Create a custom Product (optional)">
    By default, every Destination you create is included in a built-in `all` Product. Skip this step and reference `all` when you create a Provider, unless you want to group Destinations differently. To define a custom group, create a Product and include the Destination IDs you want it to cover. Open the [API reference](/import/api-reference/import-products/create-import-product) for the full request schema.

    ```bash title="Create product" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/products \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "product": {
          "name": "primary-product",
          "destinations": ["<DESTINATION_ID>"]
        }
      }'
    ```
  </Step>

  <Step title="Create a Stream">
    A Stream maps one Dataset to one Destination through field-level mappings. Before authoring the mappings, fetch the Destination's `record_schema` so you know which fields your mappings need to cover. See [Streams](/import/core-concepts/streams) and [Advanced Table Mapping](/import/advanced/table-mapping), or open the [API reference](/import/api-reference/import-streams/create-import-stream) for the full request schema.

    ```bash title="Create stream" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/streams \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "stream": {
          "name": "users-stream",
          "dataset_id": "<DATASET_ID>",
          "destination_id": "<DESTINATION_ID>",
          "mappings": [
            { "target_field": "id", "field_type": "field", "column": { "name": "id" } }
          ]
        }
      }'
    ```
  </Step>

  <Step title="Test the transform">
    Apply the Stream's mappings to a sample of extracted records and confirm the output covers every required field in the Destination's `record_schema` with the correct type. Open the [API reference](/import/api-reference/import-streams/test-stream-transform) for the full request schema.

    ```bash title="Test transform" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/streams/<STREAM_ID>/test-transform \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "record_ids": ["<RECORD_ID>"] }'
    ```
  </Step>

  <Step title="Trigger a Load">
    The Load applies the Stream's mappings and delivers records to the Destination. Open the [API reference](/import/api-reference/import-streams/initialize-load) for the full request schema. Then, verify records have reached your delivery endpoint.

    ```bash title="Initialize load" icon="terminal" expandable theme={null}
    curl -X POST https://api.prequel.co/import/streams/<STREAM_ID>/load \
      -H "X-API-Key: $PREQUEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{}'
    ```
  </Step>
</Steps>

<Check>
  **That's it.** Your Prequel Import pipeline is now configured to automatically extract data from the Source and load to the Destination.
</Check>

To onboard each additional Provider, repeat **Phase 2: Configure and validate a data source** and **Phase 3: Connect and deliver**.

## Next steps

<Columns cols={2}>
  <Card title="Building Your Customer Experience" icon="users" href="/import/getting-started/customer-experience">
    Wrap the API in an embedded setup and monitoring UX for your customers.
  </Card>

  <Card title="Webhooks and Monitoring" icon="bell" href="/import/logging/webhooks-and-monitoring">
    Get notified on transfer failures and track sync health.
  </Card>

  <Card title="Change Detection" icon="magnifying-glass" href="/import/advanced/change-detection">
    Tune incremental sync behavior for `dimension` Datasets.
  </Card>

  <Card title="Advanced Table Mapping" icon="table" href="/import/advanced/table-mapping">
    Use expressions and complex mappings to reshape source data.
  </Card>
</Columns>
