# API

Currently your Console can only have a single API key (auth_token). Managing this key, as well as enabling and disabling the use of the API can be done using the following endpoints.

# Add an API token

TIP

This will generate a new API token for you, overwriting the existing token if there is one.

POST /api/v1/token/add

Create a new API token.

Required Parameters

auth_token string
A valid auth token

Response

JSON structure with the new API token.

Example

    Response
    {
      "result": "success",
      "token": "<auth_token>"
    }
    
    1
    2
    3
    4

    # Delete the API Token

    DELETE /api/v1/token/remove

    Delete the existing API token.

    Required Parameters

    auth_token string
    A valid auth token

    Response

    A JSON structure with result indicator.

    Example

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

      # Disable the API

      POST /api/v1/settings/api/disable

      Disable the Console API.

      Required Parameters

      auth_token string
      A valid auth token

      Response

      JSON structure with result indicator.

      Example

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

        # Download the API Configuration File

        GET /api/v1/token/download

        Download an API token configuration file for use by the Python API.

        Required Parameters

        auth_token string
        A valid auth token

        Response

        File containing the API configuration.

        Example

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

          # Enable the API

          TIP

          Since we currently only allow for a single API key, this can only be achieved by logging into the Console and enabling the setting from your Global Settings page.

          POST /api/v1/settings/api/enable

          Enable the Console API.

          Required Parameters

          auth_token string
          A valid auth token

          Response

          JSON structure with result indicator.

          Example

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