Skip to main content

API Key Authentication

All Nonce Private API requests require authentication using a Machine API Key passed in the Authorization header.

Header Format

Use the standard Bearer token format:
curl -X GET "https://api.nonce.app/private-api/v1/{workspace_id}/farms" \
  -H "Authorization: Bearer your_api_key_here"

Obtaining an API Key

You can generate API keys directly from the Nonce Dashboard:
  1. Log in to Nonce Dashboard
  2. Navigate to the Workspace you want to access via API
  3. Go to OrganizationManageAPI Keys
  4. Click Create API Key and provide a descriptive name
  5. Copy and securely store the generated key (it will only be shown once)
Create API Keys
API keys are scoped to a specific Workspace. Make sure to generate the key from the correct Workspace that matches the workspace_id in your API requests.

Authentication Errors

Status CodeErrorDescription
401UnauthorizedMissing or invalid Authorization header
401UnauthorizedInvalid, revoked, or expired API key
403ForbiddenAPI key does not have permission for this Workspace

Example Error Response

{
  "statusCode": 401,
  "message": "Invalid or missing API key",
  "error": "Unauthorized"
}

Security Best Practices

  • Never expose your API key in client-side code
  • Store API keys in environment variables
  • Rotate your API keys periodically
  • Use separate API keys for different environments (development, production)
  • Revoke unused or compromised keys immediately from the Dashboard