Send a bearer key
Catalog requests require Authorization: Bearer <secret>. The secret starts with sk_test_ or sk_live_, followed by 32 lowercase hexadecimal characters. A key_ ID names the key for management and cannot authenticate.
Test keys read the fixed sandbox fixture. Live keys require an eligible paid plan. Both modes share the account's monthly quota. Discovery, health, OpenAPI and the API's HTML reference are public.
Set your key
The examples in these docs read the secret from the GOLFDEV_API_KEY environment variable. Set it in the terminal that runs them, with your key between the single quotes, then check it:
export GOLFDEV_API_KEY='sk_test_…'
echo "$GOLFDEV_API_KEY"
echo prints the key when the variable is set and a blank line when it is not. The variable lasts until that terminal window closes. A new window needs the export line again.
In an example, leave $GOLFDEV_API_KEY as written. The shell replaces it with your key before the request is sent. If you write $ followed by the key, as in Bearer $sk_test_…, the shell looks for a variable with that name, finds none and sends an empty token. The API answers 401 invalid_auth with the message "Empty bearer token". To skip the variable, put the key after Bearer with no $.
Store and replace keys
Keep the secret in your server environment or secret manager. Exclude it from query strings, client bundles, analytics and support messages.
A lost secret cannot be recovered. Create a replacement, update your server, then revoke the old key. If no key slot is available, revoke an unused key first. Revoking a serving key interrupts its requests.
Resolve access errors
401 invalid_auth means the credential was not accepted. Check its value, mode and revocation state. The message "Empty bearer token" means the request carried no key; set your key in the terminal that sends it. 403 forbidden means resource or view access is missing. account_inactive identifies an inactive account or missing live access.
Check the dashboard before retrying. See views and access and handling responses.