curl --request POST \
--url https://api.photalabs.com/v1/phota/profiles/tags \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"tags": [
{
"profile_id": "0ec2f38b1b5143de83f443266baa0027",
"tag": "user_abc123"
},
{
"profile_id": "f75b1445f7274a94836102a2ae4d67d5",
"tag": "user_def456"
}
]
}
'import requests
url = "https://api.photalabs.com/v1/phota/profiles/tags"
payload = { "tags": [
{
"profile_id": "0ec2f38b1b5143de83f443266baa0027",
"tag": "user_abc123"
},
{
"profile_id": "f75b1445f7274a94836102a2ae4d67d5",
"tag": "user_def456"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tags: [
{profile_id: '0ec2f38b1b5143de83f443266baa0027', tag: 'user_abc123'},
{profile_id: 'f75b1445f7274a94836102a2ae4d67d5', tag: 'user_def456'}
]
})
};
fetch('https://api.photalabs.com/v1/phota/profiles/tags', 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://api.photalabs.com/v1/phota/profiles/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
[
'profile_id' => '0ec2f38b1b5143de83f443266baa0027',
'tag' => 'user_abc123'
],
[
'profile_id' => 'f75b1445f7274a94836102a2ae4d67d5',
'tag' => 'user_def456'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.photalabs.com/v1/phota/profiles/tags"
payload := strings.NewReader("{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.photalabs.com/v1/phota/profiles/tags")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.photalabs.com/v1/phota/profiles/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": 123,
"already_tagged": [
"<string>"
],
"conflicts": [
{
"profile_id": "<string>",
"existing_tag": "<string>"
}
],
"not_found": [
"<string>"
]
}{
"detail": "<string>",
"code": "NO_IMAGE_GENERATED",
"request_id": "<string>"
}{
"detail": "<string>",
"code": "INTERNAL_ERROR",
"request_id": "<string>"
}Tag Profiles
Backfill tags onto existing profiles you own.
Sets each submitted tag only where the profile has no tag yet; existing tags are never overwritten. Every entry lands in exactly one response bucket, so partial application is normal and resubmitting the same mapping is safe.
curl --request POST \
--url https://api.photalabs.com/v1/phota/profiles/tags \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"tags": [
{
"profile_id": "0ec2f38b1b5143de83f443266baa0027",
"tag": "user_abc123"
},
{
"profile_id": "f75b1445f7274a94836102a2ae4d67d5",
"tag": "user_def456"
}
]
}
'import requests
url = "https://api.photalabs.com/v1/phota/profiles/tags"
payload = { "tags": [
{
"profile_id": "0ec2f38b1b5143de83f443266baa0027",
"tag": "user_abc123"
},
{
"profile_id": "f75b1445f7274a94836102a2ae4d67d5",
"tag": "user_def456"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tags: [
{profile_id: '0ec2f38b1b5143de83f443266baa0027', tag: 'user_abc123'},
{profile_id: 'f75b1445f7274a94836102a2ae4d67d5', tag: 'user_def456'}
]
})
};
fetch('https://api.photalabs.com/v1/phota/profiles/tags', 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://api.photalabs.com/v1/phota/profiles/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
[
'profile_id' => '0ec2f38b1b5143de83f443266baa0027',
'tag' => 'user_abc123'
],
[
'profile_id' => 'f75b1445f7274a94836102a2ae4d67d5',
'tag' => 'user_def456'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.photalabs.com/v1/phota/profiles/tags"
payload := strings.NewReader("{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.photalabs.com/v1/phota/profiles/tags")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.photalabs.com/v1/phota/profiles/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": [\n {\n \"profile_id\": \"0ec2f38b1b5143de83f443266baa0027\",\n \"tag\": \"user_abc123\"\n },\n {\n \"profile_id\": \"f75b1445f7274a94836102a2ae4d67d5\",\n \"tag\": \"user_def456\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": 123,
"already_tagged": [
"<string>"
],
"conflicts": [
{
"profile_id": "<string>",
"existing_tag": "<string>"
}
],
"not_found": [
"<string>"
]
}{
"detail": "<string>",
"code": "NO_IMAGE_GENERATED",
"request_id": "<string>"
}{
"detail": "<string>",
"code": "INTERNAL_ERROR",
"request_id": "<string>"
}Authorizations
Body
Request body for backfilling tags onto existing untagged profiles.
Profile-to-tag assignments to apply. Each profile may appear at most once.
1 - 1000 elementsShow child attributes
Show child attributes
Response
Successful Response
Per-outcome report for a tag-backfill request.
Every requested profile lands in exactly one bucket, so
updated + len(already_tagged) + len(conflicts) + len(not_found)
equals the number of submitted entries.
Number of profiles whose tag was set by this request.
Profiles that already carried the exact submitted tag (idempotent no-op).
Profiles that already carry a different tag; existing tags are never overwritten.
Show child attributes
Show child attributes
Profile ids that do not exist, are deleted, or are not owned by you.
