Overview

The Analytics API returns detailed error messages to help debug invalid queries. This page covers common error scenarios and how to resolve them.

Error Response Format

When an error occurs, the API returns an error response with a descriptive message:
{
  "error": "Error message describing what went wrong"
}

Common Errors

Authentication Errors

Query Structure Errors

Field and Aggregation Errors

Data Filtering Errors

Rate Limiting

Debugging Tips

1. Start Simple

Begin with basic queries and gradually add complexity:
{
  "service_key": "your_key",
  "query_requests": [
    {
      "data_source": "QUERY_DATA_SOURCE_USER_DATA",
      "selections": [
        {
          "field": "num_acceptances",
          "aggregation_function": "QUERY_AGGREGATION_COUNT"
        }
      ]
    }
  ]
}

2. Validate Field Names

Double-check field names against the Available Fields documentation.

3. Check Aggregation Compatibility

Ensure your aggregation functions are compatible with the field types you’re selecting.

4. Test Filters Separately

If your query isn’t returning expected results, try removing filters one by one to isolate the issue.

5. Use Proper JSON Formatting

Ensure your JSON is properly formatted and all strings are quoted correctly.

Getting Help

If you continue to experience issues:
  1. Check the error message carefully - Most errors include specific guidance on how to fix the issue
  2. Review the examples - Compare your query structure to the working examples in the documentation
  3. Contact support - Reach out to Windsurf Support with your specific error message and query

API Version Notes

Error handling and validation have been improved in API version 1.10.0 and later. If you’re using an older version, consider updating to get more detailed error messages.