Upsert person
Create or update a person, keyed on the identifier you send (userId/external_id/user_id). Email is never used as the key. This is the same code path as POST /people; there is no was_created flag in the response.
curl -X POST "https://api.flameup.ai/api/v1/people/upsert" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"userId": "example_string",
"external_id": "example_string",
"user_id": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"timestamp": "2024-12-25T10:00:00Z"
}'
import requests
import json
url = "https://api.flameup.ai/api/v1/people/upsert"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"userId": "example_string",
"external_id": "example_string",
"user_id": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"timestamp": "2024-12-25T10:00:00Z"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.flameup.ai/api/v1/people/upsert", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"userId": "example_string",
"external_id": "example_string",
"user_id": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"timestamp": "2024-12-25T10:00:00Z"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"userId": "example_string",
"external_id": "example_string",
"user_id": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"timestamp": "2024-12-25T10:00:00Z"
}`)
req, err := http.NewRequest("POST", "https://api.flameup.ai/api/v1/people/upsert", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.flameup.ai/api/v1/people/upsert')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"userId": "example_string",
"external_id": "example_string",
"user_id": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"timestamp": "2024-12-25T10:00:00Z"
}'
response = http.request(request)
puts response.body
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"userId": "example_string"
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"userId": "example_string",
"email": "user@example.com",
"phone": "+1-555-0123",
"anonymousId": "example_string",
"traits": {},
"status": "active",
"unsubscribed_at": "2024-12-25T10:00:00Z",
"unsubscribe_reason": "example_string",
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
{
"success": false,
"error": "Person not found",
"code": "example_string"
}
{
"error": "Unauthorized",
"message": "Invalid or expired API key",
"details": "Please provide a valid API key in the Authorization header: Bearer <your_api_key>"
}
{
"success": false,
"error": {
"code": "example_string",
"message": "example_string",
"details": {}
}
}
{
"success": false,
"error": "Person not found",
"code": "example_string"
}
{
"error": "Unauthorized",
"message": "Invalid or expired API key",
"details": "Please provide a valid API key in the Authorization header: Bearer <your_api_key>"
}
{
"success": false,
"error": {
"code": "example_string",
"message": "example_string",
"details": {}
}
}
/people/upsert
Target server for requests. Edit to use your own host.
Your Flameup API key (passed as Bearer token)
The media type of the request body
Your own user id. external_id and user_id are accepted aliases. Send only one — if two are present and disagree the request is rejected rather than one being picked for you.
Anonymous id to merge into this person.
Merged with existing traits; new values win.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Your Flameup API key (passed as Bearer token)
Body
Your own user id. external_id and user_id are accepted aliases. Send only one — if two are present and disagree the request is rejected rather than one being picked for you.
Anonymous id to merge into this person.
Merged with existing traits; new values win.