Skip to content

Commit 0cb8f3c

Browse files
Merge pull request #3929 from segmentio/3373-content-add-additional-causes-for-rejected-events
Added more clarity to HTTP API errors section
2 parents f42471c + df9a970 commit 0cb8f3c

File tree

1 file changed

+9
-2
lines changed
  • src/connections/sources/catalog/libraries/server/http-api

1 file changed

+9
-2
lines changed

src/connections/sources/catalog/libraries/server/http-api/index.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@ To send data to Segment's HTTP API, a content-type header must be set to `'appli
2424

2525
## Errors
2626

27-
Segment returns a `200` response for all API requests so debugging should be done in the Segment Debugger. The only exception is if the request is too large / JSON is invalid it will respond with a `400`.
27+
Segment returns a `200` response for all API requests except errors caused by large payloads and JSON errors (which return `400` responses.) To debug events that return `200` responses but aren't accepted by Segment, use the Segment Debugger.
2828

29-
Segment welcomes feedback on API responses and error messages. [Reach out to support](https://segment.com/help/contact/) with any requests or suggestions you may have.
29+
Common reasons events are not accepted by Segment include:
30+
- **Payload is too large:** The HTTP API can handle API requests that are 32KB or smaller. The batch API endpoint accepts a maximum of 500KB per request, with a limit of 32KB per event in the batch. If these limits are exceeded, Segment returns a 400 Bad Request error.
31+
- **Identifier is not present**: The HTTP API requires that each payload has a userId and/or anonymousId.
32+
- **Track event is missing name**: All `track` events sent to Segment must have an `event` field.
33+
- **Deduplication**: Segment deduplicates events using the `messageId` field, which is automatically added to all payloads coming into Segment. If you're setting up the HTTP API yourself, ensure all events have unique messageId values.
34+
- **Invalid JSON**: If you send an event with invalid JSON, Segment returns a 400 Bad Request error.
35+
36+
Segment welcomes feedback on API responses and error messages. [Reach out to support](https://segment.com/help/contact/){:target="_blank"} with any requests or suggestions you may have.
3037

3138
## Rate Limits
3239

0 commit comments

Comments
 (0)