Skip to content

Backfill timestamps on posts, assets and comments

POST
/admin/seed/timestamps

Overwrites created_at and updated_at on posts, assets and comments that already exist, so seeded content can look as if it was made over time. It’s for seed and test tooling, not everyday use.

Send 1 to 1,000 items, each naming a table (kind), a row id and the times to set. On a post, posted_at is set to created_at as well, which moves the post in the feed. Rows that don’t exist are counted in skipped_unknown_id, not created, and deleted rows are updated like any other. All the updates in one request are saved together.

An empty list or more than 1,000 items gets a 400. A kind other than asset, post or comment fails the whole request with a 500, and nothing is changed.

Each successful call writes one admin.seed.timestamps_backfilled audit event with the counts, on a best-effort basis. No activity is recorded and peers aren’t told. You need system.admin; the endpoint works on any instance, not only demo ones.

object
items
required
Array<object>
>= 1 items <= 1000 items
object
kind
required

The table the id belongs to.

string
Allowed values: asset post comment
id
required
string format: uuid
created_at
required

The creation time to set. On a post, this also sets posted_at, which decides where the post appears in the feed.

string format: date-time
updated_at

Defaults to created_at when omitted.

string format: date-time
nullable

The update ran. The counts say how many rows changed in each table.

object
asset_updated
required
integer
post_updated
required
integer
comment_updated
required
integer
skipped_unknown_id
required

Items that updated nothing: the number sent minus the number updated. If the same id appears twice under one kind, the row is updated once, either copy’s times may be the ones kept, and the other copy is counted here.

integer

Malformed request

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed