How to manage API keys in SynetoOS 5

Written By Christian Castagna (Administrator)

Updated at January 23rd, 2025

→ Applies to: SynetoOS 5.x

 

Access API keys

Step 1. Login to SynetoOS GUI

Step 2. Click on the question mark in the top right-hand corner

 

Step 3. Click on View API explorer

You'll be redirected to Syneto Doorman

 

Step 4. Click on POST /api-keys

 

Add API keys

Step 1. Prepare this code with the information needed (replace <name>, <user>, <resource>, <network/subnet>, <validity> with the correct information)

{
  "name": "<name>",
  "owner": "<user>",
  "scopes": [
    {
      "resource": "<resource>",
      "permissions": [ "GET" ]
    }
  ],
  "allowed_networks": [ "<network/subnet>" ],
  "validity": "<validity>"
}

name: an arbitrary name representing the app that uses the API key. For monitoring purposes, the name could be “monitoring”;

owner: any name;

resource: specifies the API endpoint for which the key is intended. For monitoring purposes, the resource could be “prometeus”;

permissions: defines the allowed methods (GET, POST, DELETE). For monitoring purposes, the correct value is “GET”;

allowed_network: indicates the networks from which the connection is allowed, with the format “0.0.0.0/0”;

validity: specifies the number of days the key will remain valid, suffixed with “d”. For example “365d” (for one year).

EXAMPLE

{
  "name": "monitoring",
  "owner": "admin",
  "scopes": [
    {
      "resource": "/prometheus",
      "permissions": [ "GET" ]
    }
  ],
  "allowed_networks": [ "0.0.0.0/0" ],
  "validity": "1000d"
}

 

Get API keys

Step 1. Click on GET /api-keys/{name}

 

Step 2. Enter the name (the one used when the API key was added)

 

Step 3. Click on Try it out

 

Delete API keys

Step 1. Click on DELETE /api-keys/{name}

 

Step 2. Enter the name (the one used when the API key was added)

 

Step 3. Click on Try it out