Skip to main content

Authentication

Every request to the Arsel API must include a valid API key. Keys are scoped to your organization, so all usage and rate limits apply at the organization level.

REST vs SMTP

This page covers REST API keys. The SMTP server uses a separate SMTP credential (username and password); see Managing SMTP Credentials. The two are not interchangeable.

Credential Types​

Arsel issues two kinds of credential. The prefix tells you which one you hold and whether it is safe to ship in a browser or mobile app.

PrefixNameSecret?Where it belongsUsed for
be_API keyYesYour server onlyThe whole REST API
pub_Client keyNo — publishableShipped in web/mobile app codeClient SDKs: event ingestion and device registration

Everything on this page describes the be_ API key unless stated otherwise.

Building an app for other Arsel customers?

Don't ask them for API keys. Use Sign in with Arsel (OAuth): the customer approves your app in the browser, and you send the access token you get in the same Authorization: Bearer header.

API Key Format​

be_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The be_ prefix identifies the key type; the remaining 32 characters are cryptographically random.

Sending Authenticated Requests​

Include your API key in the Authorization header using the Bearer scheme:

Authorization: Bearer be_your_api_key
HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonOn requests with a body

Generating API Keys​

  1. Log in to your Arsel Dashboard
  2. Navigate to Integrations > API keys
  3. Click Create API Key and give it a descriptive name
  4. Copy the key immediately. It is only shown once
warning

Store your API key securely. It cannot be retrieved after creation. If you lose it, revoke the old key and generate a new one.

Key Lifetime​

Every API key expires one year after it is created. The expiry cannot be extended, so rotate keys before requests start returning 401.

To rotate with no downtime: create the new key, deploy it, confirm traffic has moved by watching the old key's last-used timestamp, then revoke the old key.

Key Management​

From the dashboard you can view all active keys with their expiry and last-used timestamps, revoke keys you no longer need, and create replacements.

Security Best Practices​

  • Never expose be_ API keys in client-side code. They grant access to your whole organization and are for server-to-server use only. To send events or register devices from a browser or mobile app, use a pub_ client key, which is safe to ship in client code and can do far less. See Client SDKs.
  • Store keys in environment variables, not source code. The examples in these docs read the key from ARSEL_API_KEY.
  • Rotate keys periodically and immediately if a key may have been compromised.
  • Use separate keys for development and production environments.

Authentication Errors​

If your API key is missing, invalid, or revoked, the API returns:

{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid API Key"
}