For AI agents: this page is also available as Markdown at https://docs.refabric.com/api-reference/platform/files/list-what-you-can-reference.md, and the index of every page is https://docs.refabric.com/llms.txt.
Platform API › Files
List what you can reference
One page of everything of this kind a task input may take — your uploads and the library — each with the file handle a task accepts.
https://api.refabric.com/v1/refs/{kind}import os
import requests
url = "https://api.refabric.com/v1/refs/{kind}"
headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}
response = requests.get(url, headers=headers)
print(response.json()){
"items": [],
"next_cursor": "eyJsIjoiY2hhbmdlbG9nIn0",
"has_more": false
}Filters and sorting
curated=truelists Refabric's own records instead of yours.qsearches files and models;baselists one model's saved styles.
Authentication. A key with files:read: the files are your account's.
Key features
- Pages of 20 items by default, 100 at most; the listing's own order.
Common use cases
- Offer a picker of poses, models or backgrounds a task can take.
See also
GET /v1/files/{ref}
Authorization
Authorization: Key $REFABRIC_API_KEYScope: files:read
Parameters
Path parameters
- stringrequired
What to list: the kind of handle a task field takes.
Values
art— A file a task delivered.file— A file you uploaded: a product photo or another image.background— A background from your library.pose— A pose from your library.model— A model, or one of its saved styles.pose_preset— A saved set of poses and views a shoot can use as a whole.moodboard— A moodboard.brand_kit— A brand kit.fabric— A fabric.range_plan— A range plan.photoshoot— The result of a shoot.
Query parameters
- integeroptionalDefault:
20Items per page: default 20, at most 100.
1 to 100
- stringoptionalnullable
The previous page's
next_cursor, copied back as it came, for the next page. Never build one. - stringoptionalnullable
modelonly: list the saved STYLES of one base model, asmodel:<id>(a style is passed intomodels[]like a model). Sent to another kind, it is refused.max length 100
- booleanoptionalDefault:
falseFor a structured-result kind (
moodboard,fabric): list Refabric's own curated records instead of yours. - stringoptionalnullable
Free-text filter for
fileandmodel; sent to another kind, it is refused.max length 100
Header parameters
- stringoptional
The contract version you wrote against (a date). Absent: the current version.
format: date
- stringoptional
Your own id for this request; we answer it back under X-Client-Request-ID.
max length 128
Response
200 — Done: the answer is in the body.
- array<object>required
This page's items, in the listing's order.
- stringrequired
The opaque
<kind>:<id>handle — pass this VERBATIM into a task's input field orGET /v1/files/{ref}.Example:
file:1234 - stringrequired
The PREVIEW image — the small copy where one exists, the image itself where it does not. It is for rendering the row; addressing the thing is
file's job. Empty when the row carries no image yet.Example:
https://files.refabric.com/thumb/1234.png - stringoptionalnullable
A human-readable name for a picker row; falls back to the kind. A
backgroundand aposehave none (their row is the image and its one word).Example:
Linen shirt - stringoptionalnullable
file(a product) only: your own id for it (SKU), when you gave one.Example:
SKU-1 - stringoptionalnullable
modelandposeonly: who is pictured, when known.Values
woman— An adult woman. When the person pictured is an adult woman.man— An adult man. When the person pictured is an adult man.girl— A girl (a child). When the person pictured is a girl.boy— A boy (a child). When the person pictured is a boy.
Example:
woman - stringoptionalnullable
modelonly, a style: the base model it is a style of (model:…).Example:
model:9f3c01 - stringoptionalnullable
backgroundonly: what the backdrop shows, when known.Values
scene— A photo of a place or setting. A shoot sets the model in this place.studio— A plain studio backdrop of one colour. A shoot puts the model on that exact colour, as a clean studio photo. When the photo is a plain one-colour backdrop (white, grey, beige) and you want studio shots on that colour.
Example:
studio - booleanoptionalnullable
Whether
DELETE /v1/files/{ref}deletes it: true forart:…of your own; any other answers422 file_not_deletable.Example:
true
- booleanrequired
Whether another page follows this one.
Example:
false - stringoptionalnullable
Send it back as
cursorfor the next page. Absent on the last page. Opaque: never build or edit one.Example:
eyJsIjoiY2hhbmdlbG9nIn0
- 400 — The request cannot be read as it was sent (a header, the URL or the body's form).
- 401 — No valid API key was sent.
- 403 — Your key or your plan does not allow this.
- 404 — Nothing has this address.
- 422 — A field is missing or has a value this operation cannot use.
- 429 — Too many requests: wait for the number of seconds in the Retry-After header.
- 500 — Something went wrong on our side; retry, and quote the request id if it keeps happening.