curl --request POST \
--url https://api.spirii.com/emsp/v1/token-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"metadata": {},
"network_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups"
payload = {
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"metadata": {},
"network_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
emsp_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
external_id: '<string>',
metadata: {},
network_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.spirii.com/emsp/v1/token-groups', 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.spirii.com/emsp/v1/token-groups",
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([
'name' => '<string>',
'description' => '<string>',
'emsp_identity_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'external_id' => '<string>',
'metadata' => [
],
'network_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.spirii.com/emsp/v1/token-groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.spirii.com/emsp/v1/token-groups")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"token_count": 1,
"status_summary": {
"provisioned": 1,
"active": 1,
"suspended": 1,
"expired": 1,
"revoked": 1
},
"audit": {
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"description": "<string>",
"external_id": "<string>",
"metadata": {},
"network_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}Create token group
Creates an empty token group, optionally assigning networks to it straight away.
Requires the emsp:tokens:write scope.
curl --request POST \
--url https://api.spirii.com/emsp/v1/token-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"metadata": {},
"network_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups"
payload = {
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"metadata": {},
"network_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
emsp_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
external_id: '<string>',
metadata: {},
network_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.spirii.com/emsp/v1/token-groups', 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.spirii.com/emsp/v1/token-groups",
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([
'name' => '<string>',
'description' => '<string>',
'emsp_identity_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'external_id' => '<string>',
'metadata' => [
],
'network_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.spirii.com/emsp/v1/token-groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.spirii.com/emsp/v1/token-groups")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"external_id\": \"<string>\",\n \"metadata\": {},\n \"network_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "<string>",
"emsp_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"token_count": 1,
"status_summary": {
"provisioned": 1,
"active": 1,
"suspended": 1,
"expired": 1,
"revoked": 1
},
"audit": {
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"description": "<string>",
"external_id": "<string>",
"metadata": {},
"network_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
- Token URL
- https://auth.spirii.dk/realms/public-api/protocol/openid-connect/token
Headers
Client-generated unique key per operation intent (UUID). Same key + identical body replays the original response; same key + different body returns 409.
Body
Display name of the group
1 - 255Free-text description of the group
1000The EMSP identity the group belongs to. Leave it out or send null for the tenant's default identity
Your own identifier for the group. Filterable, never interpreted, and not required to be unique
1 - 255Name/value pairs to attach to the group
Networks to assign to the group on creation
100Response
The created group
Stable token group id
Owning tenant, set by the platform
The EMSP identity the group belongs to. Null means the tenant's default identity
1 - 255Number of member tokens
x >= 0Number of member tokens in each status. The counts add up to token_count
Show child attributes
Show child attributes
Show child attributes
Show child attributes
1000Your own identifier for the group. Filterable, never interpreted, and not required to be unique
255Name/value pairs you attach to the group
Networks assigned to the group. Managed through the network assignment operations
Was this page helpful?