Errors
When working with Topsort’s APIs, you may encounter various error responses. This guide helps you understand, diagnose, and resolve common issues.Error Response Format
Topsort APIs return errors as JSON arrays containing error objects:| Field | Type | Description |
|---|---|---|
errCode | string | Short string uniquely identifying the problem |
docUrl | string | Link to documentation providing more information |
message | string | Optional human-readable explanation (may change over time) |
HTTP Status Codes
400 - Bad Request
Unacceptable request format or incorrect syntax. Check request structure against API spec.
403 - Forbidden
API key issue or missing authorization tokens. Verify your authentication credentials.
404 - Not Found
Resource doesn’t exist or URL is incorrect. Check the endpoint path and resource ID.
422 - Unprocessable Entity
Request body doesn’t match expected model. Missing required fields or wrong data types.
429 - Rate Limit
Too many requests. Check rate limit headers:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.5xx - Server Error
Unexpected server problem. Our team typically fixes these issues quickly. Check status page.
Specific Error Codes
Authentication Errors
Authentication Errors
invalid_api_key- The API key in the authorization header is missing, invalid, or has expired. See authentication for details.
Request Format Errors
Request Format Errors
bad_request- The request could not be parsedinvalid_json- The request is not valid JSONempty_request- Request body is empty; ensure you’re sending datarequest_canceled- The caller canceled the requestinvalid_operation- The operation is not valid in the current state
Auction Errors
Auction Errors
missing_auctions- You must specify at least one auctiontoo_many_auctions- At most 5 auctions can be run in paralleltoo_few_slots- At least one slot must be specified in an auctionmissing_slots- Missing required slots fieldinvalid_auction_id- Auction ID doesn’t correspond to a valid auctionmissing_promotion_type- Must request slots for at least one promotion typeinvalid_promotion_type- Invalid promotion types in slots field
Context & Placement Errors
Context & Placement Errors
invalid_context- Invalid context. Must specify at most two of: list of products, search query, or categories (for sponsored brands: at most one)invalid_placement_id- Placement ID must be between 1 and 8missing_slot_id- Missing required slot ID for banner ads
Category Errors
Category Errors
invalid_category- Only one ofid,ids, ordisjunctionsmust be set, where no array is longer than 5
Session Errors
Session Errors
invalid_opaque_user_id- Opaque user ID value must be no longer than 90 characters
Product & Catalog Errors
Product & Catalog Errors
no_products- At least one product must be specifiedno_products_or_category- Either at least one product ID or a category ID must be providedtoo_many_products- Exceeded limit of products in the requestproduct_info_mismatch- Product info arrays must all have the same lengthinvalid_quality_score- Quality scores must be between 0.0 and 1.0non_positive_price- Product price must be positive
Geo Targeting Errors
Geo Targeting Errors
invalid_geo_targeting- Invalid geo targeting. Must specify eitherlocationorlocationstoo_many_locations- At most 2 locations can be specifiedinvalid_location_cell- Specified location cell is not a valid H3 cell
Device Errors
Device Errors
invalid_device- The device must be one of:desktopormobile
Search Errors
Search Errors
too_many_search_query_words- Exceeded limit of search query words in the request
Event Tracking Errors
Event Tracking Errors
invalid_event_time- At least one event is in the futureinvalid_resolved_bid_id- Invalid resolvedBidIdinvalid_use_of_external_campaign_id- Cannot set bothresolvedBidIdandexternalCampaignId
Purchase Event Errors
Purchase Event Errors
no_purchase_items- At least one item must be purchasedmissing_purchased_at- RequiredpurchasedAtfield is missing
Marketplace & Vendor Errors
Marketplace & Vendor Errors
invalid_marketplace- No such marketplace existsinvalid_vendor- No such vendor existsresource_not_found- The requested resource was not found
Experiment Errors
Experiment Errors
experiment_variant_too_long- Marketplace experiment variants have a maximum length of 10 charactersno_listing_experiment_variant- Marketplace experiment variants are only supported for sponsored listing auctions
Ledger & Account Errors
Ledger & Account Errors
account_unique_violation- Request breaks ledger account unique constraintinvalid_ledger_account- Ledger account does not existinsufficient_balance- Insufficient balancedifferent_currencies- Both accounts must have the same currency codeequal_from_and_to- From and to must be different
Filter Errors
Filter Errors
bad_request(filter operation) - The filter operation can be one ofandororbad_request(attributes) - The number of filter attributes needs to be between 1 and 3bad_request(promotions) - The number of filter promotions needs to be between 1 and 3
Travel API Errors
Travel API Errors
invalid_travel_category- Travel category must be a non-empty string if providedinvalid_travel_date_range- End date must be greater than start datetoo_many_passengers- Number of passengers must be less than teninvalid_traveler_type- Traveler type must be one of:family,group,solo,coupleinvalid_date_format- Date must follow formatYYYY-MM-DD(e.g., 2012-05-08)invalid_travel_type- Type must be one of:hotels,flightsmissing_variation_id- Missing variation IDmissing_flight_travel_context- Missing fields from flight travel context
Server Errors
Server Errors
internal_server_error- The server has encountered a problemrequest_canceled- The caller canceled the request
Common Integration Issues
Events Not Appearing
Events return 200 but don’t show in dashboard:
- Check
occurredAtis within last 30 days - Verify product exists in catalog
- Confirm event type spelling (
click, notClick)
Empty Auction Results
Auctions returning no winners:
- Check campaign budget (most common issue)
- Verify account balance is positive
- Confirm products are in stock and active
- Verify active campaigns exist
- Check bid amounts aren’t too low
Attribution Issues
Attribution not working correctly:
- See our Attribution Troubleshooting Guide
- Check resolved bid IDs are passed correctly
- Verify purchase events include proper product IDs
Connection Problems
Connection refused or timeout:
- Test connectivity:
curl -I https://api.topsort.com - Check firewall allows outbound HTTPS (port 443)
- Whitelist
*.topsort.comdomains - Verify TLS/SSL certificate validation
Detailed Validation Errors
Some endpoints return detailed validation errors with field-level information:details array to identify exactly which fields have issues and what needs to be corrected.
Rate Limiting
Exponential Backoff
Retry failed requests with increasing delays between attempts:
Use Rate Limit Headers
Respect the rate limit headers in responses:
X-RateLimit-Limit- Total requests allowedX-RateLimit-Remaining- Requests remainingX-RateLimit-Reset- When limit resets
X-RateLimit-Reset before retrying.Auctions (
/v2/auctions) and Events (/v2/events) endpoints are not rate-limited. Rate limits apply to other endpoints like campaign management and reporting APIs.Connection & Network Issues
Troubleshooting Checklist
1
Test Basic Connectivity
Verify you can reach Topsort’s API:
2
Check Firewall Rules
Ensure outbound HTTPS (port 443) traffic is allowed and whitelist:
api.topsort.com*.topsort.com
3
Verify TLS Support
Ensure your HTTP client supports modern TLS versions:
4
Configure Timeouts
Set appropriate timeout values and implement retry logic:
5
Check Status Page
Visit topsort.statuspage.io for service status
Common Network Issues
SSL/TLS Certificate Problems
SSL/TLS Certificate Problems
Symptoms: Certificate validation errors, SSL handshake failuresSolutions:
- Update your HTTP client to support modern TLS versions
- Ensure your system trusts standard certificate authorities
- Test with:
openssl s_client -connect api.topsort.com:443
Firewall/Proxy Issues
Firewall/Proxy Issues
Symptoms: Connection refused, requests hangingSolutions:
- Whitelist Topsort domains (
api.topsort.com,*.topsort.com) - Allow outbound HTTPS traffic on port 443
- Configure proxy settings if required by your network
- Test without proxy to isolate issue
Timeout Issues
Timeout Issues
Symptoms: Requests timing out, hanging indefinitelySolutions:
- Increase timeout values in your HTTP client
- Implement retry logic with exponential backoff
- Check for large request payloads exceeding limits
- Use connection pooling for better performance
Regional Connectivity
Regional Connectivity
Symptoms: Issues from specific geographic regionsSolutions:
- Test from different locations to isolate regional problems
- Use a CDN or proxy service if needed
- Contact support with your location details
Debugging Tools
Developer Logs
Check the Dev Tools tab in your Ad Platform for detailed API request/response logs.See our Developer Logs guide for help interpreting log entries.
Status Page
Monitor service health and planned maintenance at topsort.statuspage.ioSubscribe to updates for real-time notifications.
Need Help?
If you’re still experiencing issues after consulting this guide:- Check status page: topsort.statuspage.io
- Contact support with error details and API request examples
- Review API docs for endpoint-specific requirements