POST /v1/brand_assets
Uploads a logo, a page photo or a tab icon; the image is the request body. Needs brand_profiles.create .
Logo (the default): PNG or SVG, at most 1 MB (413 logo_too_large ), drawn into a PNG that fits 200 × 48 CSS pixels at 3×, with no metadata. A file that is not what its type says is 415 logo_type_unsupported ; an unsafe SVG is 400 logo_svg_unsafe . The same picture again answers 200 with the logo you already have.
Photo (kind=image): JPEG, PNG or WebP, at most 5 MB (413 image_too_large ) and at least 640 × 320 pixels (400 image_too_small ). It is turned the right way up and drawn into two WebP renditions, at most 1600 and 800 pixels wide, with no metadata; the upload itself is not kept.
Icon (kind=icon): a square PNG of at least 180 × 180 pixels (400 icon_too_small ) or a square SVG, at most 1 MB (413 icon_too_large ), drawn into 180 and 32 pixel PNGs.
Query parameters
One of logo image icon
Default "logo"
Body image/png The request body is the file itself (image/png, image/svg+xml, image/jpeg, image/webp).
Returns 200 application/json . The organisation already had this logo. See the BrandAsset object .
201 application/json . Uploaded. See the BrandAsset object .
Errors have one shape; see Errors for every code.
Example Try it
Code language cURL Node.js Python C# Java PHP
Request
curl -X POST "https://api.parasend.com/v1/brand_assets" \
-H "Authorization: Bearer $PARASEND_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: image/png" \
--data-binary @logo.pngimport { readFile } from 'node:fs/promises' ;
const res = await fetch('https://api.parasend.com/v1/brand_assets' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${process.env.PARASEND_KEY}` ,
'Idempotency-Key' : crypto.randomUUID(),
'Content-Type' : 'image/png' ,
},
body: await readFile('logo.png' ),
});
const data = await res.json();import os, requests, uuid
res = requests.post(
"https://api.parasend.com/v1/brand_assets" ,
headers={
"Authorization" : f"Bearer {os.environ['PARASEND_KEY']}" ,
"Idempotency-Key" : str(uuid.uuid4()),
"Content-Type" : "image/png" ,
},
data=open("logo.png" , "rb" ).read(),
)
data = res.json()using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.parasend.com/v1/brand_assets" );
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer" , Environment.GetEnvironmentVariable("PARASEND_KEY" ));
request.Headers.Add("Idempotency-Key" , Guid.NewGuid().ToString());
request.Content = new ByteArrayContent(File.ReadAllBytes("logo.png" ));
request.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png" );
var response = await http.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();var request = HttpRequest.newBuilder(URI.create("https://api.parasend.com/v1/brand_assets" ))
.header("Authorization" , "Bearer " + System.getenv("PARASEND_KEY" ))
.header("Idempotency-Key" , UUID.randomUUID().toString())
.header("Content-Type" , "image/png" )
.method("POST" , HttpRequest.BodyPublishers.ofFile(Path.of("logo.png" )))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());$client = new GuzzleHttp\Client();
$response = $client->request('POST' , 'https://api.parasend.com/v1/brand_assets' , [
'headers' => [
'Authorization' => 'Bearer ' . getenv('PARASEND_KEY' ),
'Idempotency-Key' => bin2hex(random_bytes(16 )),
'Content-Type' => 'image/png' ,
],
'body' => fopen('logo.png' , 'r' ),
]);
$data = json_decode($response->getBody(), true );
Response · 200
application/json