Authentication

View as Markdown

BlockBee uses a simple API key authentication system. You can send your API key in two ways:

API Key Types

BlockBee offers two types of API keys to serve different use cases:

API Key V1 - Basic Receiving

  • Purpose: Simple payment receiving within BlockBee
  • Use Case: Basic API access for straightforward payment receiving
  • Security: Secure yet simple - no direct fund control
  • Recovery: Safe to reset without risk of losing funds

API Key V2 - Self-Custodial Wallet

  • Purpose: Automated payouts and advanced fund management
  • Use Case: Self-custodial wallet for automated sending to multiple addresses
  • Security: Advanced cryptography with recovery key feature
  • Recovery: Recovery key required to regenerate API Key V2
  • Required for: Self-Custodial Wallet operations

When to Upgrade to API Key V2

Upgrade to API Key V2 if:

  • Automated payouts are essential for your operations
  • You need to send payments to multiple addresses automatically
  • You want the added security and flexibility of Self-Custodial Wallet

Stay with API Key V1 if:

  • You only need basic payment receiving functionality
  • You don't require automated payout features

Getting Your API Key

Your API key is provided by the BlockBee Dashboard. If you don't have one yet, get your API key here.

Authentication Methods

Method 1: GET Parameter

Add your API key as a apikey parameter to your request URL:

Bash
https://api.blockbee.io/btc/create?apikey=YOUR_API_KEY&amount=100&currency=USD

Method 2: Header

Send your API key in the apikey header:

Bash
curl -X GET "https://api.blockbee.io/btc/create?amount=100&currency=USD" \
  -H "apikey: YOUR_API_KEY"

Security Best Practices

  • Keep your API key secure - Never expose it in client-side code or public repositories
  • Use HTTPS - Always make requests over HTTPS in production
  • Rotate regularly - Consider rotating your API key periodically for enhanced security

Example Request

Here's a complete example using the header method:

JavaScript
const response = await fetch('https://api.blockbee.io/btc/create?amount=100&currency=USD', {
  headers: {
    'apikey': 'YOUR_API_KEY'
  }
});

That's it! Your API key is all you need to authenticate with BlockBee.