Seed test data

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Fills the app's test data with sample records for the testing agent to work with. A run on the app's preview uses test data, and Run test seeds it when such a run starts, so call this only to refresh the test data yourself.

For each entity other than User:

  • When the entity has live records, up to 5 copies of them are written to test data, including any personal details they hold. Live data is only read, never changed.
  • Otherwise, for up to 5 such entities, AI makes up to 3 records each from the entity's schema. This is skipped for an entity whose test data has records someone added by hand, and for an entity with no schema fields.

New records replace the ones an earlier seed wrote. Test records someone added by hand are kept.

Copying is free. Making up records costs credits, and the call is refused when it needs to make some up and the workspace is out of credits, though records already copied are kept. It runs while you wait, usually for 20 to 45 seconds and up to a few minutes on an app with many entities, so allow a long timeout. Seeds of one app run one at a time. A call made while another is running waits for it and then usually seeds again, replacing what the first one wrote and charging again for any AI-made records. If the wait runs too long, it gives up and reports no records written.

This is limited to 30 requests per minute per caller for each app. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. Read-only keys and workspace API keys are refused.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

post/api/apps/{app_id}/testing-agent/data/seed

Path parameters

app_idstring required

ID of the app.

ID of the app.

Response

What was written into the app's test data.

seededobject required

Records written for each entity, keyed by entity name. 0 when nothing was written.

totalinteger required

Records written across all entities.

generated_totalinteger required

How many of the records were made up by AI rather than copied from live data.

entities_with_datainteger required

Entities that got records, or whose own test records were kept.

entities_without_prod_datastring[] required

Entities that got nothing copied from live data and didn't report an error. When this call gave up waiting for another seed of the app, every entity is listed.

entities_with_errorsstring[] required

Entities whose seeding reported an error, for example because generating records timed out. An entity whose record writes all failed isn't listed. Its seeded count is 0.

Example response

{
  "seeded": {
    "Project": 5,
    "Task": 3
  },
  "total": 8,
  "generated_total": 3,
  "entities_with_data": 2,
  "entities_without_prod_data": [
    "Task"
  ],
  "entities_with_errors": []
}

Changes

Changed in 1 of the 39 revisions of this API.1