Planhat Logo

Developers

Planhat Logo

Developers

HTTP Response Codes

The Planhat API can respond with 5 possible HTTP codes: 200, 206, 400, 403 and 500.

For all the requests the API will respond with an object or string containing either the created/updated object or information to help you understand a possible error code. This is especially helpful for error codes where more information can help you understand what went wrong with the request.

  • 200: Ok code, this means the operation was successful.

  • 206: Partially Ok code, this means that some operations were successful but there are others with errors.

  • 400: Bad request, this means that you have a problem with the request payload, usually a required key is missing or it's duplicated.

  • 403: Permission error, this means that you don't have the right permissions to execute the operation. Check that your API token has the correct permissions.

  • 500: Server error, this means that there was an error on the Planhat side, try again and if you get the same 500 error please contact support.

Why are we always returning 200 for endpoints on our tracking & metrics base URL?

We have built these endpoints as “data sinks”. In this context, 200 means that we have successfully received the data for processing.

There are two key reasons we do not process the data in real-time and return a final result:

  • Firstly, due to the high data volumes and significant processing required for each event (e.g., analytics events need to be linked to the correct company, and an end user may be created and linked automatically in the process).

  • Secondly, because Metrics data is often sent by our Tracking Script, the request often goes directly from your enduser's browser to our endpoint, meaning there is no value in returning any errors.

The Planhat API can respond with 5 possible HTTP codes: 200, 206, 400, 403 and 500.

For all the requests the API will respond with an object or string containing either the created/updated object or information to help you understand a possible error code. This is especially helpful for error codes where more information can help you understand what went wrong with the request.

  • 200: Ok code, this means the operation was successful.

  • 206: Partially Ok code, this means that some operations were successful but there are others with errors.

  • 400: Bad request, this means that you have a problem with the request payload, usually a required key is missing or it's duplicated.

  • 403: Permission error, this means that you don't have the right permissions to execute the operation. Check that your API token has the correct permissions.

  • 500: Server error, this means that there was an error on the Planhat side, try again and if you get the same 500 error please contact support.

Why are we always returning 200 for endpoints on our tracking & metrics base URL?

We have built these endpoints as “data sinks”. In this context, 200 means that we have successfully received the data for processing.

There are two key reasons we do not process the data in real-time and return a final result:

  • Firstly, due to the high data volumes and significant processing required for each event (e.g., analytics events need to be linked to the correct company, and an end user may be created and linked automatically in the process).

  • Secondly, because Metrics data is often sent by our Tracking Script, the request often goes directly from your enduser's browser to our endpoint, meaning there is no value in returning any errors.

The Planhat API can respond with 5 possible HTTP codes: 200, 206, 400, 403 and 500.

For all the requests the API will respond with an object or string containing either the created/updated object or information to help you understand a possible error code. This is especially helpful for error codes where more information can help you understand what went wrong with the request.

  • 200: Ok code, this means the operation was successful.

  • 206: Partially Ok code, this means that some operations were successful but there are others with errors.

  • 400: Bad request, this means that you have a problem with the request payload, usually a required key is missing or it's duplicated.

  • 403: Permission error, this means that you don't have the right permissions to execute the operation. Check that your API token has the correct permissions.

  • 500: Server error, this means that there was an error on the Planhat side, try again and if you get the same 500 error please contact support.

Why are we always returning 200 for endpoints on our tracking & metrics base URL?

We have built these endpoints as “data sinks”. In this context, 200 means that we have successfully received the data for processing.

There are two key reasons we do not process the data in real-time and return a final result:

  • Firstly, due to the high data volumes and significant processing required for each event (e.g., analytics events need to be linked to the correct company, and an end user may be created and linked automatically in the process).

  • Secondly, because Metrics data is often sent by our Tracking Script, the request often goes directly from your enduser's browser to our endpoint, meaning there is no value in returning any errors.