Overview
API security is an important part of protecting automated integrations between SPRL and your applications, websites, internal systems, or business workflows.
API credentials can provide access to SPRL functionality and should therefore be treated as sensitive information. A compromised API credential may allow unauthorized users or applications to perform actions through your account.
Good to Know:
Keep API credentials private, use them only from trusted applications, avoid exposing them in frontend code, and review your integrations regularly.
Protect Your API Credentials
API keys, access tokens, and other authentication credentials should be treated with the same care as account passwords.
- Store API credentials securely.
- Never share credentials with unauthorized users.
- Do not include private credentials in public repositories.
- Do not expose private credentials in browser-side code.
- Do not include credentials in screenshots or support requests.
- Replace credentials if you believe they have been exposed.
Never Share:
Do not share API keys, access tokens, passwords, or other private credentials through email, chat, public documentation, source code, screenshots, or unsolicited support requests.
Keep API Credentials Server-Side
Private API credentials should generally be used from a trusted server-side environment rather than being embedded directly in frontend JavaScript or other publicly accessible application code.
If a credential is included in browser-side code, users may be able to inspect the application and obtain the credential.
| Environment | Recommendation |
|---|
| Server-Side Application | Recommended location for private API credentials. |
| Backend Service | Store credentials securely using appropriate application configuration. |
| Browser / Frontend | Do not expose private API credentials in client-side code. |
| Public Repository | Never commit private API credentials to public source code. |
Use Environment Configuration
For server-side applications, credentials should be stored outside application source code whenever practical.
Use your application's secure configuration or environment-management mechanism to provide credentials to the application at runtime.
- Keep credentials outside publicly accessible source files.
- Restrict access to configuration files.
- Do not commit secrets to source-control repositories.
- Use separate credentials for different environments where appropriate.
- Protect production credentials from development environments.
Security Reminder:
Adding a credential to a .gitignore file does not protect a credential that has already been committed to a repository. If a secret is exposed, treat it as compromised and replace it.
Protect API Requests
API requests should be made over secure connections and should be handled carefully by your application.
- Use HTTPS when communicating with SPRL APIs.
- Validate API responses before processing them.
- Handle errors without exposing sensitive information.
- Avoid logging credentials or authorization headers.
- Protect application logs and monitoring systems.
Important:
Never log API keys, passwords, access tokens, or complete authorization headers in application logs.
Validate API Responses
Applications should not assume that every API request will succeed. Your integration should correctly handle successful responses, validation errors, authentication failures, unavailable services, and other unexpected responses.
- Check HTTP status codes.
- Validate response data before using it.
- Handle authentication failures appropriately.
- Handle invalid request responses.
- Prevent unexpected responses from breaking business workflows.
Handle Errors Securely
Error messages and logs should provide enough information for troubleshooting without exposing sensitive credentials or internal security information.
Avoid displaying raw technical information to end users when it could expose confidential implementation details.
| Practice | Recommendation |
|---|
| Error Handling | Handle API failures gracefully. |
| Logging | Log useful troubleshooting information without credentials. |
| Sensitive Data | Mask or remove secrets from logs and error reports. |
| User Messages | Do not expose unnecessary technical or security information to users. |
Prevent Duplicate API Operations
Applications that automatically retry failed requests should be designed carefully to avoid unintentionally performing the same operation multiple times.
For operations that create or modify resources, consider how your application handles network failures and retry conditions before automatically repeating a request.
- Identify operations that could create duplicates.
- Implement appropriate retry controls.
- Handle network timeouts carefully.
- Verify the result of an uncertain request before repeating it.
- Test retry behavior before production deployment.
Secure API Integrations
Enterprise applications may connect SPRL with websites, internal systems, marketing workflows, analytics platforms, or other business applications.
Each integration should be reviewed as part of your organization's security architecture.
- Document applications that use SPRL APIs.
- Identify who is responsible for each integration.
- Store credentials securely.
- Review integrations periodically.
- Remove unused integrations.
- Investigate unexpected API activity.
Development & Testing
API integrations should be tested before being deployed to production.
Use appropriate development or testing environments and avoid exposing production credentials during development.
- Do not use production credentials unnecessarily during development.
- Keep test credentials separate where applicable.
- Remove test credentials that are no longer required.
- Test authentication and error handling.
- Test network failures and unexpected responses.
- Review application logs for accidental credential exposure.
Tip:
Before deploying an API integration, verify that credentials are not present in frontend assets, source-control history, application logs, debugging output, or publicly accessible files.
API Credentials & Team Access
Organizations should control which users and applications have access to API credentials.
- Limit access to authorized developers and administrators.
- Avoid sharing API credentials between unrelated applications.
- Document important integrations.
- Review access when employees or responsibilities change.
- Remove credentials that are no longer required.
What to Do If an API Credential Is Exposed
If an API key or other credential is accidentally exposed, assume that it may have been accessed by an unauthorized party.
- Stop using the exposed credential where possible.
- Replace or deactivate the credential where applicable.
- Review recent API activity.
- Check connected applications and workflows.
- Investigate unexpected requests or changes.
- Remove the exposed credential from source code and configuration.
- Review source-control history if the credential was committed.
- Contact SPRL Support if assistance is required.
Important:
Removing an exposed credential from the latest version of your source code does not necessarily make it secure. If it was previously published or committed, replace the credential.
API Security Monitoring
Regular monitoring can help organizations identify unusual API activity and investigate potential integration problems.
Depending on your application and monitoring capabilities, consider reviewing:
- Unexpected API requests.
- Authentication failures.
- Unusual request volumes.
- Unexpected application behavior.
- Changes to connected integrations.
- Unexpected link or resource creation.
API Security Best Practices
| Security Area | Recommended Practice |
|---|
| Credentials | Keep API credentials confidential and securely stored. |
| Server-Side Usage | Keep private credentials in trusted server-side environments. |
| HTTPS | Use secure HTTPS connections for API communication. |
| Source Code | Never commit private credentials to public repositories. |
| Logging | Prevent credentials and sensitive authorization information from appearing in logs. |
| Errors | Handle errors without exposing sensitive information. |
| Retries | Design retry logic carefully to avoid unintended duplicate operations. |
| Monitoring | Review relevant API activity and investigate unusual behavior. |
| Access | Limit API access to authorized users and applications. |
API Security Checklist
| Practice | Status |
|---|
| API credentials stored securely | Required |
| Private credentials kept out of frontend code | Required |
| Credentials excluded from public repositories | Required |
| HTTPS used for API communication | Required |
| Sensitive credentials excluded from logs | Required |
| API errors handled securely | Recommended |
| Retry behavior tested | Recommended |
| Integrations reviewed periodically | Recommended |
| Exposed credentials replaced promptly | Required if applicable |
Frequently Asked Questions
Where should I store my SPRL API credentials?
Store private API credentials in a secure server-side or trusted application environment. Avoid placing them directly in frontend code or publicly accessible files.
Can I put my API key in JavaScript?
Private API credentials should not be exposed in browser-side JavaScript because users may be able to inspect the code and retrieve the credential.
Can I commit my API key to Git?
No. Private API credentials should never be committed to public repositories. If a credential has already been committed or exposed, treat it as compromised and replace it.
Should API keys be included in application logs?
No. API keys, passwords, access tokens, and authorization headers should not be stored in application logs.
What should I do if my API key is exposed?
Secure or replace the affected credential where applicable, review API activity, investigate unexpected requests, and contact SPRL Support if assistance is required.
Should I use production API credentials during development?
Avoid using production credentials during development unless necessary. Keep development and production credentials appropriately separated.
How should I handle API errors?
Validate responses, handle HTTP errors appropriately, and ensure that error messages and logs do not expose sensitive credentials or unnecessary confidential information.
How often should API integrations be reviewed?
Review integrations periodically and whenever applications, users, credentials, or business requirements change.
Quick Reference
| Topic | Summary |
|---|
| Credentials | Keep API keys and other credentials confidential. |
| Frontend | Do not expose private API credentials in browser-side code. |
| Source Code | Never commit private credentials to public repositories. |
| Communication | Use HTTPS for API communication. |
| Logging | Keep credentials and sensitive authorization information out of logs. |
| Errors | Handle failures without exposing confidential information. |
| Monitoring | Review relevant API activity for unexpected behavior. |
| Credential Exposure | Replace or deactivate exposed credentials promptly where applicable. |
Learn More:
Explore the SPRL Help Center for detailed guides on Security Overview, Two-Factor Authentication, Managing Login Sessions, Password Security Best Practices, Recognizing Phishing Attempts, Data Privacy & User Information, Domain & SSL Security, Reporting Security Issues, and Security FAQs.
Tip: Treat every API credential as a secret. Keep it server-side, protect it from source-control exposure, avoid logging it, review integrations regularly, and replace it immediately if you believe it has been exposed.