# Flock API Keys

Create a new Flock specific API key.

# Add Flock API Keys

POST /api/v1/flock/auth_token/add

Create a new Flock specific API key.

Required Parameters

auth_token string
A valid auth token
flock_id string
A valid flock_id
note string
A note for the Flock API key on who/where it is used.

Optional Parameters

auth_token_type string
The access level of the key. Either 'read-only', 'analyst', or 'admin'

Response

A JSON structure with the new Flock API Key.

Example

    Response
    {
      "flock_api_key": {
        "auth_token": "<flock_auth_token>",
        "auth_token_type": "admin",
        "created": "2023-04-14 09:23:22 UTC+0000",
        "created_by": "Global-API-Token[key_id:ffffffff]",
        "key_id": "<key_id>",
        "managed_flocks": [
          "flock:<flock_id>"
        ],
        "note": "Example Memo",
        "watched_flocks": []
      },
      "result": "success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # Remove Flock API key

    POST /api/v1/flock/auth_token/remove

    Delete an existing Flock specific API key.

    Required Parameters

    auth_token string
    A valid auth token
    remove_auth_token string
    A valid existing Flock specific auth token.

    Response

    A JSON structure with the result indicator.

    Example

      Response
      {
        "result": "success"
      }
      
      1
      2
      3

      # List Flock API keys

      GET /api/v1/flock/auth_token/list

      List all API keys assigned to a specific flock.

      Required Parameters

      auth_token string
      A valid auth token
      flock_id string
      A valid flock_id

      Response

      A JSON structure with the Flock specific auth tokens.

      Example

        Response
        {
          "flock_api_keys": [
            {
              "auth_token": "<Flock Auth Token>",
              "auth_token_type": "admin",
              "created": "2023-04-13 08:58:39 UTC+0000",
              "created_by": "admin@inyoni.co.za",
              "key_id": "<Key ID>",
              "managed_flocks": [
                "flock:<Flock ID>"
              ],
              "note": "Example Note",
              "watched_flocks": []
            },
            {
              "auth_token": "<Flock Auth Token>",
              "auth_token_type": "admin",
              "created": "2023-04-14 09:28:45 UTC+0000",
              "created_by": "Global-API-Token[key_id:ffffffff]",
              "key_id": "<Key ID>",
              "managed_flocks": [
                "flock:<Flock ID>"
              ],
              "note": "Example Note",
              "watched_flocks": []
            }
          ],
          "result": "success"
        }
        
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29