---
title: "Troubleshooting"
slug: "troubleshooting-1153275"
abstract: "Describes common errors related to direct Stream API HTTP requests and how to troubleshoot them (Sitecore CDP)."
---
# Troubleshooting

This topic describes the most common errors and solutions when integrating using direct HTTP requests.

## 401 Unauthorized when trying to get the browser ID

When trying to retrieve the browser ID, this error occurs when the value for the `stream_api_target_endpoint` parameter or the value for the `client_key` parameter is incorrect in the URL.

To fix the error:

1. For the `stream_api_target_endpoint` parameter, specify the correct [Stream API target endpoint](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950147122 "Stream API target endpoint").
2. For the `client_key` parameter, specify the correct [client key](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950058068 "Client key").

## 400 Bad Request error when trying to send an event

This error occurs when the event object does not contain a `browser_id` or a `type`.

To fix the error:

1. In the HTTP request, in the `message` query parameter, locate the key-value pairs that describe the event.
2. For the `browser_id` key, specify the browser ID that you previously retrieved.
3. Make sure the [event object contains a `type`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/bx-js-library-legacy-reference/objects-1166464/event-object.html "Event object").

## 404 Not Found error when trying to send an event

This error occurs when the event object contains the incorrect browser ID.

To fix the error:

1. In the HTTP request, in the `message` query parameter, locate the key-value pairs that describe the event.
2. For the `browser_id` key, specify the browser ID that you previously retrieved.

## Events not appearing in Sitecore CDP

If you sent an event to Sitecore CDP and the HTTP response has the `201 Created` status code, this issue occurs if the value for the `pos` key is incorrect.

To fix the error:

1. In the HTTP request, in the `message` query parameter, locate the key-value pairs that describe the event.
2. For the `pos` key, specify the correct [name of a point of sale](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538 "Name of point of sale").