> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.monite.com/v2024-01-31/api/entities/put-entities-id-logo/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server. # Upload an entity logo PUT https://api.sandbox.monite.com/v1/entities/{entity_id}/logo Content-Type: multipart/form-data Entity logo can be PNG, JPG, or GIF, up to 10 MB in size. The logo is used, for example, in PDF documents created by this entity. Reference: https://docs.monite.com/api/entities/put-entities-id-logo ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://api.sandbox.monite.com/v1` (sandbox, default) - `https://api.monite.com/v1` (eu_production) - `https://us.api.monite.com/v1` (na_production) ## Request ### Path parameters - `entity_id` (string, required) — A unique ID to specify the entity. ### Headers - `x-monite-version` (string, required) ### Body (multipart/form-data) This endpoint expects a multipart form containing a file. - `file` (file, required) ## Response ### 200 Successful Response - `id` (string, required) — A unique ID of this file. - `created_at` (datetime, required) — UTC date and time when this file was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - `file_type` (string, required) — The type of the business object associated with this file. - `md5` (string, required) — The MD5 hash of the file. - `mimetype` (string, required) — The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types). - `name` (string, required) — The original file name (if available). - `region` (string, required) — Geographical region of the data center where the file is stored. - `size` (integer, required) — The file size in bytes. - `url` (string, required) — The URL to download the file. - `pages` (list of PageSchema, optional) — If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array. - `previews` (list of PreviewSchema, optional) — Preview images generated for this file. There can be multiple images with different sizes. ## Errors ### 400 Put Entities ID Logo Request Bad Request Error Bad Request - `error` (ErrorSchema, required) ### 422 Put Entities ID Logo Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 500 Put Entities ID Logo Request Internal Server Error Internal Server Error - `error` (ErrorSchema, required) ## Types ### PageSchema When a PDF document is uploaded to Monite, it extracts individual pages from the document and saves them as PNG images. This object contains the image and metadata of a single page. - `id` (string, required) — A unique ID of the image. - `mimetype` (string, required) — The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types) of the image. - `number` (integer, required) — The page number in the PDF document, from 0. - `size` (integer, required) — Image file size, in bytes. - `url` (string, required) — The URL to download the image. ### PreviewSchema A preview image generated for a file. - `height` (integer, required) — The image height in pixels. - `url` (string, required) — The image URL. - `width` (integer, required) — The image width in pixels. ### ErrorSchema - `message` (string, required) ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItem ## Examples **Request** ```json { "file": ">" } ``` **Response** ```json { "id": "id", "created_at": "2024-01-15T09:30:00Z", "file_type": "payables", "md5": "31d1a2dd1ad3dfc39be849d70a68dac0", "mimetype": "application/pdf", "name": "invoice.pdf", "region": "eu-central-1", "size": 24381, "url": "https://bucketname.s3.amazonaws.com/12345/67890.pdf", "pages": [ { "id": "id", "mimetype": "image/png", "number": 0, "size": 21972, "url": "https://bucket.s3.amazonaws.com/123/456.png" } ], "previews": [ { "height": 400, "url": "https://bucketname.s3.amazonaws.com/1/2/3.png", "width": 200 } ] } ``` **SDK Code** ```python import requests url = "https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo" files = { "file": "open('', 'rb')" } headers = { "x-monite-version": "2024-01-31", "Authorization": "Bearer " } response = requests.put(url, files=files, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo'; const form = new FormData(); form.append('file', ''); const options = { method: 'PUT', headers: {'x-monite-version': '2024-01-31', Authorization: 'Bearer '} }; options.body = form; 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" "strings" "net/http" "io" ) func main() { url := "https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("x-monite-version", "2024-01-31") req.Header.Add("Authorization", "Bearer ") 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://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["x-monite-version"] = '2024-01-31' request["Authorization"] = 'Bearer ' request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo") .header("x-monite-version", "2024-01-31") .header("Authorization", "Bearer ") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php request('PUT', 'https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo', [ 'multipart' => [ [ 'name' => 'file', 'filename' => '', 'contents' => null ] ] 'headers' => [ 'Authorization' => 'Bearer ', 'x-monite-version' => '2024-01-31', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo"); var request = new RestRequest(Method.PUT); request.AddHeader("x-monite-version", "2024-01-31"); request.AddHeader("Authorization", "Bearer "); request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "x-monite-version": "2024-01-31", "Authorization": "Bearer " ] let parameters = [ [ "name": "file", "fileName": "" ] ] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/entities/ea837e28-509b-4b6a-a600-d54b6aa0b1f5/logo")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```