Add customer event

Submit a customer activity event
Written by Konstantine
Updated 2 years ago

You can associate any activity event with the customer. All events are displayed in the customer profile under User Actions section.

User actions


➡️ Request

URL https://api.helpcrunch.com/v1/events
Method POST
Headers Authorization: Bearer <your_api_key>

You should specify the event data together with the customer id in the body of your POST request. Check the example below.

{
    "name": "Button Click",
    "data": {
        "button": "Start Free Trial",
        "clicks": 2
    },
    "customer": 7830053
}

Read more about authorization header here.


✅ Successful Response

If your request has succeeded, you'll get a 200 OK success status code together with the following response body.

{
    "id": 168990409,
    "name": "Button Click",
    "data": {
        "button": "Start Free Trial",
        "clicks": 2
    },
    "createdAt": 1603885746,
    "customer": 7830053
}


🛑 Error Responses

You may get one of the following error status codes and responses. More info on the errors is available here.

401 Unauthorized

{
    "errors": [
        {
            "code": "invalid_token",
            "message": "Invalid token"
        }
    ]
}

404 Not Found

{
    "errors": [
        {
            "code": "entity_not_found",
            "message": "Customer not found"
        }
    ]
}

429 Too Many Requests

{
    "errors": [
        {
            "code": "too_many_requests",
            "message": "You have exceeded your requests limit"
        }
    ]
}

If you have any questions regarding the REST API, feel free to chat us any time.

👩‍💻 Happy Coding! 👨‍💻

Did this answer your question?