Skip to content

Create File

Create the specified files.

Verb PUT
Endpoint {base-url}/files/
Max Page Size N/A

Request Body

{
  "body": [
    {
      "id": 0,
      "organizationId": 1,
      "description": "Q3 planogram audit photo",
      "createdAtUtc": "2024-03-15T10:30:00Z",
      "machineId": 402,
      "fileKey": "6d02305c-81a5-4763-a51d-b91b41371487_audit-photo.jpg",
      "status": 1,
      "fileMetadata": [
        {
          "key": "type",
          "value": "jpg"
        }
      ]
    }
  ]
}

Note

All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.

Returns

On Success

Return the IDs of the created files.

Response Body

[
  2
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more files target an organizationId, or a machineId, you do not have access to.
404 MISSING_RECORD A machineId referenced by one or more files does not exist.
422 VALIDATION_ERROR A required field is missing or invalid (e.g. description is missing or exceeds 1000 characters, fileKey exceeds 1000 characters, status is missing, organizationId is less than 1).