Upload Files

View as Markdown
## Upload Files Uploads one or more files to a specific folder. **Method:** `POST` **URL:** `{{base_url}}/files` --- ## Authentication This endpoint requires authentication. - **Recommended:** Bearer token in the `Authorization` header: ``` http Authorization: Bearer {{access_token}} ``` Notes: - If your collection/folder already sets auth, this request can **inherit auth**. - Ensure `{{access_token}}` is a valid, non-expired token. --- ## Required variables Set these variables at the **environment** or **collection** level: | Variable | Required | Description | | --- | --- | --- | | `base_url` | Yes | Base API URL (e.g. `https://busness.me-mate.net/partners/wp-gallery/manage`) | | `access_token` | Yes | Access token used to authorize the request | | `folder_id` | Yes | Target folder ID to upload into | --- ## Body (multipart/form-data) Send as **form-data** (`multipart/form-data`). | Field | Type | Required | Description | | --- | --- | --- | --- | | `files[]` | file | Yes | One or more files to upload. Use the same key (`files[]`) for each file. | | `folder_id` | text | Yes | Folder identifier. Usually set as `{{folder_id}}`. | ### Multiple files To upload multiple files, add **multiple rows** with the same key `files[]` (each row is of type **File**) and choose a file for each. --- ## Sample request ``` bash curl --request POST "{{base_url}}/files" \ --header "Authorization: Bearer {{access_token}}" \ --form "folder_id={{folder_id}}" \ --form "files[]=@/path/to/file1.png" \ --form "files[]=@/path/to/file2.jpg" ``` --- ## Sample success response (shape) A successful upload typically returns **HTTP 201 Created** and a JSON response. Example shape: ``` json { "status": "Created", "id": "<upload_or_resource_id>", "name": "Upload Files" } ``` --- ## Common errors - **400 Bad Request** - Missing `folder_id` - No `files[]` provided - Invalid multipart/form-data formatting - **401 Unauthorized / 403 Forbidden** - Missing/invalid `Authorization` header - Expired `{{access_token}}` - **413 Payload Too Large** - Uploaded file(s) exceed server limits - **415 Unsupported Media Type** - Request not sent as `multipart/form-data` --- ## Notes: uploading files in Postman - In **Body → form-data**: - Set `files[]` row **Type** to **File** and select a file from your computer. - Keep `folder_id` as **Text** (e.g. `{{folder_id}}`). - Do **not** manually set the `Content-Type: multipart/form-data` header; Postman will set it (including the boundary) automatically. - If you run this in a Runner/Monitor, ensure the executing context has access to the referenced files (file selection is local to the client session on web/desktop).

Request

This endpoint expects a multipart form containing a file.
files[]fileRequired
folder_idstringRequired

Response

Created
datalist of objects
messagestring
successboolean