Users
Create or update a user
Create or update one of your users by external_user_id from your backend. Sending an ID again updates it; omitted fields stay. Uses the secret key.
POST
/
v1
/
users
Create or update a user
curl --request POST \
--url https://api.peeve.ai/v1/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "user_8412",
"email": "dana@example.com",
"name": "Dana Whitfield",
"company": "Example Corp",
"plan": "Growth",
"created_at": "2026-02-14T09:31:00Z",
"attributes": {
"seats": 12,
"role": "admin"
}
}
'import requests
url = "https://api.peeve.ai/v1/users"
payload = {
"external_user_id": "user_8412",
"email": "dana@example.com",
"name": "Dana Whitfield",
"company": "Example Corp",
"plan": "Growth",
"created_at": "2026-02-14T09:31:00Z",
"attributes": {
"seats": 12,
"role": "admin"
}
}
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({
external_user_id: 'user_8412',
email: 'dana@example.com',
name: 'Dana Whitfield',
company: 'Example Corp',
plan: 'Growth',
created_at: '2026-02-14T09:31:00Z',
attributes: {seats: 12, role: 'admin'}
})
};
fetch('https://api.peeve.ai/v1/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.peeve.ai/v1/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([
'external_user_id' => 'user_8412',
'email' => 'dana@example.com',
'name' => 'Dana Whitfield',
'company' => 'Example Corp',
'plan' => 'Growth',
'created_at' => '2026-02-14T09:31:00Z',
'attributes' => [
'seats' => 12,
'role' => 'admin'
]
]),
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.peeve.ai/v1/users"
payload := strings.NewReader("{\n \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\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.peeve.ai/v1/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peeve.ai/v1/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 \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000000",
"external_user_id": "user_8412",
"workspace": "example-corp"
}{
"error": "external_user_id is required"
}{
"error": "a secret key (sk_*) is required"
}{
"error": "could not store user"
}{
"error": "<string>",
"reason": "<string>"
}Authorizations
Body
application/json
⌘I
Create or update a user
curl --request POST \
--url https://api.peeve.ai/v1/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "user_8412",
"email": "dana@example.com",
"name": "Dana Whitfield",
"company": "Example Corp",
"plan": "Growth",
"created_at": "2026-02-14T09:31:00Z",
"attributes": {
"seats": 12,
"role": "admin"
}
}
'import requests
url = "https://api.peeve.ai/v1/users"
payload = {
"external_user_id": "user_8412",
"email": "dana@example.com",
"name": "Dana Whitfield",
"company": "Example Corp",
"plan": "Growth",
"created_at": "2026-02-14T09:31:00Z",
"attributes": {
"seats": 12,
"role": "admin"
}
}
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({
external_user_id: 'user_8412',
email: 'dana@example.com',
name: 'Dana Whitfield',
company: 'Example Corp',
plan: 'Growth',
created_at: '2026-02-14T09:31:00Z',
attributes: {seats: 12, role: 'admin'}
})
};
fetch('https://api.peeve.ai/v1/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.peeve.ai/v1/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([
'external_user_id' => 'user_8412',
'email' => 'dana@example.com',
'name' => 'Dana Whitfield',
'company' => 'Example Corp',
'plan' => 'Growth',
'created_at' => '2026-02-14T09:31:00Z',
'attributes' => [
'seats' => 12,
'role' => 'admin'
]
]),
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.peeve.ai/v1/users"
payload := strings.NewReader("{\n \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\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.peeve.ai/v1/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peeve.ai/v1/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 \"external_user_id\": \"user_8412\",\n \"email\": \"dana@example.com\",\n \"name\": \"Dana Whitfield\",\n \"company\": \"Example Corp\",\n \"plan\": \"Growth\",\n \"created_at\": \"2026-02-14T09:31:00Z\",\n \"attributes\": {\n \"seats\": 12,\n \"role\": \"admin\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000000",
"external_user_id": "user_8412",
"workspace": "example-corp"
}{
"error": "external_user_id is required"
}{
"error": "a secret key (sk_*) is required"
}{
"error": "could not store user"
}{
"error": "<string>",
"reason": "<string>"
}