> ## Documentation Index
> Fetch the complete documentation index at: https://plain-docs-orca-916-agent-docs-restructure.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a customer event

> Add a custom event to every thread belonging to a customer.

Customer events let you record something that happened in your own product against a customer, so it appears in the timeline of every thread that customer has.

<Snippet file="graphql/sdk-note.mdx" />

<Info>
  A customer event will be created in all threads that belong to the provided customer ID. If you
  want an event to appear in a specific thread use a [thread
  event](/graphql/events/create-thread-event).
</Info>

To create an event you need a customer ID.

You can get this by [upserting a customer](/graphql/customers/upsert) in Plain, from data in webhooks or other API calls you made. If you want to test this, press <kbd>⌘</kbd> + <kbd>K</kbd> on any thread and then "Copy customer ID" to get an ID you can experiment with.

In this example we'll be creating the following event:

<Frame>
  <img src="https://mintcdn.com/plain-docs-orca-916-agent-docs-restructure/wMjMwWh_ieDOjCce/public/images/events-api-key-example.png?fit=max&auto=format&n=wMjMwWh_ieDOjCce&q=85&s=4a58477d5db2e692246e3ac897bffd9c" alt="Example event" width="1972" height="634" data-path="public/images/events-api-key-example.png" />
</Frame>

For this you'll need an API key with the following permissions:

* `customerEvent:create`

<Snippet file="graphql/create-customer-event.mdx" />
