Authentication
The Braid API uses Basic Authentication, which requires a username and password for every request. This method ensures that each API call is linked to a verified developer account within your organization’s Braid program.
How It Works
- The username is your assigned developer identifier.
- The password is the API key displayed in the API Key section of your Braid Developer Dashboard.
- Even though the UI labels it as API Key, it must be placed in the password field when constructing Basic Authentication credentials.
Basic Auth combines the username and password with a colon (:), e.g. username:apiKey and then encodes this string using Base64. The encoded string is included in the Authorization header in the format:
Authorization: Basic <base64(username:apiKey)>
Developer Tips
- Most programming languages and HTTP client libraries have built-in Basic Auth support that automatically handles Base64 encoding and header creation. Use these built-in methods to reduce manual encoding errors.
Example: In curl, you can pass the credentials using the -u flag:
curl -u "username:apiKey" https://api.sandbox.braid.zone/...
- Sandbox and Production have separate credentials and base URLs. Always use the correct credential pair for the matching environment.
Security Notes
- Never hardcode your API key in publicly accessible code repositories.
- Store credentials securely using environment variables or a secure secrets manager.
- Never expose your credentials or passkeys in client-side (frontend) code, as this would make them accessible to end-users.
- Rotate API keys periodically according to your organization’s security policy and immediately if they are compromised.
Updated about 12 hours ago