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.

GEThttps://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=true lists Refabric's own records instead of yours.
  • q searches files and models; base lists 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: 20

    Items 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

    model only: list the saved STYLES of one base model, as model:<id> (a style is passed into models[] like a model). Sent to another kind, it is refused.

    max length 100

  • booleanoptionalDefault: false

    For a structured-result kind (moodboard, fabric): list Refabric's own curated records instead of yours.

  • stringoptionalnullable

    Free-text filter for file and model; 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.

  • booleanrequired

    Whether another page follows this one.

    Example: false

  • stringoptionalnullable

    Send it back as cursor for 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.