Skip to main content
Jamie offers two authentication methods for webhooks. Choose the one that best fits your needs.

Authentication Methods

The simplest way to verify webhook requests. Jamie sends a static API key in a header that you specify during webhook creation. How it works:
  1. When creating the webhook, choose “API Key” authentication
  2. Optionally specify a custom header name (default: x-jamie-api-key)
  3. Save the generated secret key (sk_...)
  4. In your webhook handler, compare the header value with your stored secret

Verification Code Examples

Signature Verification (Advanced)

For maximum security, Jamie can sign all webhook requests using HMAC-SHA256. This ensures requests are authentic and haven’t been tampered with.

Signature Format

The x-jamie-signature header uses the following format:
  • t: Unix timestamp (seconds) when the signature was created
  • v0: HMAC-SHA256 signature of the payload

Verification Steps

  1. Extract the timestamp and signature from the x-jamie-signature header
  2. Validate the timestamp - Reject requests with timestamps older than 5 minutes (300 seconds) to prevent replay attacks
  3. Recreate the signed message - Concatenate the timestamp, a period (.), and the raw request body: {timestamp}.{raw_body}
  4. Compute the expected signature - Generate an HMAC-SHA256 hash of the message using your signing secret
  5. Compare signatures - Use a constant-time comparison to prevent timing attacks

Verification Code Examples

Security Best Practices:
  • Always verify the API key or signature before processing webhook data
  • For signature verification, use constant-time comparison to prevent timing attacks
  • Validate timestamps to prevent replay attacks (recommended tolerance: 5 minutes)
  • Store your secret key securely (use environment variables or a secrets manager)
  • Never commit secret keys to version control