Skip to main content

Central API Examples

In the examples below use the following placeholder variables to match commonly-needed parameters:

  • $ZT_TOKEN: an API token associated with an active account on Central
  • $NWID: an active network ID

See the Central API Tokens guide for an explanation of how to create and manage API tokens.

Exporting Data from the Central API

The examples below are intended to run in a system terminal, and require the following command-line tools:

Each of them will fetch network information and produce CSV as output. You can then import that CSV into your choice of database, spreadsheet, or configuration-management tool(s).

List current networks

curl -s -H "Authorization: token $ZT_TOKEN" \
"" \
| jq '.[] | [
]' \
| jq -rs '.[] | @csv'

Authorize and Deauthorize Network Members

Authorize a network member

curl -H "Authorization: token $ZT_TOKEN" -X POST \
"$NWID/member/$MEMBER_ID" \
--data '{"config": {"authorized": true}}'