Trasys
Public API

Authentication

Authenticate Trasys Public API requests using an X-API-Key header generated in the dashboard, plus the 401 and 403 errors returned for invalid API keys.

All requests to the Trasys Public API require an API key to be passed in the X-API-Key HTTP header.

Generating an API Key

  1. Log in to the Trasys Dashboard.
  2. Navigate to Settings > API Keys.
  3. Click Create API Key.
  4. Give your key a descriptive name and select the appropriate permissions (or use a read-only role if applicable).
  5. Copy the generated key. It will only be shown to you once.

Making Authenticated Requests

Include your API key in the X-API-Key header with every request.

Example using cURL:

curl -H "X-API-Key: sk_prod_your_api_key_here" \
  "http://localhost:3000/v1/logs"

Example using JavaScript/Fetch:

fetch('http://localhost:3000/v1/logs', {
  method: 'GET',
  headers: {
    'X-API-Key': 'sk_prod_your_api_key_here'
  }
})
.then(response => response.json())
.then(data => console.log(data));

Error Responses

If you fail to provide an API key, or provide an invalid one, you will receive a standard HTTP status code indicating the error:

  • 401 Unauthorized: API key is missing or invalid.
  • 403 Forbidden: API key is valid but does not have permission to access the requested resource.

On this page