Creating an API Key
- Sign in to the ShingleAI Dashboard
- Navigate to Settings > API Keys
- Click Create API Key
- Give your key a descriptive name (e.g., “Production Server” or “Development”)
- Select the permission scopes your key needs
- Click Create and copy your key immediately
Using Your API Key
Include your API key in theAuthorization header of every request using the Bearer token format:
Permission Scopes
API keys are scoped to specific permissions that control what resources they can access. When creating a key, grant only the permissions your integration needs.Available Scopes
| Resource | Actions | Description |
|---|---|---|
contacts | read, write, delete | Manage contacts and their details |
customers | read, write, delete | Manage customer records |
businesses | read, write, delete | Manage business profiles |
messages | read, write, delete | Access email, SMS, and voice messages |
automations | read, write, delete | Configure automation workflows |
domains | read, write, delete | Manage custom domains |
users | read, write, delete | Manage user profiles and settings |
organization | read, write, delete | Manage organization settings and members |
api_keys | read, write, delete | Manage API keys and their permissions |
resources | read, write, delete | Access shared resources and analytics |
Permission Inheritance
Permissions follow a hierarchical model. Granting access to a parent resource also grants access to its child resources:contactsincludescontacts.emails,contacts.phones,contacts.addresses,contacts.tags,contacts.notescustomersincludescustomers.contactsbusinessesincludesbusinesses.details,businesses.tags,businesses.contacts,businesses.addressesmessagesincludesmessages.email,messages.sms,messages.voiceautomationsincludesautomations.actionsdomainsincludesdomains.dns,domains.verificationusersincludesusers.profile,users.settingsorganizationincludesorganization.settings,organization.billingresourcesincludesresources.analytics
HTTP Methods and Permissions
| HTTP Method | Required Permission |
|---|---|
| GET | read |
| POST | write |
| PUT, PATCH | write |
| DELETE | delete |
Authentication Errors
If authentication fails, you’ll receive a401 Unauthorized response:
- Missing
Authorizationheader - Invalid or revoked API key
- Malformed Bearer token (missing “Bearer ” prefix)
403 Forbidden response:
Security Best Practices
Never commit API keys to version control
Never commit API keys to version control
Use environment variables or a secrets manager to store your API keys. Add
.env files to your .gitignore.Use separate keys for each environment
Use separate keys for each environment
Create different API keys for development, staging, and production. This limits the blast radius if a key is compromised.
Grant minimum required permissions
Grant minimum required permissions
Follow the principle of least privilege. Only grant the specific permissions your integration needs. A read-only dashboard doesn’t need write access.
Rotate keys regularly
Rotate keys regularly
Periodically create new API keys and deprecate old ones. This limits the window of exposure if a key is leaked.
Monitor API key usage
Monitor API key usage
Review your API key activity in the dashboard regularly. Revoke any keys showing suspicious activity immediately.