When you make a request to TSManage using your API key, it's as though you are logged in and taking actions directly within the Management UI.
Required Permissions
Grant users a role with the "Manage API Keys" permission.
Once assigned, users can generate their own API keys.
Creating API Keys
Creating an API key is straightforward. Users will be shown their new API key once and must save it immediately, as it won't be retrievable later.
Basic Usage
Base URL: https://demo.tsmanage.com/public-api/v0/
The following headers are required in every request:
Content-Type: application/json
Authentication
Follows RFC 6750 standards, using the API key as the bearer token for authentication.
Endpoints
Retrieve bulk TeamSpeak server member information by client unique identifiers
Example usage to return info on two members:
GET /members?id=XXXXX=&id=YYYYY=
Returns:
Copy [
{
"cldbid" : 1 ,
"clientUniqueIdentifier" : "XXXXX=" ,
"clientNickname" : "John D. 1A-23" ,
"clientCreated" : 1234567890 ,
"clientLastconnected" : 2345678901 ,
"clientTotalconnections" : 150 ,
"serverGroups" : [
{
"name" : "Police Department" ,
"sgid" : 123
} ,
{
"name" : "Fire Department" ,
"sgid" : 456
}
]
} ,
{
"cldbid" : 2 ,
"clientUniqueIdentifier" : "YYYYY=" ,
"clientNickname" : "Jane D. 2B-45" ,
"clientCreated" : 1234567890 ,
"clientLastconnected" : 2345678901 ,
"clientTotalconnections" : 300 ,
"serverGroups" : [
{
"name" : "1 Year of Service" ,
"sgid" : 789
}
]
}
]
Bulk update server groups of TeamSpeak server members by client unique identifiers and server group IDs
Example usage to add and remove some server groups from three members:
PATCH /members/update-batch
Expects a body in the following schema:
Copy {
memberIds : {type : "array" , items : {type : "string" }} ,
serverGroupIdsToAdd : {type : "array" , items : {type : "integer" }} ,
serverGroupIdsToRemove : {type : "array" , items : {type : "integer" }}
}
Returns a result object with three properties: addedGroups
, removedGroups
, members
. The added and removed groups keys contain the fully-resolved groups represented by the IDs originally passed into the serverGroupIdsToAdd
and serverGroupIdsToRemove
fields respectively. The members
key contains an array of members that were affected by the request, with each member's new groups after the change.
Full working example:
Copy PATCH /public-api/v0/members/update-batch HTTP/1.1
Host : demo.tsmanage.com
Accept : application/json
Content-Type : application/json
Authorization : Bearer bbee15c15edff195727da659e607202913c2ff765fb44cb9734ee8be0f4152d7
Content-Length : 121
{
"memberIds" : [ "XXXXX=" , "YYYYY=" ] ,
"serverGroupIdsToAdd" : [ 123 ] ,
"serverGroupIdsToRemove" : [ 456 , 789 ]
}
Response example:
Copy {
"addedGroups" : [
{
"sgid" : "123" ,
"name" : "Sheriff's Office" ,
"type" : 1 ,
"iconid" : "123123123" ,
"savedb" : 1 ,
"sortid" : "123" ,
"namemode" : 0 ,
"nModifyp" : 1 ,
"nMemberAddp" : 2 ,
"nMemberRemovep" : 3 ,
"_namespace" : "servergroup"
}
] ,
"removedGroups" : [
{
"sgid" : "456" ,
"name" : "5 Years of Service" ,
"type" : 1 ,
"iconid" : "123123123" ,
"savedb" : 1 ,
"sortid" : "123" ,
"namemode" : 0 ,
"nModifyp" : 1 ,
"nMemberAddp" : 2 ,
"nMemberRemovep" : 3 ,
"_namespace" : "servergroup"
} ,
{
"sgid" : "789" ,
"name" : "Retired Fire Chief" ,
"type" : 1 ,
"iconid" : "123123123" ,
"savedb" : 1 ,
"sortid" : "123" ,
"namemode" : 1 ,
"nModifyp" : 1 ,
"nMemberAddp" : 2 ,
"nMemberRemovep" : 3 ,
"_namespace" : "servergroup"
}
] ,
"members" : [
{
"cldbid" : 1 ,
"clientUniqueIdentifier" : "XXXXX=" ,
"clientNickname" : "John D. 1A-23" ,
"clientCreated" : 1234567890 ,
"clientLastconnected" : 2345678901 ,
"clientTotalconnections" : 150 ,
"serverGroups" : [
// Note that sheriff's office has been added
{
"name" : "Sheriff's Office" ,
"sgid" : 123
} ,
{
"name" : "Fire Department" ,
"sgid" : 9999
}
]
} ,
{
"cldbid" : 2 ,
"clientUniqueIdentifier" : "YYYYY=" ,
"clientNickname" : "Jane D. 2B-45" ,
"clientCreated" : 1234567890 ,
"clientLastconnected" : 2345678901 ,
"clientTotalconnections" : 300 ,
"serverGroups" : [
// Note that sheriff's office has been added
{
"name" : "Sheriff's Office" ,
"sgid" : 123
} ,
{
"name" : "Highway Patrol" ,
"sgid" : 123123
} ,
{
"name" : "Retired Commissioner" ,
"sgid" : 456456456
}
]
}
]
}