diff --git a/api-reference/attachments.mdx b/api-reference/attachments.mdx index 5d7547c..ba628f3 100644 --- a/api-reference/attachments.mdx +++ b/api-reference/attachments.mdx @@ -13,7 +13,7 @@ At a high level to upload attachments you: ## Step by step guide -To try this, you will need an [API key](/graphql/authentication/) with the following permission: +To try this, you will need an [API key](/api-reference/graphql/authentication/) with the following permission: - `attachment:create` diff --git a/api-reference/customer-cards.mdx b/api-reference/customer-cards.mdx index f807063..a8f91cb 100644 --- a/api-reference/customer-cards.mdx +++ b/api-reference/customer-cards.mdx @@ -26,7 +26,7 @@ Your API should then reply with a list of cards matching the requested keys wher ## UI Components -To define what each customer card should look like, you use the Plain UI components. All the components are documented in the [Plain UI Components](/ui-components/) section. +To define what each customer card should look like, you use the Plain UI components. All the components are documented in the [Plain UI Components](/api-reference/ui-components/) section. You can find example Customer Cards and an example API you can check out [team-plain/example-customer-cards](https://github.com/team-plain/example-customer-cards). Feel free to try these out in your workspace! diff --git a/api-reference/customer-cards/documentation.mdx b/api-reference/customer-cards/documentation.mdx index f995d5b..ec4f710 100644 --- a/api-reference/customer-cards/documentation.mdx +++ b/api-reference/customer-cards/documentation.mdx @@ -4,7 +4,7 @@ title: 'Customer Cards Documentation' This page is intended for a technical audience that will be implementing a Customer Card API. -Check out the [Customer Cards](/pages/customer-cards) page for an overview. +Check out the [Customer Cards](/customer-cards) page for an overview. ## Protocol overview @@ -20,7 +20,7 @@ The protocol is as follows: details). 4. Your APIs are then called with the customer's details, so you can look up the customer's data in your systems (see [request](#request) section for details). -5. Your APIs then return Customer Cards that consist of [Plain UI components](/ui-components) +5. Your APIs then return Customer Cards that consist of [Plain UI components](/api-reference/ui-components) (see [response](#response) section for details). 6. The cards are cached based on either an explicit TTL value in the response or the TTL in the card settings. 7. Cards are shown to the user in Plain. @@ -122,7 +122,7 @@ The response body must be a JSON object with: cards will be ignored. - `key`: the requested key - `timeToLiveSeconds` (optional, nullable): can either be omitted or `null`. If provided it will override the default time to live value. This allows you to control caching on a case-by-case basis. - - `components` (nullable): `null` to indicate that the card has no data or an array of [Plain UI Components](/ui-components/). + - `components` (nullable): `null` to indicate that the card has no data or an array of [Plain UI Components](/api-reference/ui-components/). Example response body for a card cached for 1 hour: diff --git a/api-reference/graphql/customers.mdx b/api-reference/graphql/customers.mdx index 765d147..c5c41c2 100644 --- a/api-reference/graphql/customers.mdx +++ b/api-reference/graphql/customers.mdx @@ -9,6 +9,6 @@ However, using our API to manage customers proactively can be helpful when you a For example: -- You can [**put customers into groups**](/graphql/customers-setup/customer-groups/) to better organize your support queue. For example, you could group customers by pricing tier (e.g. Free Tier, Teams, Enterprise) -- You can [**create customers**](/graphql/customers-setup/upsert/) in Plain when they sign-up on your own site so that you can reach out to them proactively without waiting for them to get in touch. -- You can [**save your own customer's ID**](/graphql/customers-setup/upsert) for use with [**Customer Cards**](/customer-cards/). +- You can [**put customers into groups**](/api-reference/graphql/customers/customer-groups/) to better organize your support queue. For example, you could group customers by pricing tier (e.g. Free Tier, Teams, Enterprise) +- You can [**create customers**](/api-reference/graphql/customers/upsert/) in Plain when they sign-up on your own site so that you can reach out to them proactively without waiting for them to get in touch. +- You can [**save your own customer's ID**](/api-reference/graphql/customers/upsert) for use with [**Customer Cards**](/customer-cards/). diff --git a/api-reference/graphql/customers/delete.mdx b/api-reference/graphql/customers/delete.mdx index 96a7c66..9b1f3f5 100644 --- a/api-reference/graphql/customers/delete.mdx +++ b/api-reference/graphql/customers/delete.mdx @@ -4,7 +4,7 @@ title: 'Delete customers' You can delete customers with the `deleteCustomer` API, you will find this name in both our API and our SDKs. -To delete a customer you will need the customer's ID from within Plain. You can get this ID in the UI by going to a thread from that customer and pressing the 'Copy ID' button from the customer details panel on the right, or via our [fetch API](/graphql/customers/get). +To delete a customer you will need the customer's ID from within Plain. You can get this ID in the UI by going to a thread from that customer and pressing the 'Copy ID' button from the customer details panel on the right, or via our [fetch API](/api-reference/graphql/customers/get). Deleting a customer will trigger an asynchronous process which causes all data (such as threads) associated with that customer to be deleted. diff --git a/api-reference/graphql/customers/get.mdx b/api-reference/graphql/customers/get.mdx index b667f1c..b89580f 100644 --- a/api-reference/graphql/customers/get.mdx +++ b/api-reference/graphql/customers/get.mdx @@ -16,7 +16,7 @@ All of these endpoints require the following permissions: ## Get customers -Our API allows you to fetch customers as a collection using `getCustomers` in our SDKs or the `customers` query in GraphQL. In both cases this endpoint supports [Pagination](/graphql/pagination). +Our API allows you to fetch customers as a collection using `getCustomers` in our SDKs or the `customers` query in GraphQL. In both cases this endpoint supports [Pagination](/api-reference/graphql/pagination). This is a very flexible endpoint which supports a variety of options for filtering and sorting, for full details try our [API explorer](https://app.plain.com/developer/api-explorer/) or [Typescript SDK](https://github.com/team-plain/typescript-sdk/). diff --git a/api-reference/graphql/error-handling.mdx b/api-reference/graphql/error-handling.mdx index fdff70a..08a2103 100644 --- a/api-reference/graphql/error-handling.mdx +++ b/api-reference/graphql/error-handling.mdx @@ -49,7 +49,7 @@ Every `MutationError` has the following fields (assuming you included all these - Where `VALIDATION` means input validation failed. See the fields for details on why the input was invalid. - Where `FORBIDDEN` means the user is not authorized to do this mutation. See `message` for details on which permissions are missing. - Where `INTERNAL` means an unknown internal server error occurred. Retry in this scenario and contact help@plain.com if the error persists. -- **code:** a unique error code for each type of error returned. This code can be used to provide a localized or user-friendly error message. You can find the [list of error codes](/error-codes) documented. +- **code:** a unique error code for each type of error returned. This code can be used to provide a localized or user-friendly error message. You can find the [list of error codes](/api-reference/graphql/error-codes) documented. - **fields:** an array containing all the fields that errored - **field:** the name of the input field the error is for. - **message:** an English technical description of the error. This error is usually meant to be read by a developer and not an end user. diff --git a/api-reference/graphql/events.mdx b/api-reference/graphql/events.mdx index c2b0646..a77f28e 100644 --- a/api-reference/graphql/events.mdx +++ b/api-reference/graphql/events.mdx @@ -10,12 +10,12 @@ Events are created via the Plain API and you have full control of what they look There are two types of events -- **[Customer events](/graphql/events/create-customer-event)**: these are created in every existing thread for a customer. When a anew thread is created (e.g. by an inbound communication, or by calling the [createThread](/graphql/threads/create) endpoint) the **25** most recent events are shown. -- **[Thread events](/graphql/events/create-thread-event)**: these events belong to a single thread, and only appear in a single thread's timeline. +- **[Customer events](/api-reference/graphql/events/create-customer-event)**: these are created in every existing thread for a customer. When a anew thread is created (e.g. by an inbound communication, or by calling the [createThread](/api-reference/graphql/threads/create) endpoint) the **25** most recent events are shown. +- **[Thread events](/api-reference/graphql/events/create-thread-event)**: these events belong to a single thread, and only appear in a single thread's timeline. ## UI Components -To define what each event should look like, you use the Plain UI components. All the components are documented in the [Plain UI Components](/ui-components/) section. +To define what each event should look like, you use the Plain UI components. All the components are documented in the [Plain UI Components](/api-reference/ui-components/) section. ### Playground diff --git a/api-reference/graphql/events/create-customer-event.mdx b/api-reference/graphql/events/create-customer-event.mdx index 3b9015c..f51a02b 100644 --- a/api-reference/graphql/events/create-customer-event.mdx +++ b/api-reference/graphql/events/create-customer-event.mdx @@ -5,16 +5,16 @@ title: 'Create a customer event' 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). + event](/api-reference/graphql/events/create-thread-event). 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 **⌘ + K** on any thread and then "Copy customer ID" to get an ID you can experiment with. +You can get this by [upserting a customer](/api-reference/graphql/customers/upsert) in Plain, from data in webhooks or other API calls you made. If you want to test this, press **⌘ + K** 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: -![Example event](/public/images/events/events-example.png) +![Example event](/public/images/events-api-key-example.png) diff --git a/api-reference/graphql/events/create-thread-event.mdx b/api-reference/graphql/events/create-thread-event.mdx index c528381..f6d5bfb 100644 --- a/api-reference/graphql/events/create-thread-event.mdx +++ b/api-reference/graphql/events/create-thread-event.mdx @@ -4,16 +4,17 @@ title: 'Create a thread event' A thread event will only be created in the thread ID provided. If you want an event to appear in - all threads for a customer please use a [customer event](/graphql/events/create-customer-event). + all threads for a customer please use a [customer + event](/api-reference/graphql/events/create-customer-event). To create a thread event you need a thread ID. -You can get this by [creating a thread](/graphql/threads/create) in Plain, from data in webhooks or other API calls you made. If you want to test this, press **⌘ + K** on any thread and then "Copy thread ID" to get an ID you can experiment with. +You can get this by [creating a thread](/api-reference/graphql/threads/create) in Plain, from data in webhooks or other API calls you made. If you want to test this, press **⌘ + K** on any thread and then "Copy thread ID" to get an ID you can experiment with. In this example we'll be creating the following event: -![Example event](/public/images/events/events-example.png) +![Example event](/public/images/events-api-key-example.png) diff --git a/api-reference/graphql/introduction.mdx b/api-reference/graphql/introduction.mdx index 2b7a42e..47cc897 100644 --- a/api-reference/graphql/introduction.mdx +++ b/api-reference/graphql/introduction.mdx @@ -6,7 +6,7 @@ description: "An overview of Plain's GraphQL API." Plain is built with this very GraphQL API we expose to you. This means that there are **no limitations** in what can be done via the API vs the UI. -These docs just highlight the most interesting and most used APIs. If you want to do something beyond what is documented here, please [reach out to us](mailto:help@plain.com) or explore our [schema](/docs/api-reference/graphql/schema) on your own! +These docs just highlight the most interesting and most used APIs. If you want to do something beyond what is documented here, please [reach out to us](mailto:help@plain.com) or explore our [schema](/api-reference/graphql/schema) on your own! ## Key details @@ -16,7 +16,7 @@ Our API is compatible with all common GraphQL clients with the following details - **Allowed method**: POST - **Required headers:** - `Content-Type: application/json` - - `Authorization: Bearer ` where token is your API key. See [authentication](/graphql-api/authentication/) for more details. + - `Authorization: Bearer ` where token is your API key. See [authentication](/api-reference/graphql/authentication/) for more details. - **JSON body:** - `query`: the GraphQL query string - `variables`: a JSON object of variables used in the GraphQL query @@ -29,7 +29,7 @@ from: `https://core-api.uk.plain.com/graphql/v1/schema.graphql` In this example, we're going to get a customer in your workspace by their email address. You can find a customer's email on the right-hand side when looking at one of their threads in Plain. -You will need an API key with the `customer:read` permission. See [authentication](/graphql-api/authentication/) for details on how to get an API key +You will need an API key with the `customer:read` permission. See [authentication](/api-reference/graphql/authentication/) for details on how to get an API key diff --git a/api-reference/graphql/labels.mdx b/api-reference/graphql/labels.mdx index dd1422f..f9ec76b 100644 --- a/api-reference/graphql/labels.mdx +++ b/api-reference/graphql/labels.mdx @@ -11,4 +11,4 @@ The available labels you can apply are defined by your label types. Label types When you want to stop a label being available you can archive a label type. Archived label types are kept on existing threads in order to avoid losing valuable historic data. -Label changes can also be a starting point for integrations [via our webhooks](/webhooks/thread-labels-changed). This lets you build workflows triggered by the addition of a label. +Label changes can also be a starting point for integrations [via our webhooks](/api-reference/webhooks/thread-labels-changed). This lets you build workflows triggered by the addition of a label. diff --git a/api-reference/graphql/messaging.mdx b/api-reference/graphql/messaging.mdx index 0e17c67..5f2d94e 100644 --- a/api-reference/graphql/messaging.mdx +++ b/api-reference/graphql/messaging.mdx @@ -6,13 +6,21 @@ sidebarTitle: 'Overview' We provide various methods to message your customers with the Plain API. You can use this to reach out proactively, build an autoresponder or even to handle things like waiting list access. - + Send a new email in a thread ignoring previous communications. - + Use this to reply to an existing inbound email in a thread. - + Reply to a thread automatically using the best channel. diff --git a/api-reference/graphql/messaging/reply-to-thread.mdx b/api-reference/graphql/messaging/reply-to-thread.mdx index d181fd9..08d16cf 100644 --- a/api-reference/graphql/messaging/reply-to-thread.mdx +++ b/api-reference/graphql/messaging/reply-to-thread.mdx @@ -5,15 +5,15 @@ title: 'Reply to threads' You can reply to a thread using the `replyToThread` mutation. The call to this mutation will be successful if: - the last message in the thread is an email from the customer OR -- the thread was just created with [`createThread`](/graphql/threads/create) +- the thread was just created with [`createThread`](/api-reference/graphql/threads/create) -If it is not possible to reply to this thread, you will get the mutation error code [`cannot_reply_to_thread`](/graphql/error-codes#cannot_reply_to_thread) and a message indicating why. +If it is not possible to reply to this thread, you will get the mutation error code [`cannot_reply_to_thread`](/api-reference/graphql/error-codes#cannot_reply_to_thread) and a message indicating why. Using the `replyToThread` mutation is the recommended way to create a simple auto-responder with Plain. To do it, you should subscribe to the - [`thread.thread_created`](/../../webhooks/thread-created) event and use use this mutation whenever - you get this event. + [`thread.thread_created`](/api-reference/webhooks/thread-created) event and use use this mutation + whenever you get this event. diff --git a/api-reference/graphql/threads/create.mdx b/api-reference/graphql/threads/create.mdx index 4f21d3f..eaf0efa 100644 --- a/api-reference/graphql/threads/create.mdx +++ b/api-reference/graphql/threads/create.mdx @@ -6,9 +6,9 @@ Creating a thread is useful in scenarios where you want to programatically start You can do this in many different scenarios but the most common use-cases are when a contact form is submitted or when you want to provide proactive support off the back of some event or error happening in your product. -A thread is created with an initial 'message' composed out of [UI components](/docs/ui-components). You have full control over the structure and appearance of the message in Plain. +A thread is created with an initial 'message' composed out of [UI components](/api-reference/ui-components). You have full control over the structure and appearance of the message in Plain. -To create a thread you need a `customerId`. You can get a customer id by [creating the customer](/docs/customers/upsert) in Plain first. +To create a thread you need a `customerId`. You can get a customer id by [creating the customer](/api-reference/graphql/customers/upsert) in Plain first. diff --git a/api-reference/migrate-to-threads.mdx b/api-reference/migrate-to-threads.mdx index f95d3ac..cf2b140 100644 --- a/api-reference/migrate-to-threads.mdx +++ b/api-reference/migrate-to-threads.mdx @@ -60,17 +60,17 @@ In the ✨ **new** ✨ version of Plain: Custom Timeline Entries are deprecated and replaced by two purpose made APIs: `createThread` and `createCustomerEvent`. -If you are calling `upsertCustomTimelineEntry` off the back of a contact form or if you are calling it with `changeCustomerStatusToActive` set to true, then you need to migrate this code to [**create a thread**](/pages/graphql/threads/create) instead. +If you are calling `upsertCustomTimelineEntry` off the back of a contact form or if you are calling it with `changeCustomerStatusToActive` set to true, then you need to migrate this code to [**create a thread**](/api-reference/graphql/threads/create) instead. -If you are calling `upsertCustomTimelineEntry` to just log an event which doesn't require an action from anyone in your team but is just context on the customer, then you need to migrate this code to [**create a customer event**](/pages/graphql/events/create-customer-event). +If you are calling `upsertCustomTimelineEntry` to just log an event which doesn't require an action from anyone in your team but is just context on the customer, then you need to migrate this code to [**create a customer event**](/api-reference/graphql/events/create-customer-event). ### Issue APIs Issues are completely deprecated and instead replaced light-weight labels on threads. -If you were previously creating an issue off the back of something happening in your systems you can now [create a thread](/pages/thread/create) and specify the labels you want on creation. +If you were previously creating an issue off the back of something happening in your systems you can now [create a thread](/api-reference/graphql/threads/create) and specify the labels you want on creation. -Depending on your use case you can also separately [add labels to a thread](/pages/graphql/labels/add) or [remove labels from a thread](/pages/graphql/labels/remove). +Depending on your use case you can also separately [add labels to a thread](/api-reference/graphql/labels/add) or [remove labels from a thread](/api-reference/graphql/labels/remove). If you were using any issue APIs to update or change the prority on issues you can now instead set the priority directly when creating a thread. @@ -78,17 +78,17 @@ If you were using any issue APIs to update or change the prority on issues you c Assignment has moved from the customer to their threads. This means that if you were previously changing the assignment of a customer you now instead need to assign or unassign a thread. -Check out the [thread assignment](/pages/graphql/threads/assignment) documentation to migrate. +Check out the [thread assignment](/api-reference/graphql/threads/assignment) documentation to migrate. ### Changing customer statuses -Customers no longer have a status. If you were snoozing or changing the customer's status you need to migrate that code to [change the thread's status](/pages/graphql/threads/status-changes/) instead. +Customers no longer have a status. If you were snoozing or changing the customer's status you need to migrate that code to [change the thread's status](/api-reference/graphql/threads/status-changes/) instead. ## Breaking webhook changes ### `customer.customer_status_transitioned` -The customer no longer has a status so this webhook event has been deprecated. Depending on your intentions you may want to swap this out for the [thread status transitioned event](/pages/webhooks/thread-status-transitioned). +The customer no longer has a status so this webhook event has been deprecated. Depending on your intentions you may want to swap this out for the [thread status transitioned event](/api-reference/webhooks/thread-status-transitioned). ### `timeline.timeline_entry_changed` @@ -96,20 +96,20 @@ This event reported all timeline entry changes and made it very challenging to d As a result we're fully deprecating this event and have replaced it with a list of smaller and simpler events to follow and parse: -- [Email received](/pages/webhooks/email-received) -- [Email sent](/pages/webhooks/email-sent) -- [Thread priority change](/pages/webhooks/thread-priority-changed) -- [Thread labels change](/pages/webhooks/thread-labels-changed) -- [Thread assignment transitioned](/pages/webhooks/thread-assignment-transitioned) -- [Thread status transitioned](/pages/webhooks/thread-status-transitioned) +- [Email received](/api-reference/webhooks/thread-email-received) +- [Email sent](/api-reference/webhooks/thread-email-sent) +- [Thread priority change](/api-reference/webhooks/thread-priority-changed) +- [Thread labels change](/api-reference/webhooks/thread-labels-changed) +- [Thread assignment transitioned](/api-reference/webhooks/thread-assignment-transitioned) +- [Thread status transitioned](/api-reference/webhooks/thread-status-transitioned) ### `customer.customer_changed` This event was deprecated and 'unbundled' into smaller, more specific events: -- [Customer created](/pages/webhooks/customer-created) -- [Customer updated](/pages/webhooks/customer-updated) -- [Customer deleted ](/pages/webhooks/customer-deleted) +- [Customer created](/api-reference/webhooks/customer-created) +- [Customer updated](/api-reference/webhooks/customer-updated) +- [Customer deleted ](/api-reference/webhooks/customer-deleted) --- diff --git a/api-reference/ui-components.mdx b/api-reference/ui-components.mdx index fd70807..0f7ccfc 100644 --- a/api-reference/ui-components.mdx +++ b/api-reference/ui-components.mdx @@ -3,7 +3,7 @@ title: 'UI Components' sidebarTitle: 'Overview' --- -UI components are a way of describing some UI when using Plain's [Customer Timeline Entries](/pages/custom-timeline-entries)and [Customer Cards](/pages/customer-cards). +UI components are a way of describing some UI when create threads or [events](/events) or building [Customer Cards](/customer-cards). For example - this is a button that links to Stripe. diff --git a/api-reference/ui-components/container.mdx b/api-reference/ui-components/container.mdx index 132eb51..d3215b9 100644 --- a/api-reference/ui-components/container.mdx +++ b/api-reference/ui-components/container.mdx @@ -3,7 +3,7 @@ title: 'Container' description: 'Useful when you need to create a bit of structure.' --- -![Example container](/public//images/ui-components/container.png) +![Example container](/public/images/ui-component-container.png) A container has the following properties: @@ -11,14 +11,14 @@ A container has the following properties: Allowed components within a Container are: -- [Badge](/ui-components/badge) -- [CopyButton](/ui-components/copy-button) -- [Divider](/ui-components/divider) -- [LinkButton](/ui-components/link-button) -- [Row](/ui-components/row) -- [Spacer](/ui-components/spacer) -- [Text](/ui-components/text) -- [PlainText](/ui-components/plain-text) +- [Badge](/api-reference/ui-components/badge) +- [CopyButton](/api-reference/ui-components/copy-button) +- [Divider](/api-reference/ui-components/divider) +- [LinkButton](/api-reference/ui-components/link-button) +- [Row](/api-reference/ui-components/row) +- [Spacer](/api-reference/ui-components/spacer) +- [Text](/api-reference/ui-components/text) +- [PlainText](/api-reference/ui-components/plain-text) For example: diff --git a/api-reference/ui-components/plain-text.mdx b/api-reference/ui-components/plain-text.mdx index df89aa1..ebb9d34 100644 --- a/api-reference/ui-components/plain-text.mdx +++ b/api-reference/ui-components/plain-text.mdx @@ -1,6 +1,6 @@ --- title: 'PlainText' -description: 'Useful when you want to show any text that should not have any formatting (is not Markdown). If you want markdown please use [Text](/ui-components/text).' +description: 'Useful when you want to show any text that should not have any formatting (is not Markdown). If you want markdown please use [Text](/api-reference/ui-components/text).' --- ![Example link button](/public/images/ui-component-plain-text.png) diff --git a/api-reference/ui-components/row.mdx b/api-reference/ui-components/row.mdx index edeefaf..34247ae 100644 --- a/api-reference/ui-components/row.mdx +++ b/api-reference/ui-components/row.mdx @@ -12,13 +12,13 @@ The row component has the following properties: The following components can be used in a row: -- [Badge](/ui-components/badge) -- [CopyButton](/ui-components/copy-button) -- [Divider](/ui-components/divider) -- [LinkButton](/ui-components/link-button) -- [Spacer](/ui-components/spacer) -- [Text](/ui-components/text) -- [PlainText](/ui-components/plain-text) +- [Badge](/api-reference/ui-components/badge) +- [CopyButton](/api-reference/ui-components/copy-button) +- [Divider](/api-reference/ui-components/divider) +- [LinkButton](/api-reference/ui-components/link-button) +- [Spacer](/api-reference/ui-components/spacer) +- [Text](/api-reference/ui-components/text) +- [PlainText](/api-reference/ui-components/plain-text) For example: diff --git a/api-reference/webhooks.mdx b/api-reference/webhooks.mdx index 917d1a4..b5e0232 100644 --- a/api-reference/webhooks.mdx +++ b/api-reference/webhooks.mdx @@ -119,7 +119,7 @@ If you prefer, you can browse the schema using [this interactive tool](https://j | `webhookMetadata` | `object` | Metadata associated with the webhook request. See [Webhook Metadata](#webhook-metadata) for more details | | `timestamp` | `string` | The Plain event's timestamp. In UTC and formatted as ISO8601. E.g. `1989-10-28T17:30:00.000Z` | | `workspaceId` | `string` | The ID of the workspace where the Plain event originated | -| `payload` | `object` | The Plain event's payload [(Example)](/webhooks/customer-status-transitioned); | +| `payload` | `object` | The Plain event's payload [(Example)](/api-reference/webhooks/thread-created); | ### Webhook Metadata [#webhook-metadata] diff --git a/api-reference/webhooks/thread-created.mdx b/api-reference/webhooks/thread-created.mdx index 6886e54..fe69f5a 100644 --- a/api-reference/webhooks/thread-created.mdx +++ b/api-reference/webhooks/thread-created.mdx @@ -9,10 +9,11 @@ You can subscribe to this event **if you want to build an auto-responder**. To d Every email you receive in your workspace is linked to a thread. If we cannot find a matching thread for an email, we will create one. When this happens, you may receive two events: - `thread.thread_created` and [`thread.email_received`](/webhooks/email-received) (depending on your + `thread.thread_created` and + [`thread.email_received`](/api-reference/webhooks/thread-email-received) (depending on your webhook target event subscriptions). If you do, and you only care about emails which are not the first message of the thread, please check the `isStartOfThread` in the - [`thread.email_received`](/webhooks/email-received) payload. + [`thread.email_received`](/api-reference/webhooks/thread-email-received) payload. ## Schema diff --git a/api-reference/webhooks/thread-email-received.mdx b/api-reference/webhooks/thread-email-received.mdx index 640e905..3cd1fac 100644 --- a/api-reference/webhooks/thread-email-received.mdx +++ b/api-reference/webhooks/thread-email-received.mdx @@ -8,7 +8,7 @@ This event is fired when an email is received in your workspace. An important field that might go unnoticed is `isStartOfThread`. This will tell you if this email is the first message of a thread or not, which is useful if you want to build some auto-reply logic. If you want to build an auto-responder that *only replies* to the first message of a - thread, please check [`thread.thread_created`](/webhooks/thread-created) instead. + thread, please check [`thread.thread_created`](/api-reference/webhooks/thread-created) instead. ## Schema diff --git a/api-reference/webhooks/thread-email-sent.mdx b/api-reference/webhooks/thread-email-sent.mdx index 0c00bde..aa6a6a5 100644 --- a/api-reference/webhooks/thread-email-sent.mdx +++ b/api-reference/webhooks/thread-email-sent.mdx @@ -8,7 +8,7 @@ This event is fired when an email is sent in your workspace. An important field that might go unnoticed is `isStartOfThread`. This will tell you if this email is the first message of a thread or not, which is useful if you want to build some auto-reply logic. If you want to build an auto-responder that *only replies* to the first message of a - thread, please check [`thread.thread_created`](/webhooks/thread-created) instead. + thread, please check [`thread.thread_created`](/api-reference/webhooks/thread-created) instead. ## Schema diff --git a/contact-forms.mdx b/contact-forms.mdx index e173bbb..b65f576 100644 --- a/contact-forms.mdx +++ b/contact-forms.mdx @@ -7,9 +7,9 @@ With contact forms, you can pre-triage every support request so that when you kn Plain **does not** provide any UI components or a drop-in script tag. Instead, you use your own UI components and then use Plain's API. -When a contact form is submitted, you first [create the customer in Plain](/pages/graphql/customers/upsert) and then [create a thread](/pages/graphql/threads/create) in Plain. +When a contact form is submitted, you first [create the customer in Plain](/api-reference/graphql/customers/upsert) and then [create a thread](/api-reference/graphql/threads/create) in Plain. -Depending on your desired behavior, you can also do other things as part of the form submission, such as [add the customer to a customer group](/graphql/customers/customer-groups), [set labels](/labels-setup), and add a priority to a thread. Contact forms can take any shape and be very specific to your product and customers. +Depending on your desired behavior, you can also do other things as part of the form submission, such as [add the customer to a customer group](/api-reference/graphql/customers/customer-groups), [set labels](/labels), and add a priority to a thread. Contact forms can take any shape and be very specific to your product and customers. Here are just a few examples as starting points for you to customize: diff --git a/customer-groups.mdx b/customer-groups.mdx index 6a3ab01..c69da2c 100644 --- a/customer-groups.mdx +++ b/customer-groups.mdx @@ -9,6 +9,6 @@ Customer groups can be used to organize and segment your customers. For example You can configure the groups in your workspace by going to **Settings** → **Customer Groups** where you can set a name and color per group. -You can then either manually add a customer to a group from any thread or you can programatically [via the API](/docs/api-reference/graphql/customers/customer-groups). +You can then either manually add a customer to a group from any thread or you can programatically [via the API](/api-reference/graphql/customers/customer-groups). You can also filter threads by customer groups so you can for example prioritise threads belonging to Enterprise customers. diff --git a/email.mdx b/email.mdx index f833fb4..7b2565b 100644 --- a/email.mdx +++ b/email.mdx @@ -6,16 +6,8 @@ sidebarTitle: 'Overview' Setting up email requires you to complete two steps: - - + + If you follow this guide, bear in mind that: diff --git a/events.mdx b/events.mdx index e941fd9..be3c4d0 100644 --- a/events.mdx +++ b/events.mdx @@ -5,7 +5,7 @@ description: "Events are a powerful API feature of Plain which let you log key e ![Screenshot of the Events](/public/images/events-introduction.png) -When you create an event in Plain, you can specify the content of the event using a simple GraphQL request and our [UI Components](/ui-components). +When you create an event in Plain, you can specify the content of the event using a simple GraphQL request and our [UI Components](/api-reference/ui-components). When a customer gets in touch, you will see the events you created on the thread's timeline, along with all other messages and activity. @@ -15,4 +15,4 @@ Some examples use-cases of events: - Logging errors or potential issues your customers run into (e.g. someone encounters an unexpected error using your product) - Logging key events in your own system such as the changing of feature flags or releases. -[**Jump to documentation →**](/pages/graphql/events) +[**Jump to documentation →**](/api-reference/graphql/events) diff --git a/labels.mdx b/labels.mdx index a573725..1ecd5f7 100644 --- a/labels.mdx +++ b/labels.mdx @@ -26,4 +26,4 @@ A thread can have multiple labels. They are displayed throughout the Plain UI wh In many cases, it's also useful to add labels to threads programatically. -[**Jump to documentation →**](/pages/graphql/labels) +[**Jump to documentation →**](/api-reference/graphql/labels) diff --git a/quickstart.mdx b/quickstart.mdx index f27f24b..953f8f0 100644 --- a/quickstart.mdx +++ b/quickstart.mdx @@ -56,7 +56,7 @@ Events let you log important customer actions, errors, releases and other events Setting up customer groups can lets you organize and segment your customers and their threads. For example you could organise your customers by their tier “Free”, “Growth, “Enterprise” and then quickly hone in on all support requests from your Enterprise customers first. -[**Set up groups**](/groups/) +[**Set up groups**](/customer-groups/)