For AI agents: this page is also available as Markdown at https://docs.refabric.com/records-and-libraries/using-the-files-and-records-api.md, and the index of every page is https://docs.refabric.com/llms.txt.

Records & libraries

Using the Files & Records API

List, read, upload and delete files and records through the API, and what only the panel can do.

The Files part of the Platform API is four operations: upload a file, list what a task can reference, read one file or record, and delete a produced file. Every one of them works with handles — the same strings a task input takes.

List what you can reference

GET /v1/refs/{kind} lists one kind, a page at a time. Every row has the file handle to pass, a name and a preview url, plus a few words for its kind.

page = s.get(f"{API}/refs/model", params={"limit": 50}).json()
for item in page["items"]:
    print(item["file"], item.get("name"))
# while page["has_more"]: pass page["next_cursor"] as ?cursor=
  • q filters file and model lists by text (live list: GET /v1/vocab/ref_kind).
  • base=model:<id> lists one model's styles.
  • curated=true lists Refabric's curated moodboards or fabrics instead of yours.

List what you can reference →

Read one

GET /v1/files/{handle} answers the file line, and for a record its data. view=basic leaves out the large parts (a record's items).

curl -s "https://api.refabric.com/v1/files/moodboard:3f2a…?view=basic" -H "Authorization: Key $REFABRIC_API_KEY"

Read a file →

Upload

POST /v1/files gives an image an id before any job uses it — by url or by bytes (Upload).

Upload a file →

Delete

DELETE /v1/files/{ref} deletes a produced file (art:…); deletion applies to produced files (Retention & deletion).

Delete a file →

API boundaries

Keys and webhook endpoints are managed in the panel; their routes answer a key with 403 session_required.

Only in the panelWhere
Create, roll and revoke API keysPanel › Developers › Keys
Register webhook endpoints, read the delivery log, replay a deliveryPanel › Developers › Webhooks

Everything else the panel shows — jobs, the request log, usage, metrics, errors, limits, files and records, your balance — is read through the same public operations your key can call.