Authentication

Learn how to authenticate your API requests and manage API keys.

Overview

All WebKasa API requests require authentication using an API key. API keys are scoped to specific permissions and tied to your organization.

API Key Format

API keys follow this format:

wk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
└──────────────────────────────────┘
           64 character key
  • wk_live_ - Prefix for live/production keys
  • wk_test_ - Prefix for test/sandbox keys

Using API Keys

Include your API key in one of these ways:

Bearer Token (Recommended)

curl -X GET "https://api.webkasa.app/api/v1/events" \
  -H "Authorization: Bearer wk_live_your_api_key_here"

X-API-Key Header

curl -X GET "https://api.webkasa.app/api/v1/events" \
  -H "X-API-Key: wk_live_your_api_key_here"

Available Scopes

When creating an API key, select the minimum scopes needed for your integration:

Scopes

ParameterTypeDescription
events:readstringView events and event details
events:writestringCreate, update, and delete events
registrations:readstringView event registrations
registrations:writestringCreate and manage registrations
bookings:readstringView bookings and schedules
bookings:writestringCreate, update, and cancel bookings
posts:readstringView blog posts and categories
posts:writestringCreate, update, and delete blog posts
comments:readstringView event comments
comments:writestringCreate and delete comments
users:readstringView user profiles
sites:readstringView site information
*:readstringAll read operations
*stringAll operations (full access)

Security Best Practices

  • Never expose API keys in client-side code. Always call the API from your server.
  • Use environment variables to store API keys, not hardcoded strings.
  • Rotate keys periodically and immediately if you suspect compromise.
  • Use minimum necessary scopes. Don't request * if you only need read access.

Authentication Errors

If authentication fails, you'll receive one of these responses:

401 Unauthorized
{
  "error": "API key is required",
  "code": "UNAUTHORIZED"
}
403 Forbidden
{
  "error": "Insufficient permissions. Required scope: events:write",
  "code": "FORBIDDEN"
}