Core Concepts
Understanding these key concepts will help you integrate effectively with the SalesCaddie API.
Idempotency
To prevent duplicate campaign creation, we recommend including an Idempotency-Key header with each request. While not required, it provides the best protection against duplicate processing.
What is Idempotency?
Idempotency means you can safely retry the same request multiple times without creating duplicate resources. If you send the same request twice with the same idempotency key, we'll process it only once.
Auto-Generated Keys
Don't want to manage idempotency keys? No problem! If you don't provide an Idempotency-Key header, we'll automatically generate a unique key for you. However, for the best protection against duplicate processing, we recommend providing your own key.
Usage
Include the Idempotency-Key header with a unique identifier for the event:
Code
Complete Example
Code
What Makes a Good Idempotency Key?
Good Examples:
- ✅
EVENT-12345(your system's unique event ID) - ✅
tenant-abc-event-67890(tenant + event ID) - ✅
uuid-a7b2c3d4-e5f6-7890(generated UUID)
Bad Examples:
- ❌
request-1(not unique across time) - ❌
timestamp-1699564800(timestamp alone) - ❌ Random values that change on each retry
Best Practice: Use a unique identifier from your system (like an event ID or record ID) as the idempotency key. This ensures natural deduplication even if your integration retries the same request.
Rate Limits
To ensure fair usage and system stability, we enforce rate limits on API requests.
Current Limits
| Limit | Value |
|---|---|
| Requests per minute | 100 |
| Requests per hour | 1,000 |
| Requests per day | 10,000 |
Rate Limit Headers
Every API response includes rate limit information:
Code
X-RateLimit-Limit: Your total allowed requests per windowX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the window resets
Exceeding Limits
If you exceed your rate limit, you'll receive a 429 Too Many Requests response:
Code
Need higher limits? Reach out to us at [email protected] to discuss custom rate limits based on your integration volume.
Error Handling
All API errors follow the RFC 7807 standard format for consistent, machine-readable error responses, with additional trace information for debugging.
Error Response Format
Code
RFC 7807 Standard Fields:
type: URI reference identifying the error typetitle: Human-readable error summarystatus: HTTP status codedetail: Specific details about this error occurrence (may not be present for some errors)instance: The API endpoint that generated the error
Additional Trace Information:
trace: Debugging information included in all responsestimestamp: When the error occurredrequestId: Unique request identifier - always include this when contacting support!buildId: API deployment versionrayId: Infrastructure trace ID
Common Status Codes
| Code | Meaning | When It Happens |
|---|---|---|
202 | Accepted | Request successfully queued |
400 | Bad Request | Invalid data format or validation failure |
401 | Unauthorized | Missing or invalid API key |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Unexpected server error (we're notified automatically) |
Best Practice for Troubleshooting:
- Always log the full error response, especially the
trace.requestId - When contacting support, include the
requestId- this helps us locate your exact request in our logs - The
detailfield contains specific information about what went wrong
Next Steps
→ Review Authentication best practices
→ Explore the API Reference for detailed endpoint documentation
→ Need help? Check out Support