Skip to main content

Post Error

General API Information

HTTP Return Codes

  • HTTP 200 return codes are used for success requests.
  • HTTP 4XX return codes are used for malformed requests; the issue is on the sender’s side.
  • HTTP 5XX return codes are used for internal errors; the issue is on Retack.AI side.

General Information on Endpoints

  • For GET endpoints, parameters must be sent as a query string.
  • For POST, PUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded. You may mix parameters between both the query string and request body if you wish to do so.
  • Parameters may be sent in any order.
  • If a parameter is sent in both the query string and request body, the query string parameter will be used.

ENV-KEY

  • Before proceeding further, ensure you have an ENV-KEY for your project source.
  • If you already have an ENV-KEY, proceed further with posting an error with title and stack_trace.
  • If you do not have an ENV-KEY yet, please follow this guide.

HTTP_X_USER_CONTEXT

In addition to the ENV-KEY, we require HTTP_X_USER_CONTEXT header that works as User Context.

The User Context is a unique identifier that represents the user or device that experienced the error. In most cases, this will be the IP address of the device or user session. However, you can also choose to provide a different identifier, such as a username or session ID, as long as it uniquely identifies the user or device.

The User Context helps distinguish whether an error was experienced by multiple users or if a single user encountered the same issue multiple times.

HTTP Request

POST /observe/error-log/

Request Parameters

ParameterRequiredTypeComments
titletruestringTitle of the error.
stack_tracetruestringStack trace of the error.

Request Example

CURL

curl -X POST https://api.retack.ai/observe/error-log/ \
-H 'ENV-KEY: <YOUR-ENV-KEY>' \
-H 'HTTP_X_USER_CONTEXT: <UNIQUE-USER-IDENTIFIER>' \
-H 'Content-Type: application/json' \
-d '{"title": "<ERROR_TITLE>", "stack_trace": "<ERROR-STACK_TRACE>"}'

Raw

POST /observe/error-log/
Host: api.retack.ai
Header: ENV-KEY: XXXXX
Header: HTTP_X_USER_CONTEXT: XXXXX

Response Example

status: 200