> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.driver.olycab.in/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.driver.olycab.in/_mcp/server.

# Upload Multiple Images (Batch Cloudinary Upload)

GET https://driver/#get5

# Upload Multiple Images (Batch Cloudinary Upload)

Uploads multiple images in a single batch request to Cloudinary storage. Returns an array of uploaded image details with direct URLs and any failed uploads with error reasons.

***

### Endpoint Overview

* **Method:** `POST`

* **Route:** `/api/v1/upload/multiple`

* **Authentication:** `None (Public)`

* **Content-Type:** `multipart/form-data`

***

### Request Headers

| Header         | Type     | Required | Description                   |
| -------------- | -------- | -------- | ----------------------------- |
| `Content-Type` | `string` | **Yes**  | Must be `multipart/form-data` |

***

### Request Body Schema (`multipart/form-data`)

| Form Field | Data Type              | Required | Default     | Allowed Values / Constraints                                                                                | Description                         |
| ---------- | ---------------------- | -------- | ----------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `images`   | `Files (Binary Array)` | **Yes**  | —           | Max: 10 files, 10MB per file.  Allowed: `.jpg`, `.jpeg`, `.png`, `.webp`, `.gif`, `.avif`, `.heic`, `.heif` | Repeat `images` field for each file |
| `folder`   | `text`                 | No       | `"uploads"` | e.g. `"vehicles"`, `"documents"`                                                                            | Cloudinary destination folder       |

***

### Response Body Schema (`201 Created` / `207 Multi-Status`)

| Top-Level Key | Data Type | Description                                                            |
| ------------- | --------- | ---------------------------------------------------------------------- |
| `success`     | `boolean` | `true` if all files uploaded without error, `false` if any file failed |
| `uploaded`    | `array`   | List of successfully uploaded images                                   |
| `failed`      | `array`   | List of files that failed to upload with error descriptions            |

#### `` `uploaded` Item Fields ``

| Field      | Data Type | Description                         |
| ---------- | --------- | ----------------------------------- |
| `url`      | `string`  | Secure HTTPS Cloudinary URL         |
| `publicId` | `string`  | Unique Cloudinary public ID         |
| `width`    | `integer` | Width in pixels                     |
| `height`   | `integer` | Height in pixels                    |
| `format`   | `string`  | File format (e.g. `"jpg"`, `"png"`) |
| `bytes`    | `integer` | File size in bytes                  |

#### `` `failed` Item Fields ``

| Field          | Data Type | Description                      |
| -------------- | --------- | -------------------------------- |
| `originalName` | `string`  | File name as submitted by client |
| `error`        | `string`  | Failure error message            |

***

### `Response Examples`

#### ``1. `201 Created` — All Images Uploaded Successfully``

```json
{
  "success": true,
  "uploaded": [
    {
      "url": "https://res.cloudinary.com/goride/image/upload/v1758429900/vehicles/car_front.jpg",
      "publicId": "vehicles/car_front",
      "width": 1920,
      "height": 1080,
      "format": "jpg",
      "bytes": 450120
    },
    {
      "url": "https://res.cloudinary.com/goride/image/upload/v1758429901/vehicles/car_back.jpg",
      "publicId": "vehicles/car_back",
      "width": 1920,
      "height": 1080,
      "format": "jpg",
      "bytes": 420800
    }
  ],
  "failed": []
}

```

#### ``2. `207 Multi-Status` — Partial Success (Some Succeeded, Some Failed)``

```json
{
  "success": false,
  "uploaded": [
    {
      "url": "https://res.cloudinary.com/goride/image/upload/v1758429900/vehicles/car_front.jpg",
      "publicId": "vehicles/car_front",
      "width": 1920,
      "height": 1080,
      "format": "jpg",
      "bytes": 450120
    }
  ],
  "failed": [
    {
      "originalName": "corrupted_file.png",
      "error": "Failed to upload file to Cloudinary"
    }
  ]
}

```

#### ``3. `400 Bad Request` — Missing `images` Form Field``

```json
{
  "success": false,
  "error": "No files provided (field name: 'images')"
}

```

#### ``4. `400 Bad Request` — Exceeded Maximum Files Limit (Max 10)``

```json
{
  "success": false,
  "error": "Too many files in one request."
}

```

#### ``5. `400 Bad Request` — Unsupported File Format``

```json
{
  "success": false,
  "error": "Unsupported file type \"application/pdf\". Allowed: image/jpeg, image/png, image/webp, image/gif, image/avif, image/heic, image/heif"
}

```

#### ``6. `502 Bad Gateway` — All Uploads Failed``

```json
{
  "success": false,
  "uploaded": [],
  "failed": [
    {
      "originalName": "file1.jpg",
      "error": "Cloudinary connection timeout"
    }
  ]
}

```

***

### `Status Codes Reference`

| HTTP Status Code       | Condition                                                                                   |
| ---------------------- | ------------------------------------------------------------------------------------------- |
| **`201 Created`**      | All images were uploaded successfully to Cloudinary.                                        |
| **`207 Multi-Status`** | Partial batch success — some files uploaded, others failed.                                 |
| **`400 Bad Request`**  | Missing `images` field, too many files (>10), file too large (>10MB), or invalid MIME type. |
| **`502 Bad Gateway`**  | All images in the batch failed to upload to Cloudinary.                                     |

Reference: https://docs.driver.olycab.in/oly-driver/utils/upload-multiple-images-batch-cloudinary-upload

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Examples

**SDK Code**

```python
import requests

url = "https://driver/#get5"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://driver/#get5';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://driver/#get5"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://driver/#get5")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://driver/#get5")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://driver/#get5', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://driver/#get5");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://driver/#get5")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```