Generate API Key
This guide will show you how to generate an API key for your application from our dashboard.
Understanding API Keys
An API key is a unique, secure identifier that serves as your application's digital passport to access our API services. Think of it as a special access token that proves your application's identity and permissions when making requests to our API.
What is an API Key?
API keys are long, randomly generated strings that act as a secure authentication mechanism. They are essential for:
- Authenticating your application's requests
- Tracking API usage and quotas
- Managing access control and permissions
- Ensuring secure communication between your application and our services
Technology Behind API Keys
Our API keys are built using JWT (JSON Web Tokens), a modern, industry-standard authentication protocol. JWTs provide several advantages:
- Self-contained: Each token contains encoded information about the permissions and identity
- Stateless: No need to store session information on the server
- Secure: Uses cryptographic signatures to prevent tampering
- Standardized: Follows RFC 7519 specification for maximum compatibility
Security Best Practices
Information
Please note that the API key should be kept secret and not shared with anyone. In the event of a security breach, please delete all existing API keys and regenerate new ones.
To maintain the security of your API keys:
- Store them securely in environment variables or secure secret management systems
- Never commit API keys to version control
- Rotate keys periodically
- Use different keys for different environments (development, staging, production)
- Implement proper error handling for authentication failures
Create API Key
- Go to https://dashboard.spherepay.com
- Go to the "Developer" section
- Select the "API Keys" tab
- Click on the "Create new API Key" button
- Enter a name for your API key
- (optional) You may enter a description for your API key under the "Note" field
- Click on the "Done" button
- Copy the API key
Using the API key
You can use the API key in your application by passing it as a parameter to the API request.
curl -X POST https://api.spherepay.com/v1/transfer \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{...}'
Manage API Keys
You can manage your API keys in the "API Keys" tab of the "Developer" section.
- Go to https://dashboard.spherepay.com
- Go to the "Developer" section
- Select the "API Keys" tab
- Click on the triple dot menu on the right of the API key you want to manage
- You can edit and delete your API keys here
Important