Skip to content

Photo intake ​

6 operations. Paths are relative to https://api.frege.io.

The platform's library of photo labels ​

GET/v1/intake/labels

What a photo a customer sends can be classified as, in sets an environment uses whole (uz.tech_passport holds TF and TB): each label's code, the sentence a vision model is shown for it, the keywords that give it away in the text read from a photo, and its name per language. X (other) and U (unsure) are the system's own, in every environment.

Authentication: bearer token.

Responses

StatusDescriptionBody
200OKdata

This environment's photo intake ​

GET/v1/projects/{id}/intake

Which label sets the environment uses, its own labels, and its steps: for each step how its photos are classified (off, rules, rules_then_vision, vision) and its slots — the label a photo must be, the upstream field it is sent as, and its name for the person in uz and ru. labels lists what the configuration makes available, with X and U. Organization admin or a manager of the environment.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata

Save this environment's photo intake ​

PUT/v1/projects/{id}/intake

Replaces the configuration whole. enabled false keeps it but turns the intake off (photos are read as without one); absent is on. Refused with 422, by the path of the field at fault (labels.use.0, steps.1.slots.0.label), for: a set not in the library; a label of its own named X or U, or with a malformed code, or with no description; a slot of a label the environment does not have, of X or U, of a label another step already has, with a malformed or repeated field, or without a name in uz and ru; a step key malformed or repeated; a classify mode not one of off, rules, rules_then_vision, vision; rules on a step none of whose labels has keywords. A label of its own with the code of a used library label refines it: its description replaces the library's, its keywords are added. Send version to save over that version only (409 if it changed). Organization admin or a manager of the environment.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.intakeConfigRequest.

FieldTypeDescription
labelsintake.LabelsConfig
stepsintake.Step[]
versionintegerVersion is the one this save was made over: a save over an older one is refused with 409. 0 saves over whatever is there.

Responses

StatusDescriptionBody
200OKdata
409Conflicterror envelope
422Unprocessable Entityerror envelope

Remove this environment's photo intake ​

DELETE/v1/projects/{id}/intake

Photos are then kept and read as before, without being classified or put in slots. Organization admin or a manager of the environment.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope

The calls a photo intake step can send photos to ​

GET/v1/projects/{id}/intake/operations

The environment's API calls whose body has photo fields (format byte or binary, image media types or none), by path, each with those fields by body path — the operation and fields a step and its slots may name. Empty without a spec. Organization admin or a manager of the environment.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata

Set how long this environment keeps what it read from photos ​

PUT/v1/projects/{id}/photo-retention

A photo a customer sends in Telegram is never stored: Frege keeps the text read from it and the file id its bot can fetch it by again. This sets how many days those outlive the conversation's last activity — 30 by default — after which both are cleared and a tool call naming the photo is told to ask for it again. Organization admin or a manager of the environment.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.photoRetentionRequest.

FieldTypeDescription
daysinteger

Responses

StatusDescriptionBody
200OKdata
422Unprocessable Entityerror envelope