import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const response = await client.v1Beta.customers.entities.upsert('id', {
entities: [
{
id: 'user-7f3a0c1d',
displayName: 'Jane Doe',
entityTypeId: 'user',
metadata: { email: 'jane@acme.com', role: 'admin' },
},
{
id: 'user-c4d1b2e9',
displayName: 'John Roe',
entityTypeId: 'user',
metadata: { email: 'john@acme.com' },
},
],
});
console.log(response.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
response = client.v1_beta.customers.entities.upsert(
id="id",
entities=[{
"id": "user-7f3a0c1d",
"display_name": "Jane Doe",
"entity_type_id": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin",
},
}, {
"id": "user-c4d1b2e9",
"display_name": "John Roe",
"entity_type_id": "user",
"metadata": {
"email": "john@acme.com"
},
}],
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1Beta.Customers.Entities.Upsert(
context.TODO(),
"id",
stigg.V1BetaCustomerEntityUpsertParams{
Entities: []stigg.V1BetaCustomerEntityUpsertParamsEntity{{
ID: "user-7f3a0c1d",
DisplayName: stigg.String("Jane Doe"),
EntityTypeID: stigg.String("user"),
Metadata: map[string]string{
"email": "jane@acme.com",
"role": "admin",
},
}, {
ID: "user-c4d1b2e9",
DisplayName: stigg.String("John Roe"),
EntityTypeID: stigg.String("user"),
Metadata: map[string]string{
"email": "john@acme.com",
},
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1beta.customers.entities.EntityUpsertParams;
import io.stigg.models.v1beta.customers.entities.EntityUpsertResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntityUpsertParams params = EntityUpsertParams.builder()
.id("id")
.addEntity(EntityUpsertParams.Entity.builder()
.id("user-7f3a0c1d")
.build())
.addEntity(EntityUpsertParams.Entity.builder()
.id("user-c4d1b2e9")
.build())
.build();
EntityUpsertResponse response = client.v1Beta().customers().entities().upsert(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
response = stigg.v1_beta.customers.entities.upsert("id", entities: [{id: "user-7f3a0c1d"}, {id: "user-c4d1b2e9"}])
puts(response)using System;
using System.Collections.Generic;
using Stigg.Client;
using Stigg.Client.Models.V1Beta.Customers.Entities;
StiggClient client = new();
EntityUpsertParams parameters = new()
{
ID = "id",
Entities =
[
new()
{
ID = "user-7f3a0c1d",
DisplayName = "Jane Doe",
EntityTypeID = "user",
Metadata = new Dictionary<string, string>()
{
{ "email", "jane@acme.com" }, { "role", "admin" }
},
},
new()
{
ID = "user-c4d1b2e9",
DisplayName = "John Roe",
EntityTypeID = "user",
Metadata = new Dictionary<string, string>()
{
{ "email", "john@acme.com" }
},
},
],
};
var response = await client.V1Beta.Customers.Entities.Upsert(parameters);
Console.WriteLine(response);stigg v1-beta:customers:entities upsert \
--api-key 'My API Key' \
--id id \
--entity '{id: user-7f3a0c1d}' \
--entity '{id: user-c4d1b2e9}'curl --request PUT \
--url https://api.stigg.io/api/v1-beta/customers/{id}/entities \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entities": [
{
"id": "user-7f3a0c1d",
"displayName": "Jane Doe",
"entityTypeId": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin"
}
},
{
"id": "user-c4d1b2e9",
"displayName": "John Roe",
"entityTypeId": "user",
"metadata": {
"email": "john@acme.com"
}
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1-beta/customers/{id}/entities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'entities' => [
[
'id' => 'user-7f3a0c1d',
'displayName' => 'Jane Doe',
'entityTypeId' => 'user',
'metadata' => [
'email' => 'jane@acme.com',
'role' => 'admin'
]
],
[
'id' => 'user-c4d1b2e9',
'displayName' => 'John Roe',
'entityTypeId' => 'user',
'metadata' => [
'email' => 'john@acme.com'
]
]
]
]),
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;
}{
"data": [
{
"id": "user-7f3a0c1d",
"displayName": "Jane Doe",
"entityTypeId": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin"
},
"createdAt": "2026-05-18T00:00:00.000Z",
"updatedAt": "2026-05-18T00:00:00.000Z",
"archivedAt": null
},
{
"id": "user-c4d1b2e9",
"displayName": "John Roe",
"entityTypeId": "user",
"metadata": {
"email": "john@acme.com"
},
"createdAt": "2026-05-18T00:00:00.000Z",
"updatedAt": "2026-05-18T00:00:00.000Z",
"archivedAt": null
}
]
}{
"message": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Upsert entities
Creates or updates entities in bulk for the given customer. Existing entities matched by id are updated; new ids are created.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const response = await client.v1Beta.customers.entities.upsert('id', {
entities: [
{
id: 'user-7f3a0c1d',
displayName: 'Jane Doe',
entityTypeId: 'user',
metadata: { email: 'jane@acme.com', role: 'admin' },
},
{
id: 'user-c4d1b2e9',
displayName: 'John Roe',
entityTypeId: 'user',
metadata: { email: 'john@acme.com' },
},
],
});
console.log(response.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
response = client.v1_beta.customers.entities.upsert(
id="id",
entities=[{
"id": "user-7f3a0c1d",
"display_name": "Jane Doe",
"entity_type_id": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin",
},
}, {
"id": "user-c4d1b2e9",
"display_name": "John Roe",
"entity_type_id": "user",
"metadata": {
"email": "john@acme.com"
},
}],
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1Beta.Customers.Entities.Upsert(
context.TODO(),
"id",
stigg.V1BetaCustomerEntityUpsertParams{
Entities: []stigg.V1BetaCustomerEntityUpsertParamsEntity{{
ID: "user-7f3a0c1d",
DisplayName: stigg.String("Jane Doe"),
EntityTypeID: stigg.String("user"),
Metadata: map[string]string{
"email": "jane@acme.com",
"role": "admin",
},
}, {
ID: "user-c4d1b2e9",
DisplayName: stigg.String("John Roe"),
EntityTypeID: stigg.String("user"),
Metadata: map[string]string{
"email": "john@acme.com",
},
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1beta.customers.entities.EntityUpsertParams;
import io.stigg.models.v1beta.customers.entities.EntityUpsertResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntityUpsertParams params = EntityUpsertParams.builder()
.id("id")
.addEntity(EntityUpsertParams.Entity.builder()
.id("user-7f3a0c1d")
.build())
.addEntity(EntityUpsertParams.Entity.builder()
.id("user-c4d1b2e9")
.build())
.build();
EntityUpsertResponse response = client.v1Beta().customers().entities().upsert(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
response = stigg.v1_beta.customers.entities.upsert("id", entities: [{id: "user-7f3a0c1d"}, {id: "user-c4d1b2e9"}])
puts(response)using System;
using System.Collections.Generic;
using Stigg.Client;
using Stigg.Client.Models.V1Beta.Customers.Entities;
StiggClient client = new();
EntityUpsertParams parameters = new()
{
ID = "id",
Entities =
[
new()
{
ID = "user-7f3a0c1d",
DisplayName = "Jane Doe",
EntityTypeID = "user",
Metadata = new Dictionary<string, string>()
{
{ "email", "jane@acme.com" }, { "role", "admin" }
},
},
new()
{
ID = "user-c4d1b2e9",
DisplayName = "John Roe",
EntityTypeID = "user",
Metadata = new Dictionary<string, string>()
{
{ "email", "john@acme.com" }
},
},
],
};
var response = await client.V1Beta.Customers.Entities.Upsert(parameters);
Console.WriteLine(response);stigg v1-beta:customers:entities upsert \
--api-key 'My API Key' \
--id id \
--entity '{id: user-7f3a0c1d}' \
--entity '{id: user-c4d1b2e9}'curl --request PUT \
--url https://api.stigg.io/api/v1-beta/customers/{id}/entities \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entities": [
{
"id": "user-7f3a0c1d",
"displayName": "Jane Doe",
"entityTypeId": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin"
}
},
{
"id": "user-c4d1b2e9",
"displayName": "John Roe",
"entityTypeId": "user",
"metadata": {
"email": "john@acme.com"
}
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1-beta/customers/{id}/entities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'entities' => [
[
'id' => 'user-7f3a0c1d',
'displayName' => 'Jane Doe',
'entityTypeId' => 'user',
'metadata' => [
'email' => 'jane@acme.com',
'role' => 'admin'
]
],
[
'id' => 'user-c4d1b2e9',
'displayName' => 'John Roe',
'entityTypeId' => 'user',
'metadata' => [
'email' => 'john@acme.com'
]
]
]
]),
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;
}{
"data": [
{
"id": "user-7f3a0c1d",
"displayName": "Jane Doe",
"entityTypeId": "user",
"metadata": {
"email": "jane@acme.com",
"role": "admin"
},
"createdAt": "2026-05-18T00:00:00.000Z",
"updatedAt": "2026-05-18T00:00:00.000Z",
"archivedAt": null
},
{
"id": "user-c4d1b2e9",
"displayName": "John Roe",
"entityTypeId": "user",
"metadata": {
"email": "john@acme.com"
},
"createdAt": "2026-05-18T00:00:00.000Z",
"updatedAt": "2026-05-18T00:00:00.000Z",
"archivedAt": null
}
]
}{
"message": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
The customer identifier (owner) the entities belong to
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$Body
Request body for creating or updating entities in bulk for a single customer
List of entities to create or update (1-100 entries)
1 - 100 elementsShow child attributes
Show child attributes
Response
The list of upserted entity objects.
List of entities created or updated by an upsert request
Show child attributes
Show child attributes
Related topics
Upsert entity typesUpsert assignmentsSetting up governanceArchive entitiesUnarchive entities