Update token group
curl --request PATCH \
--url https://api.spirii.com/emsp/v1/token-groups/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "<string>"
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups/{groupId}"
payload = {
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', emsp_identity_id: '<string>'})
};
fetch('https://api.spirii.com/emsp/v1/token-groups/{groupId}', 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/{groupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'emsp_identity_id' => '<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.spirii.com/emsp/v1/token-groups/{groupId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.spirii.com/emsp/v1/token-groups/{groupId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups/{groupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "<string>",
"emsp_identity_id": "<string>",
"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>",
"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>"
}
]
}Update token group
Partially updates a group: fields left out are unchanged, and description can be cleared with null. Member tokens and networks are managed through their own operations, and any other field in the body is ignored.
Requires the emsp:tokens:write scope.
PATCH
/
emsp
/
v1
/
token-groups
/
{groupId}
Update token group
curl --request PATCH \
--url https://api.spirii.com/emsp/v1/token-groups/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "<string>"
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups/{groupId}"
payload = {
"name": "<string>",
"description": "<string>",
"emsp_identity_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', emsp_identity_id: '<string>'})
};
fetch('https://api.spirii.com/emsp/v1/token-groups/{groupId}', 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/{groupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'emsp_identity_id' => '<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.spirii.com/emsp/v1/token-groups/{groupId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.spirii.com/emsp/v1/token-groups/{groupId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups/{groupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"emsp_identity_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "<string>",
"emsp_identity_id": "<string>",
"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>",
"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.
Path Parameters
The token group group_id
Body
application/json
Response
The updated group
Stable token group id
Owning tenant, set by the platform
The EMSP identity the group belongs to
Required string length:
1 - 64Required string length:
1 - 255Number of member tokens
Required range:
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
Maximum string length:
1000Networks assigned to the group. Managed through the network assignment operations
Was this page helpful?