curl --request POST \
--url https://api.frigade.com/v1/public/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"email": "john@doe.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://example.com/john-doe.jpg"
},
"bootstrapFlowStates": true,
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
],
"linkGuestId": "<string>"
}
'import requests
url = "https://api.frigade.com/v1/public/users"
payload = {
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"email": "john@doe.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://example.com/john-doe.jpg"
},
"bootstrapFlowStates": True,
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
],
"linkGuestId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
properties: {
email: 'john@doe.com',
firstName: 'John',
lastName: 'Doe',
imageUrl: 'https://example.com/john-doe.jpg'
},
bootstrapFlowStates: true,
events: [
{
event: 'SignedUp',
properties: {source: 'landing-page', campaign: 'summer-sale'}
}
],
linkGuestId: '<string>'
})
};
fetch('https://api.frigade.com/v1/public/users', 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.frigade.com/v1/public/users",
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([
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'properties' => [
'email' => 'john@doe.com',
'firstName' => 'John',
'lastName' => 'Doe',
'imageUrl' => 'https://example.com/john-doe.jpg'
],
'bootstrapFlowStates' => true,
'events' => [
[
'event' => 'SignedUp',
'properties' => [
'source' => 'landing-page',
'campaign' => 'summer-sale'
]
]
],
'linkGuestId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.frigade.com/v1/public/users"
payload := strings.NewReader("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.frigade.com/v1/public/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreate or update a User
Create a user, add properties, and tracking events
curl --request POST \
--url https://api.frigade.com/v1/public/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"email": "john@doe.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://example.com/john-doe.jpg"
},
"bootstrapFlowStates": true,
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
],
"linkGuestId": "<string>"
}
'import requests
url = "https://api.frigade.com/v1/public/users"
payload = {
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"email": "john@doe.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://example.com/john-doe.jpg"
},
"bootstrapFlowStates": True,
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
],
"linkGuestId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
properties: {
email: 'john@doe.com',
firstName: 'John',
lastName: 'Doe',
imageUrl: 'https://example.com/john-doe.jpg'
},
bootstrapFlowStates: true,
events: [
{
event: 'SignedUp',
properties: {source: 'landing-page', campaign: 'summer-sale'}
}
],
linkGuestId: '<string>'
})
};
fetch('https://api.frigade.com/v1/public/users', 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.frigade.com/v1/public/users",
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([
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'properties' => [
'email' => 'john@doe.com',
'firstName' => 'John',
'lastName' => 'Doe',
'imageUrl' => 'https://example.com/john-doe.jpg'
],
'bootstrapFlowStates' => true,
'events' => [
[
'event' => 'SignedUp',
'properties' => [
'source' => 'landing-page',
'campaign' => 'summer-sale'
]
]
],
'linkGuestId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.frigade.com/v1/public/users"
payload := strings.NewReader("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.frigade.com/v1/public/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"email\": \"john@doe.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"imageUrl\": \"https://example.com/john-doe.jpg\"\n },\n \"bootstrapFlowStates\": true,\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ],\n \"linkGuestId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Authentication header of the form Bearer: <token>, where <token> is either your public or private API key. See when to use which
Body
The ID of the user as defined in your own application
"d34daa11-3745-4ac0-880e-d4b4d51fe13f"
Optional properties to add to the user
{
"email": "john@doe.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://example.com/john-doe.jpg"
}
If set to true, the user will automatically complete any eligible Flows with completionCriteria that have not already been completed. This is useful if a Flow has been recently updated with new steps and you want to ensure that historic users complete the new steps
Optional tracking events to add to the user
Show child attributes
Show child attributes
[
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
Merges a guest with a non-guest user. Only works if the provided linkGuestId is a guest user and the userId does not yet have any state in any Flows.
Response
The user has been successfully created or updated