> For the complete documentation index, see [llms.txt](https://developers.gleantap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gleantap.com/update-data/create-an-event.md).

# Create an Event

## Create new event

> Create a new event for a contact. To identify the contact, use either user\_id, or email & firstname or phone & firstname

```json
{"openapi":"3.0.0","info":{"title":"Gleantap External API","version":"1.0.0"},"tags":[{"name":"Events","description":"Events"}],"servers":[{"url":"https://api.gleantap.com","description":"Production server"}],"paths":{"/v2/ExternalApi/newEvent":{"post":{"tags":["Events"],"summary":"Create new event","description":"Create a new event for a contact. To identify the contact, use either user_id, or email & firstname or phone & firstname","operationId":"c7ce38012d078737c49077df38e9748b","parameters":[{"name":"X-API-KEY","in":"header","description":"Your API key","required":true,"schema":{"type":"string"}},{"name":"X-SECRET-KEY","in":"header","description":"Your Secret key","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["app_id","user_id","id","event_type","event_date"],"properties":{"app_id":{"type":"string"},"_id":{"type":"string"},"user_id":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"event_type":{"type":"string"},"event_name":{"type":"string"},"event_date":{"description":"Date of the event in YYYY-MM-DD format","type":"string","format":"date"},"event_time":{"description":"Time of the event in HH:MM AM/PM format","type":"string","format":"time"},"id":{"description":"Unique Event ID from your system","type":"string"},"is_visit":{"type":"boolean"},"is_purchase":{"type":"boolean"},"event_data":{"description":"Event data with custom fields such as status, staff etc.","type":"array","items":{"type":"object"}}},"type":"object"}}}},"responses":{"200":{"description":"Event created successfully","content":{"application/json":{"schema":{"properties":{"result":{"type":"string"}},"type":"object"}}}},"400":{"description":"Invalid request"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.gleantap.com/update-data/create-an-event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
