Skip to main content
PUT
/
api
/
v1-beta
/
entity-types
JavaScript
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.entityTypes.upsert({
  types: [
    {
      id: 'org',
      displayName: 'Organization',
      attributionKeys: ['organizationId'],
    },
    {
      id: 'team',
      displayName: 'Team',
      attributionKeys: ['teamId'],
    },
  ],
});

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.entity_types.upsert(
types=[{
"id": "org",
"display_name": "Organization",
"attribution_keys": ["organizationId"],
}, {
"id": "team",
"display_name": "Team",
"attribution_keys": ["teamId"],
}],
)
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.EntityTypes.Upsert(context.TODO(), stigg.V1BetaEntityTypeUpsertParams{
Types: []stigg.V1BetaEntityTypeUpsertParamsType{{
ID: "org",
DisplayName: "Organization",
AttributionKeys: []string{"organizationId"},
}, {
ID: "team",
DisplayName: "Team",
AttributionKeys: []string{"teamId"},
}},
})
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.entitytypes.EntityTypeUpsertParams;
import io.stigg.models.v1beta.entitytypes.EntityTypeUpsertResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();

EntityTypeUpsertParams params = EntityTypeUpsertParams.builder()
.addType(EntityTypeUpsertParams.Type.builder()
.id("org")
.addAttributionKey("organizationId")
.displayName("Organization")
.build())
.addType(EntityTypeUpsertParams.Type.builder()
.id("team")
.addAttributionKey("teamId")
.displayName("Team")
.build())
.build();
EntityTypeUpsertResponse response = client.v1Beta().entityTypes().upsert(params);
}
}
require "stigg"

stigg = Stigg::Client.new(api_key: "My API Key")

response = stigg.v1_beta.entity_types.upsert(
types: [
{id: "org", attributionKeys: ["organizationId"], displayName: "Organization"},
{id: "team", attributionKeys: ["teamId"], displayName: "Team"}
]
)

puts(response)
using System;
using Stigg.Client;
using Stigg.Client.Models.V1Beta.EntityTypes;

StiggClient client = new();

EntityTypeUpsertParams parameters = new()
{
Types =
[
new()
{
ID = "org",
AttributionKeys =
[
"organizationId"
],
DisplayName = "Organization",
},
new()
{
ID = "team",
AttributionKeys =
[
"teamId"
],
DisplayName = "Team",
},
],
};

var response = await client.V1Beta.EntityTypes.Upsert(parameters);

Console.WriteLine(response);
stigg v1-beta:entity-types upsert \
--api-key 'My API Key' \
--type '{id: org, attributionKeys: [organizationId], displayName: Organization}' \
--type '{id: team, attributionKeys: [teamId], displayName: Team}'
curl --request PUT \
--url https://api.stigg.io/api/v1-beta/entity-types \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"types": [
{
"id": "org",
"displayName": "Organization",
"attributionKeys": [
"organizationId"
]
},
{
"id": "team",
"displayName": "Team",
"attributionKeys": [
"teamId"
]
}
]
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1-beta/entity-types",
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([
'types' => [
[
'id' => 'org',
'displayName' => 'Organization',
'attributionKeys' => [
'organizationId'
]
],
[
'id' => 'team',
'displayName' => 'Team',
'attributionKeys' => [
'teamId'
]
]
]
]),
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": "org",
      "displayName": "Organization",
      "attributionKeys": [
        "organizationId"
      ],
      "createdAt": "2026-05-18T10:00:00.000Z",
      "updatedAt": "2026-05-18T10:00:00.000Z"
    }
  ]
}
{
"message": "<string>"
}
{
"message": "<string>",
"code": "Unauthenticated"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>",
"code": "RateLimitExceeded"
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-ID
string

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).

Body

application/json

Batched create-or-update of entity types. Idempotent — re-submitting the same payload converges.

types
UpsertEntityType · object[]
required

Entity types to upsert (1–100 per request)

Required array length: 1 - 100 elements

Response

Entity types after upsert.

Entity types after upsert.

data
EntityType · object[]
required