From 59e59334f3dd1ad56fa60f588a05ae0bea9e35d9 Mon Sep 17 00:00:00 2001 From: Terence Ma Date: Wed, 11 Sep 2024 18:05:00 +1000 Subject: [PATCH 1/2] update http api guide with batch limit --- .../sources/catalog/libraries/server/http-api/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/server/http-api/index.md b/src/connections/sources/catalog/libraries/server/http-api/index.md index fa6cca8ceb..6bc49e68a2 100644 --- a/src/connections/sources/catalog/libraries/server/http-api/index.md +++ b/src/connections/sources/catalog/libraries/server/http-api/index.md @@ -461,8 +461,9 @@ When sending a HTTP call from a user's device, you can collect the IP address by 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. -Common reasons events are not accepted by Segment include: - - **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. +Common reasons that events are not accepted by Segment: + - **Payload is too large:** Most HTTP API routes can handle API requests that are 32KB or smaller. If this limit is exceeded, Segment returns a 400 Bad Request error. + - **The `\batch` API endpoint** This endpoint accepts a maximum of 500KB per batch API request. Additionally, each batch request can only have up to 2500 events, and each batched event needs to be less than 32KB. Segment will return a `200` response but reject the event, when the number of batched events exceeds limit. - **Identifier is not present**: The HTTP API requires that each payload has a userId and/or anonymousId. If you send events without either the userId or anonymousId, Segment’s tracking API responds with an no_user_anon_id error. Check the event payload and client instrumentation for more details. - **Track event is missing name**: All Track events sent to Segment must have an `event` field. - **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 with fewer than 100 characters. From 2de9dcd8a41d9b7a4c677bc154a7d413ddbdf129 Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:16:37 -0800 Subject: [PATCH 2/2] Update src/connections/sources/catalog/libraries/server/http-api/index.md --- .../sources/catalog/libraries/server/http-api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/server/http-api/index.md b/src/connections/sources/catalog/libraries/server/http-api/index.md index 1a5854959f..20b91cf22a 100644 --- a/src/connections/sources/catalog/libraries/server/http-api/index.md +++ b/src/connections/sources/catalog/libraries/server/http-api/index.md @@ -464,7 +464,7 @@ Segment returns a `200` response for all API requests except errors caused by la Common reasons that events are not accepted by Segment: - **Payload is too large:** Most HTTP API routes can handle API requests that are 32KB or smaller. If this limit is exceeded, Segment returns a 400 Bad Request error. - - **The `\batch` API endpoint** This endpoint accepts a maximum of 500KB per batch API request. Additionally, each batch request can only have up to 2500 events, and each batched event needs to be less than 32KB. Segment will return a `200` response but reject the event, when the number of batched events exceeds limit. + - **The `\batch` API endpoint:** This endpoint accepts a maximum of 500KB per batch API request. Each batch request can only have up to 2500 events, and each batched event needs to be less than 32KB. Segment returns a `200` response but rejects the event when the number of batched events exceeds the limit. - **Identifier is not present**: The HTTP API requires that each payload has a userId and/or anonymousId. If you send events without either the userId or anonymousId, Segment’s tracking API responds with an no_user_anon_id error. Check the event payload and client instrumentation for more details. - **Track event is missing name**: All Track events sent to Segment must have an `event` field. - **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 with fewer than 100 characters.