Skip to main content

Creating Auth Tokens

Auth tokens are essential for accessing the Ghost Metrics API securely. This guide will walk you through the steps to generate and use Auth tokens.

Steps to Generate a New Auth Token

Before you can generate an Auth token, you need to log in to your Ghost Metrics account. Make sure you have the necessary permissions to create tokens.

  1. Once logged in, go to the Settings section of your Ghost Metrics dashboard.
  2. Click on Personal -> Security.
  3. At the bottom of the page click on “Create new token”
  4. Confirm your account password
  5. Enter the purpose for this token
  6. Choose if the token should only be valid for secure requests
  7. Click on “Create new token”

Ghost Metrics Dashboard

Using Auth Tokens

To use the Auth token, include it in the headers of your API requests. Here’s an example of how to do this using curl:

curl -X POST 'https://ghostdemo.ghostmetrics.cloud/?module=API&method=API.getMatomoVersion&format=xml' -d 'token_auth=YOUR\_TOKEN'