Authentication
All Straply API requests require authentication via a Bearer token in the Authorization header.
API key format
Section titled “API key format”API keys use the following prefix format:
| Prefix | Environment | Usage |
|---|---|---|
stp_live_ | Production | Live property data, counts toward your plan limits |
stp_test_ | Sandbox | Returns mock data, does not count toward limits |
Example key: stp_live_a1b2c3d4e5f6g7h8i9j0
Making authenticated requests
Section titled “Making authenticated requests”Include your API key in the Authorization header as a Bearer token:
curl "https://api.straply.com/v1/properties/stp_a3f7c2e91b4d" \ -H "Authorization: Bearer stp_live_YOUR_KEY"Key management
Section titled “Key management”Manage your API keys on your Dashboard:
- Create a key and give it a name (up to 10 active keys). The full key is shown once, when you create it, so copy it somewhere safe such as a password manager. Straply stores only a hash of it, and never sends keys by email.
- See every key, masked (
stp_live_Ab••••••••wxyz), with when it was created and when it was last used. - Rename a key at any time.
- Revoke a key. Requests with a revoked key get
401 Unauthorizedwithin a minute.
To rotate a key, create the new one, switch your app over, then revoke the old one. All your keys share your plan’s limits.
Security best practices
Section titled “Security best practices”- Store API keys in environment variables, not in source code
- Rotate keys periodically
- Use a separate, named key for each application, so you can revoke one without touching the others
- Never expose keys in client-side code or public repositories
Error responses
Section titled “Error responses”If authentication fails, the API returns:
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key.", "status": 401 }}See the Errors reference for all error codes.