I am using the ZeroTier Central API and I can change things like Network Name, Network Description, MTU etc, however I would like to add my colleagues to a network automatically.
I have found the [ZeroTier Central API | ZeroTier Documentation] for updateNetwork (ZeroTier Central API | ZeroTier Documentation) and this has a “permissions” property.
However ZT Central or the response does not reflect the changes I make.
Network 885033839019b072 To be updated via url https://api.zerotier.com/api/v1/network/885033839019b072
POST Body to be used
{
description: 'Dummy Description2',
config: { name: 'Dummy Name', private: false, mtu: null, tags: [ '' ] },
permissions: {
'0501dedc-20da-46e2-8b36-7a46ff75920c': { a: true, d: true, m: true, r: true },
'eab7efa4-0523-4e38-8f76-f74fde2a5125': { a: true, d: true, m: true, r: true }
}
}
Network 885033839019b072 updated. Response: 200/OK
{
id: '885033839019b072',
type: 'Network',
clock: 1696332065430,
config: {
authTokens: null,
creationTime: 1694418011397,
capabilities: [],
enableBroadcast: true,
id: '885033839019b072',
ipAssignmentPools: [ [Object] ],
lastModified: 1696332065395,
mtu: 2800,
multicastLimit: 32,
name: 'Dummy Name',
private: false,
remoteTraceLevel: 0,
remoteTraceTarget: null,
routes: [ [Object] ],
rules: [ [Object] ],
tags: [ '' ],
v4AssignMode: { zt: true },
v6AssignMode: { '6plane': false, rfc4193: false, zt: false },
dns: { domain: '', servers: null },
ssoConfig: { enabled: false, mode: '' }
},
description: 'Dummy Description2',
rulesSource: 'accept;',
permissions: {
'38852822-5922-4709-8283-5f72f7c2d6d5': { a: true, d: true, m: true, r: true },
'6ba92a3f-ed27-467a-bf69-52661e93473a': { a: true, d: true, m: true, r: true },
'eab7efa4-0523-4e38-8f76-f74fde2a5125': { a: true, d: true, m: true, r: true }
},
ownerId: 'eab7efa4-0523-4e38-8f76-f74fde2a5125',
onlineMemberCount: 0,
authorizedMemberCount: 0,
totalMemberCount: 0,
capabilitiesByName: {},
tagsByName: {},
ui: {
membersHelpCollapsed: true,
rulesHelpCollapsed: true,
settingsHelpCollapsed: true,
v4EasyMode: false
}
}
I would expect that the following user would be added, but it is not added.
'0501dedc-20da-46e2-8b36-7a46ff75920c'
I am able to update networks via the ZeroTier Central UI.
So I wonder - can anyone else make this work?
Br
Andreas