Upload Assets
November 17, 2025
Table of contents
Upload assets to Google Flow. Currently supported formats are PNG and JPEG with a maximum file size of 20 MB.
| Content-Type | File Extension |
|---|---|
| image/png | png |
| image/jpeg | jpeg |
POST raw content using Make.com and similar nocode tools.
https://api.useapi.net/v1/google-flow/assets/
Request Headers
Authorization: Bearer {API token}
Content-Type: select from the table above
API tokenis required, see Setup useapi.net for details.Content-Typeis required, see table above.
Path Parameters
emailis required. The email address of the Google Flow account to use (URL-encoded if necessary).
Request Body
Binary image content (raw bytes).
Responses
-
Image uploaded successfully. Returns the media generation ID with reference ID and image dimensions.
{ "mediaGenerationId": { "mediaGenerationId": "...redacted..." }, "width": 685, "height": 900 }mediaGenerationId.mediaGenerationId- Reference ID for use in subsequent API calls (format:user:{userid}-email:{hex_encoded_email}-image:{internal_media_id})width- Image width in pixelsheight- Image height in pixels
-
Invalid request (empty content, unsupported content type, file too large, or content policy violation).
General error:
{ "error": "File size (25165824) is over 20971520 bytes" }Content policy error:
{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "PUBLIC_ERROR_TRUMP_FACE_DETECTED" } ] } } -
Invalid API token.
{ "error": "Unauthorized" } -
Account not found or not configured.
{ "error": "Google Flow account [email protected] not found" }
Model
{
mediaGenerationId: {
mediaGenerationId: string // Reference ID: user:{userid}-email:{hex_encoded_email}-image:{internal_media_id}
}
width: number // Image width in pixels
height: number // Image height in pixels
error?: string | { // Error: string (useapi.net) or object (Google API)
code: number
message: string
status: string
details: Array<{
'@type': string
reason: string
}>
}
}
Examples
-
curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: image/jpeg" \ --data-binary @/path/to/your/image.jpeg \ "https://api.useapi.net/v1/google-flow/assets/john%40gmail.com" -
const token = 'YOUR_API_TOKEN'; const email = '[email protected]'; const apiUrl = `https://api.useapi.net/v1/google-flow/assets/${encodeURIComponent(email)}`; // Example 1: Fetch image from URL const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7d/Mona_Lisa_color_restoration.jpg"; const responseImage = await fetch(imageUrl); const blob = await responseImage.blob(); // # Example 2: Load image from local file (Node.js) // const fsp = require('fs').promises; // const imageFileName = "./cat.png"; // const blob = new Blob([await fsp.readFile(imageFileName)]); // # Example 3: Load from input file html element // // <input id="image-file" type="file"> // const imageFile = document.getElementById('image-file'); // const blob = imageFile.files[0]; const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': blob.type || 'image/jpeg' }, body: blob }); const result = await response.json(); console.log('Upload result:', result); console.log('Reference ID:', result.mediaGenerationId.mediaGenerationId); -
import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' email = '[email protected]' # # Example 1: Fetch image from URL # image_url = "https://upload.wikimedia.org/wikipedia/commons/7/7d/Mona_Lisa_color_restoration.jpg" # response_image = requests.get(image_url) # file_content = response_image.content # # Example 2: Load image from local file # image_file_path = "./image.jpg" # with open(image_file_path, 'rb') as image_file: # file_content = image_file.read() headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'image/jpeg' } response = requests.post( f'https://api.useapi.net/v1/google-flow/assets/{quote(email)}', headers=headers, data=file_content ) result = response.json() print('Upload result:', result) print('Reference ID:', result.get('mediaGenerationId', {}).get('mediaGenerationId'))