For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Pular para o conteúdo

/assets/upload

Stores an image in the database. Only JPEG, PNG or BMP images are accepted; any other content is rejected with 400. The collection collectionId must exist. The image becomes associated with a specimen when it is created with POST /faces. The file field is sent as a binary file in a multipart/form-data part, like any other field of an HTML form with a file input - it is not a text field and does not require encoding (neither base64 nor hexadecimal).

Example with curl:

curl -F "[email protected]" -F "collectionId=bank01_collection01" -F "mimeType=image/jpeg" http://127.0.0.1:6982/assets/upload
post
Autorizações
AuthorizationstringObrigatório

JWT signed with HS256 (shared secret auth_jwt_secret) and with a non-expired exp claim; if it includes nbf, it must be currently valid. Only applied if auth_enabled is true and auth_accept_authorization_header is true. The Bearer scheme is case-insensitive.

Corpo

Body for the asset upload request in multipart/form-data

filestring · binaryObrigatório

Binary image data in JPEG, PNG or BMP format, sent or received as is (not encoded in base64 or in any other text format).

collectionIdstring · mín: 1Obrigatório

An identifier that allows grouping different images or biometric templates in a common space. It can only contain ASCII letters (A-Z, a-z), digits (0-9), underscore (_) and hyphen (-); it cannot be empty and it is case-sensitive. The following are not allowed: spaces, dots, +, :, @, quotes, %, ~, /, or non-ASCII characters (ñ, accents, emoji...): the identifier is used as a path parameter and any other character prevents its use. It must correspond to a collection previously created with POST /collections.

Example: bank01_collection01Pattern: ^[A-Za-z0-9_-]+$
mimeTypestringOpcional

Identifier of the file format (image/jpeg, image/png or image/bmp). If not included, it defaults to 'image/jpeg'. It is the value that will be returned as Content-Type when the image is downloaded.

Example: image/jpeg
Respostas
200

The result of the upload.

application/json

Media upload response. The identifier is returned in id (elsewhere in the API this same value is called mediaId).

idstringOpcional

An identifier of an image in the database. Each image is associated with a single specimen (face): the uploaded image becomes associated when the face is created with POST /faces and it is deleted together with it (DELETE /faces/{Id}) or together with its collection (DELETE /collections/{collectionId}).

Example: 9c79c818-b81a-4959-b65a-a2b0c8143528
post/assets/upload
POST /assets/upload HTTP/1.1
Host: 127.0.0.1:6982/
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 78

{
  "file": "binary",
  "collectionId": "bank01_collection01",
  "mimeType": "image/jpeg"
}
{
  "id": "9c79c818-b81a-4959-b65a-a2b0c8143528"
}

Atualizado