Every Surge API request requires an API key. Pass it as a Bearer token. Keys are scoped to a project, and account-specific resources are addressed by the account ID in the request path.
Create and manage API keys
All requests to the Surge API require an API key. You create and manage keys in the dashboard under the API Keys section.
There are two key types:
Demo keys are limited to sends through the shared demo number. They have no other capabilities and shouldn’t be used beyond basic evaluation of Surge. Surge is likely to deprecate demo keys in the future in favor of sandboxes.
Authenticate with a Bearer token
Pass your API key as a bearer token in the Authorization header:
All requests must use HTTPS. Plaintext HTTP requests are rejected.
Scope requests to an account
API keys are scoped to a project: they can access all accounts under that project. Account-specific resources are scoped by the account ID in the request path:
A single project API key can create and manage multiple accounts, send messages from any of them, and read data across all of them.
Authentication errors
View API request logs
All authenticated API requests are logged. You can view them in the dashboard under the API Logs section. Logs include the method, path, response status, and response time for each request.