Initiate a profile upload
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"profile_id": "<string>",
"upload_url": "<string>",
"upload_fields": {},
"upload_expires_in": 123
}Browser Profiles
Initiate a profile upload
Get a presigned URL to upload a browser profile archive.
POST
/
api
/
v2
/
browser-profiles
/
initiate-upload
Initiate a profile upload
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"profile_id": "<string>",
"upload_url": "<string>",
"upload_fields": {},
"upload_expires_in": 123
}Starts the profile upload flow.
Returns a presigned upload target so you can send the profile archive directly to object
storage, and the bytes never pass through the Agent API. No request body is required.
After uploading the archive, call
Complete upload with the returned
profile_id to finalize the profile.
Returns 200 with the presigned upload target.
upload_url and upload_fields are passed through from object storage unchanged, so send them exactly as returned, with the file as the last form field. They expire after upload_expires_in seconds.
Response
string
Id (UUID) reserved for the profile. Pass it to Complete upload.
string
Presigned object-storage URL to
POST the archive to.object
Form fields that must accompany the upload, sent before the file as
multipart/form-data.integer
Seconds until the presigned target expires.
Examples
curl -X POST https://agp.eu.hcompany.ai/api/v2/browser-profiles/initiate-upload \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
upload = client.browser_profiles.initiate_browser_profile_upload()
print(upload.profile_id, upload.upload_url)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const upload = await client.browserProfiles.initiateBrowserProfileUpload();
console.log(upload.profileId, upload.uploadUrl);
Response
{
"profile_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"upload_url": "https://storage.eu.hcompany.ai/browser-profiles",
"upload_fields": {
"key": "browser-profiles/pending/org_123/a1b2c3d4-5678-90ab-cdef-1234567890ab/profile.zip",
"Content-Type": "application/zip",
"x-amz-checksum-algorithm": "SHA256",
"tagging": "<Tagging><TagSet><Tag><Key>status</Key><Value>pending</Value></Tag></TagSet></Tagging>",
"bucket": "browser-profiles",
"policy": "eyJ...",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"x-amz-credential": "AKIA.../20260206/eu-west-1/s3/aws4_request",
"x-amz-date": "20260206T000000Z",
"x-amz-signature": "abcd1234"
},
"upload_expires_in": 3600
}
Last modified on September 11, 2026
Was this page helpful?