Skip to content

API Keys

API keys provide programmatic access to WebDecoy for SDKs, integrations, and custom applications. They authenticate requests to the WebDecoy API without requiring user login credentials.

Use CaseDescription
SDK AuthenticationNode.js, PHP, or other SDKs
WordPress PluginConnect plugin to your account
Custom IntegrationsBuild your own tools
CI/CD PipelinesAutomated deployments
Monitoring ScriptsDetection alerting

WebDecoy API keys follow this format:

sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • sk_ - Secret key prefix
  • live_ - Environment (live = production)
  • xxxx... - 32-character unique identifier
AspectBest Practice
StorageEnvironment variables, not code
AccessPrinciple of least privilege
RotationRotate periodically
MonitoringTrack key usage
RevocationRevoke compromised keys immediately

  1. Navigate to API Keys

    • Go to Settings → API Keys in the sidebar
  2. Click “Create API Key”

    • The create key dialog opens
  3. Configure the Key

    FieldDescription
    NameDescriptive name (e.g., “Production SDK”)
    PropertyOptional: Limit to specific property
    ScopesWhat the key can access
    ExpirationOptional: Auto-expire after X days
  4. Click “Create”

    • The full API key is displayed
    • Copy it now - it won’t be shown again!
  5. Store Securely

    • Add to your environment variables
    • Never commit to source control

Scopes limit what an API key can do:

ScopePermissions
detections:readRead detection data
detections:writeSubmit detections
decoys:readList decoys
decoys:writeCreate/modify decoys
domains:readList domains
domains:writeCreate/modify domains
integrations:readView integrations
integrations:writeConfigure integrations
organization:readRead org settings
organization:writeModify org settings
Use CaseRecommended Scopes
WordPress Plugindetections:read, detections:write
Monitoring Dashboarddetections:read
Full SDK AccessAll scopes
Read-Only Reportingdetections:read, decoys:read

Optionally limit an API key to a specific property:

SettingBehavior
No property (default)Access to all organization resources
Specific propertyOnly that property’s data accessible

Use property scoping when:

  • Different teams manage different properties
  • Limiting blast radius of key compromise
  • Client isolation (agencies)

Set automatic expiration:

SettingWhen to Use
No expirationPermanent keys for production
30 daysTemporary testing
90 daysShort-term integrations
365 daysAnnual rotation

Navigate to Settings → API Keys to see:

ColumnDescription
NameYour key name
Key PrefixFirst 12 characters (for identification)
ScopesAssigned permissions
Last UsedMost recent API call
CreatedCreation timestamp
StatusActive, Expired, or Revoked
StatusMeaning
🟢 ActiveWorking normally
🟡 Expiring SoonExpires within 30 days
🔴 ExpiredPast expiration date
RevokedManually disabled

Since you can’t see the full key after creation, use:

  • Name: Choose descriptive names
  • Key Prefix: First 12 chars visible (e.g., sk_live_abc1)
  • Last Used: Timestamp helps identify active keys

To revoke (permanently disable) a key:

  1. Go to Settings → API Keys
  2. Find the key in the list
  3. Click the Revoke button (or trash icon)
  4. Confirm the revocation

What happens:

  • Key stops working immediately
  • All API calls with that key fail
  • Key cannot be re-enabled
  • Create a new key if needed

When to revoke:

  • Key may be compromised
  • Employee leaving
  • Project completed
  • Rotating keys
  1. Create new key with same scopes
  2. Update your application with new key
  3. Test that new key works
  4. Revoke old key after confirming
  5. Document the rotation

Track API key activity:

  • Last Used column shows recent activity
  • Inactive keys may indicate configuration issues
  • Sudden spikes may indicate abuse

Terminal window
# .env file
WEBDECOY_API_KEY=sk_live_your_key_here
Node.js
const apiKey = process.env.WEBDECOY_API_KEY;
// PHP
$apiKey = getenv('WEBDECOY_API_KEY');

Include the API key in the Authorization header:

Authorization: Bearer sk_live_your_key_here

Example cURL:

Terminal window
curl -X GET https://api.webdecoy.com/api/organizations/123/detections \
-H "Authorization: Bearer sk_live_your_key_here" \
-H "Content-Type: application/json"
// Node.js SDK
const { WebDecoyClient } = require('webdecoy');
const client = new WebDecoyClient({
apiKey: process.env.WEBDECOY_API_KEY
});
// PHP SDK
use WebDecoy\Client;
$client = new Client([
'api_key' => getenv('WEBDECOY_API_KEY')
]);

  • Store keys in environment variables
  • Use minimal required scopes
  • Rotate keys periodically
  • Revoke unused keys
  • Use descriptive key names
  • Monitor key usage
  • Set expiration for temporary keys
  • Commit keys to Git repositories
  • Share keys in chat/email
  • Use production keys in development
  • Grant more scopes than needed
  • Use same key for multiple purposes
  • Ignore unused/old keys
  1. Revoke immediately - Don’t wait
  2. Create new key with same scopes
  3. Update applications with new key
  4. Review logs for unauthorized access
  5. Assess damage from compromised period