---
title: "Backfill posts"
method: POST
path: "/api/profiles/{id}/backfill_posts"
tags: ["Profiles"]
---

# Backfill posts

`POST /api/profiles/{id}/backfill_posts`

## Request

- Base URL: `https://api.postproxy.dev`
- URL: `https://api.postproxy.dev/api/profiles/{id}/backfill_posts`
- Auth: HTTP bearer

Walks the profile's feed backwards from the newest post, importing in batches of 25, until it reaches `from` or the platform stops returning posts. Runs in the background - the response is the post sync record, which you poll for progress.

## Path parameters

- `id` string, required

## Query parameters

- `profile_group_id` string

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `from` string, required: ISO 8601 date/time, or a bare date meaning that date's start of day. The run stops at the first post published before this.

## Response `202`

Backfill accepted; returns the post sync record to poll for progress

- ProfilePostSync: A post sync run: the sync fired when the profile connects, the recurring poll, or a backfill. Runs are kept for 30 days.
  - `id` string: Unique sync identifier.
  - `profile_id` string: Profile this run belongs to.
  - `kind` 'posts': Always posts today.
  - `trigger` 'connect' | 'scheduled' | 'backfill'
  - `status` 'pending' | 'running' | 'completed' | 'failed'
  - `started_at` string, nullable: ISO 8601 timestamp when the run began.
  - `completed_at` string, nullable: ISO 8601 timestamp when it finished or failed.
  - `posts_seen` integer: Posts the platform returned across the run.
  - `posts_imported` integer: Posts that were new and got created. Lower than posts_seen whenever the run re-read posts you already have.
  - `backfill_from` string, nullable: The date floor requested. null for connect and scheduled runs.
  - `oldest_posted_at` string, nullable: Publish date of the oldest post the run reached - how far back it has walked.
  - `error` string, nullable: Platform error message when status is failed.
  - `created_at` string: ISO 8601 timestamp.

## Other responses

- `400`: Missing required parameters.
- `401`: Invalid, missing, or insufficient API key permissions.
- `409`: Duplicate submission, or a request with the same Idempotency-Key is still in flight.
- `422`: Validation failed.

---

[API](https://skmtc.dev/postproxy/apis/postproxy-social-media-api.md) - [All operations](https://skmtc.dev/postproxy/apis/postproxy-social-media-api/llms.txt) - [OpenAPI document](https://skmtc.dev/postproxy/apis/postproxy-social-media-api/revisions/d54482ac4ce7?raw)
