> ## 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.

# Autoresponders

> Build an autoresponder that decides what to send, rather than using a fixed workspace reply.

Plain has native [workspace level auto-responses](/product/platform/auto-responses). For cases those don't cover, implement your own custom autoresponder.

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

To do this, set up endpoint(s) to be notified of one or more [webhooks](/webhooks) from Plain. Listen for the [thread created](/webhooks/thread-created) webhook, which lets you respond to any thread whether it was created via email, Slack or a contact form.

If you want to only reply to emails, you can use the [email received](/webhooks/thread-email-received) webhook. This triggers for every email, not only the first one in a thread, so check the `isStartOfThread` field provided in the webhook payload to ensure you only reply to the first message.

<Warning>
  Note that if you subscribe to both `thread.thread_created` and `thread.email_received` you may
  receive two events for the same email, since we create a new thread for emails which don't belong
  to an existing thread. In order to avoid replying to the same message twice please check the
  `isStartOfThread` field in the `thread.email_received` payload.
</Warning>

Once you have received an event and decided how to respond you can use the `replyToThread` mutation to send a reply back to the customer. See our [API explorer](https://app.plain.com/developer/api-explorer/) for more details.
