---
title: Sync API Data into Posts
slug: sync-api-data-to-posts
type: tutorial
plugin: huxx-connect-pro
summary: Turn a live API endpoint into WordPress posts with Post Creator — point it at the data, map two fields, preview, and run your first sync.
keywords: [post creator, sync, posts, field mapping, unique key, tutorial]
version_added: 1.3.5
version_updated: 1.3.5
level: beginner
pro: true
related: [map-api-fields-to-posts, choose-sync-mode-and-matching, your-first-api-connection]
---

Post Creator is a HuxxConnect Pro feature that reads items from an [endpoint](/docs/connect/explanation/glossary/#endpoint) and creates a WordPress post for each one. In this tutorial you'll sync product data from the DummyJSON demo API into draft posts.

## What you'll build

You'll configure Post Creator on the DummyJSON `products` endpoint and run one sync. When you're done, your Posts screen will hold 30 new drafts — one per product — each with the product's name as the title and its description as the content. Running the sync again updates those same posts instead of duplicating them.

<!-- screenshot-todo: post-creator-editor--run-complete--results-panel-30-created | alt: Post Creator editor after the first sync, Run Results panel showing 30 created posts -->

## Before you start

- HuxxConnect and HuxxConnect Pro are both installed and active.
- You have the DummyJSON API set up with a `products` endpoint. If not, complete [Your First API Connection](/docs/connect/tutorial/your-first-api-connection/) first — this tutorial picks up exactly where it ends.
- You can reach **HuxxConnect** in the WordPress admin menu.

## Step 1: Open the Post Creator editor

Open your DummyJSON API's detail page and expand the `products` endpoint. Below the testing section you'll see a **Post Creator** row marked **Not configured**. Click **Configure**.

The Post Creator editor opens on its own page. Notice the breadcrumb at the top — it shows the API and endpoint you're configuring — and a **Setup Guide** button that replays the built-in tour any time you want it.

<!-- screenshot-todo: post-creator-editor--first-open--configuration-card | alt: Post Creator editor on first open with the Configuration card expanded and empty Root Path and Unique Key fields -->

## Step 2: Point Post Creator at the data

The right-hand **API Response** panel fetches a live sample from your endpoint. DummyJSON wraps its product list in a `products` key:

```json
{
  "products": [
    {
      "id": 1,
      "title": "Essence Mascara Lash Princess",
      "description": "The Essence Mascara Lash Princess is a popular mascara known for its volumizing and lengthening effects.",
      "category": "beauty",
      "price": 9.99
    }
  ],
  "total": 194,
  "skip": 0,
  "limit": 30
}
```

Post Creator needs to know where the list of items lives. In the **Root Path** field, click **Detect** — it inspects the sample and fills in `products` for you. A green status appears under the field:

```
✓ 30 items detected
```

If you'd rather not type it, click into the **Root Path** field first, then click the `products` branch in the API Response tree — tree clicks only fill a field while that field is focused (with nothing focused, a branch click just expands or collapses it).

<!-- screenshot-todo: post-creator-editor--root-path-detected--30-items | alt: Root Path field filled with products and a green 30 items detected status below it -->

## Step 3: Set the Unique Key

The **Unique Key** tells Post Creator which field identifies each item, so a second run updates existing posts instead of creating duplicates. Type `id` into the **Unique Key** field (or focus the **Unique Key** field and then click the `id` leaf in the API Response tree — with no field focused, a leaf click copies the token to the clipboard instead).

The status under the field confirms the key exists in your data:

```
✓ Found in 30 of 30 items
```

Leave the rest of the Configuration card alone for now: **Post Type** stays `Posts`, **Post Status** stays `Draft`, and **Sync Mode** stays `Create & update` — the safe default while you're testing.

## Step 4: Map two fields

Switch to the **Field Mapping** tab. In the **Post Data** group, click **+ Add Field** and build your first mapping:

1. In the target dropdown, choose **Title**.
2. In the value input, type `{title}`.

A live preview appears under the row showing the resolved value from the current sample item:

```
→ Essence Mascara Lash Princess
```

Click **+ Add Field** again, choose **Content**, and type `{description}`. Tokens use the field names from the API Response panel — click any value in the tree while a mapping input is focused and its token is inserted for you.

<!-- screenshot-todo: post-creator-editor--fields-mapped--title-content-previews | alt: Post Data group with Title and Content mappings and their resolved preview values from the sample item -->

## Step 5: Save and preview

Click **Save Configuration**, then click **Preview**. Preview is a dry run — it fetches the API and shows what *would* happen without writing anything. It details the first 5 items — each row shows the action Post Creator plans for that item — and the panel header shows the total item count:

```
#1  create
#2  create
...  (30 total items)
```

Expand any row to see every mapped value exactly as it will be saved. If a title or description looks wrong here, fix the mapping before running.

## Step 6: Run the sync

Click **Run Now**. A confirmation dialog appears — "This will fetch data from the API and create or update posts based on your mapping configuration. This action cannot be undone." Click **Run Now** to confirm.

The **Run Results** panel fills in with the outcome:

```
Created: 30   Updated: 0   Deleted: 0   Skipped: 0   Errors: 0
```

Run it a second time and watch the numbers flip: `Created: 0, Updated: 30`. That's the Unique Key doing its job — every product already has a post, so each one is updated in place.

## Step 7: Check your posts

Go to **Posts → All Posts** and click the **Drafts** filter. You'll see 30 drafts titled after the DummyJSON products, each with the product description as its content. They're ordinary posts — edit, publish, or delete them like any other.

## What just happened

Post Creator fetched the endpoint, used the **Root Path** to find the array of items, and walked through them one by one. For each item it resolved your token templates (`{title}`, `{description}`) against the item's data and wrote a post, stamping it with the item's **Unique Key** so later runs can find it again. The **Sync Mode** decided what happened on the second run — `Create & update` updates matches and never deletes. See [How HuxxConnect Works](/docs/connect/explanation/how-huxxconnect-works/) for the request pipeline behind the fetch.

## If it didn't work

**"No items found — check the path" under Root Path.** The path doesn't point at an array. Click **Detect**, or focus the Root Path field and click the branch in the API Response panel that contains the numbered items. For DummyJSON the correct value is `products`.

**"Not found in sample data" under Unique Key.** The field name doesn't exist on the items — check spelling and case, and note the key is read from *inside* each item, so it's `id`, not `products.id`.

**Preview and Run Now are grayed out.** The configuration isn't complete yet: Post Creator needs a Unique Key and at least one mapping with a value. Fill in Steps 3 and 4, then save.

## Where next

- New to mapping? [Map API Fields to Posts](/docs/connect/how-to/map-api-fields-to-posts/) covers taxonomies, custom fields, and featured images.
- Ready to go deeper? [Choose Sync Mode and Matching](/docs/connect/how-to/choose-sync-mode-and-matching/) explains all four sync modes — including the one that deletes.
