diff --git a/_snippets/graphql/reply-to-thread.mdx b/_snippets/graphql/reply-to-thread.mdx
new file mode 100644
index 0000000..5496f20
--- /dev/null
+++ b/_snippets/graphql/reply-to-thread.mdx
@@ -0,0 +1,21 @@
+```graphql Mutation
+mutation replyToThread($input: ReplyToThreadInput!) {
+ replyToThread(input: $input) {
+ error {
+ message
+ type
+ code
+ }
+ }
+}
+```
+
+```json Variables
+{
+ "input": {
+ "threadId": "th_01H8H46YPB2S4MAJM382FG9423",
+ "textContent": "The plain text version of your reply goes here.",
+ "markdownContent": "The markdown **version** of your _reply_ goes here."
+ }
+}
+```
diff --git a/_snippets/typescript-sdk/create-customer-event-response.mdx b/_snippets/typescript-sdk/create-customer-event-response.mdx
index 6328902..684ba93 100644
--- a/_snippets/typescript-sdk/create-customer-event-response.mdx
+++ b/_snippets/typescript-sdk/create-customer-event-response.mdx
@@ -1,27 +1,10 @@
```json
{
"__typename": "CustomerEvent",
- "id": "ce_01HB924RWAW8H3Q8KZDFWYBJHZ",
+ "id": "tev_01HB924RWAW8H3Q8KZDFWYBJHZ",
"externalId": null,
- "customer": {
- "id": "c_01H14DFQ4PDYBH398J1E99TWSS"
- },
+ "customerId": "c_01H14DFQ4PDYBH398J1E99TWSS",
"title": "API key generated",
- "components": [
- {
- "__typename": "ComponentText",
- "text": "New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles."
- }
- {
- "__typename": "ComponentSpacer",
- "spacerSize": "M"
- }
- {
- "__typename": "ComponentLinkButton",
- "linkButtonLabel": "View in admin",
- "linkButtonUrl": "https://admin.your-app.com"
- }
- ],
"createdAt": {
"__typename": "DateTime",
"iso8601": "2023-09-26T15:36:23.690Z",
diff --git a/_snippets/typescript-sdk/create-customer-event.mdx b/_snippets/typescript-sdk/create-customer-event.mdx
index da5c4cb..aa5d20d 100644
--- a/_snippets/typescript-sdk/create-customer-event.mdx
+++ b/_snippets/typescript-sdk/create-customer-event.mdx
@@ -17,7 +17,7 @@ const res = await client.createCustomerEvent({
// externalId: 'YOUR_ID',
// ...or you can use the customer's id in Plain:
- // customerId: 'c_123'
+ // customerId: 'c_01H14DFQ4PDYBH398J1E99TWSS'
},
components: [
@@ -38,10 +38,6 @@ const res = await client.createCustomerEvent({
// as an idempotency key while also letting you correlate an event to
// something your systems.
externalId: 'XXX',
-
- // Optional - if provided then the event will only be shown
- // in a single thread vs all threads from a customer
- threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ',
});
if (res.error) {
diff --git a/_snippets/typescript-sdk/create-thread-event-response.mdx b/_snippets/typescript-sdk/create-thread-event-response.mdx
new file mode 100644
index 0000000..4538dcc
--- /dev/null
+++ b/_snippets/typescript-sdk/create-thread-event-response.mdx
@@ -0,0 +1,27 @@
+```json
+{
+ "__typename": "ThreadEvent",
+ "id": "tev_01HB924RWAW8H3Q8KZDFWYBJHZ",
+ "externalId": "ex-id-1",
+ "customerId": "c_01H14DFQ4PDYBH398J1E99TWSS",
+ "title": "API key generated",
+ "createdAt": {
+ "__typename": "DateTime",
+ "iso8601": "2023-09-26T15:36:23.690Z",
+ "unixTimestamp": "1695742583690"
+ },
+ "createdBy": {
+ "__typename": "MachineUserActor",
+ "machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY"
+ },
+ "updatedAt": {
+ "__typename": "DateTime",
+ "iso8601": "2023-10-05T10:10:04.785Z",
+ "unixTimestamp": "1696500604785"
+ },
+ "updatedBy": {
+ "__typename": "MachineUserActor",
+ "machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY"
+ }
+}
+```
diff --git a/_snippets/typescript-sdk/create-thread-event.mdx b/_snippets/typescript-sdk/create-thread-event.mdx
new file mode 100644
index 0000000..a9cf2cb
--- /dev/null
+++ b/_snippets/typescript-sdk/create-thread-event.mdx
@@ -0,0 +1,39 @@
+```tsx
+import { PlainClient, uiComponent } from '@team-plain/typescript-sdk';
+
+const client = new PlainClient({
+ apiKey: 'XXX',
+ debug: true,
+});
+
+const res = await client.createThreadEvent({
+ title: 'API key generated',
+
+ threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ',
+
+ components: [
+ uiComponent.text({
+ text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.',
+ }),
+ uiComponent.spacer({
+ size: 'M',
+ }),
+ uiComponent.linkButton({
+ label: 'View in admin',
+ url: 'https://admin.your-app.com',
+ }),
+ ],
+
+ // Optional - if provided, this will ensure that this event can only
+ // be created once and fail on the second time. This external id acts
+ // as an idempotency key while also letting you correlate an event to
+ // something your systems.
+ externalId: 'ex-id-1',
+});
+
+if (res.error) {
+ console.error(res.error);
+} else {
+ console.log(res.data);
+}
+```
diff --git a/_snippets/typescript-sdk/reply-email.mdx b/_snippets/typescript-sdk/reply-email.mdx
index 855f905..ac92d8b 100644
--- a/_snippets/typescript-sdk/reply-email.mdx
+++ b/_snippets/typescript-sdk/reply-email.mdx
@@ -3,7 +3,7 @@ import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
-client.replyToEmail({
+const res = await client.replyToEmail({
customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95',
inReplyToEmailId: 'em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA',
textContent: 'The plain text version of your reply goes here.',
diff --git a/_snippets/typescript-sdk/reply-to-response.mdx b/_snippets/typescript-sdk/reply-to-response.mdx
new file mode 100644
index 0000000..89f6e32
--- /dev/null
+++ b/_snippets/typescript-sdk/reply-to-response.mdx
@@ -0,0 +1,17 @@
+```tsx
+import { PlainClient } from '@team-plain/typescript-sdk';
+
+const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
+
+const res = await client.replyToThread({
+ threadId: 'th_01HD44FHMCDSSWE38N14FSYV6K',
+ textContent: 'The plain text version of your reply goes here.',
+ markdownContent: 'The markdown **version** of your reply goes here.',
+});
+
+if (res.error) {
+ console.error(res.error);
+} else {
+ console.log(res.data);
+}
+```
diff --git a/_snippets/typescript-sdk/reply-to-thread-response.mdx b/_snippets/typescript-sdk/reply-to-thread-response.mdx
new file mode 100644
index 0000000..b86a8a7
--- /dev/null
+++ b/_snippets/typescript-sdk/reply-to-thread-response.mdx
@@ -0,0 +1,3 @@
+```json
+{}
+```
diff --git a/_snippets/typescript-sdk/send-email.mdx b/_snippets/typescript-sdk/send-email.mdx
index 84ee825..9ba3b0d 100644
--- a/_snippets/typescript-sdk/send-email.mdx
+++ b/_snippets/typescript-sdk/send-email.mdx
@@ -3,7 +3,7 @@ import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
-client.sendNewEmail({
+const res = await client.sendNewEmail({
customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95',
threadId: 'th_01HD44FHMCDSSWE38N14FSYV6K',
subject: 'Your account has a problem',
diff --git a/_snippets/webhooks/customer-created.mdx b/_snippets/webhooks/customer-created.mdx
index 10209c9..4841550 100644
--- a/_snippets/webhooks/customer-created.mdx
+++ b/_snippets/webhooks/customer-created.mdx
@@ -14,10 +14,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-04T14:17:41.991Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/customer-deleted.mdx b/_snippets/webhooks/customer-deleted.mdx
index 38d5374..c002505 100644
--- a/_snippets/webhooks/customer-deleted.mdx
+++ b/_snippets/webhooks/customer-deleted.mdx
@@ -14,10 +14,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-04T14:17:41.991Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/customer-group-changed.mdx b/_snippets/webhooks/customer-group-changed.mdx
index a454b1e..373e66d 100644
--- a/_snippets/webhooks/customer-group-changed.mdx
+++ b/_snippets/webhooks/customer-group-changed.mdx
@@ -15,10 +15,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "ACTIVE",
- "statusChangedAt": "2023-10-19T14:12:25.267Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [
@@ -76,10 +72,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "ACTIVE",
- "statusChangedAt": "2023-10-19T14:12:25.267Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/customer-updated.mdx b/_snippets/webhooks/customer-updated.mdx
index f0524ee..76fd7ef 100644
--- a/_snippets/webhooks/customer-updated.mdx
+++ b/_snippets/webhooks/customer-updated.mdx
@@ -14,10 +14,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "ACTIVE",
- "statusChangedAt": "2023-10-19T14:12:25.267Z",
"markedAsSpamAt": "2023-10-19T14:21:43.616Z",
"markedAsSpamBy": {
"actorType": "user",
@@ -45,10 +41,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-04T14:17:41.991Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/thread-chat-sent.mdx b/_snippets/webhooks/thread-chat-sent.mdx
new file mode 100644
index 0000000..4940856
--- /dev/null
+++ b/_snippets/webhooks/thread-chat-sent.mdx
@@ -0,0 +1,102 @@
+```json
+{
+ "timestamp": "2023-11-02T15:32:28.831Z",
+ "workspaceId": "w_01GST0W989ZNAW53X6XYHAY87P",
+ "payload": {
+ "eventType": "thread.chat_sent",
+ "chat": {
+ "timelineEntryId": "t_01HE8AM6GZG6C3CM344HFDM3J3",
+ "id": "ch_01HE8AM6GZPZ3Q3RBEVE5TZ80X",
+ "customerReadAt": null,
+ "attachments": [],
+ "text": "You are welcome!",
+ "createdAt": "2023-11-02T15:32:28.831Z",
+ "createdBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ },
+ "updatedAt": "2023-11-02T15:32:28.831Z",
+ "updatedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ }
+ },
+ "thread": {
+ "id": "th_01HDRC3CRY6ESPZJ7FZCTRQWYH",
+ "customer": {
+ "id": "c_01HDRC3CJHBWBAAF4K63Z11XZ5",
+ "email": {
+ "email": "peter@example.com",
+ "isVerified": false,
+ "verifiedAt": null
+ },
+ "externalId": null,
+ "fullName": "Peter Santos",
+ "shortName": "Peter",
+ "markedAsSpamAt": null,
+ "markedAsSpamBy": null,
+ "customerGroupMemberships": [],
+ "createdAt": "2023-10-27T10:50:24.209Z",
+ "createdBy": {
+ "actorType": "system",
+ "system": "email_inbound_handler"
+ },
+ "updatedAt": "2023-11-02T08:57:32.944Z",
+ "updatedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ }
+ },
+ "title": "Unable to tail logs",
+ "previewText": "Hey, I am currently unable to tail the logs of the service svc-8af1e3",
+ "priority": 2,
+ "externalId": null,
+ "status": "TODO",
+ "statusChangedAt": "2023-11-02T08:57:32.943Z",
+ "statusChangedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ },
+ "statusDetail": null,
+ "assignee": null,
+ "assignedAt": null,
+ "labels": [],
+ "firstInboundMessageInfo": {
+ "timestamp": "2023-10-27T10:50:24.323Z",
+ "messageSource": "EMAIL"
+ },
+ "firstOutboundMessageInfo": {
+ "timestamp": "2023-10-27T10:50:52.944Z",
+ "messageSource": "EMAIL"
+ },
+ "lastInboundMessageInfo": {
+ "timestamp": "2023-10-27T15:05:30.223Z",
+ "messageSource": "EMAIL"
+ },
+ "lastOutboundMessageInfo": {
+ "timestamp": "2023-10-27T15:04:49.521Z",
+ "messageSource": "EMAIL"
+ },
+ "supportEmailAddresses": ["help@example.com"],
+ "createdAt": "2023-10-27T10:50:24.323Z",
+ "createdBy": {
+ "actorType": "system",
+ "system": "email_inbound_handler"
+ },
+ "updatedAt": "2023-11-02T08:57:32.943Z",
+ "updatedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ }
+ }
+ },
+ "id": "pEv_01HE8AM6GZVS1S3609PFGR30FE",
+ "webhookMetadata": {
+ "webhookTargetId": "whTarget_01HD4400VTDJQ646V6RY37SR7K",
+ "webhookDeliveryAttemptId": "whAttempt_01HE8ANGEGVQVTCY3DD30CZ8G4",
+ "webhookDeliveryAttemptNumber": 1,
+ "webhookDeliveryAttemptTimestamp": "2023-11-02T15:33:11.760Z"
+ },
+ "type": "thread.chat_sent"
+}
+```
diff --git a/_snippets/webhooks/thread-created.mdx b/_snippets/webhooks/thread-created.mdx
index 7107e40..3fee101 100644
--- a/_snippets/webhooks/thread-created.mdx
+++ b/_snippets/webhooks/thread-created.mdx
@@ -16,10 +16,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-04T14:17:41.991Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
@@ -55,7 +51,7 @@
"firstOutboundMessageInfo": null,
"lastInboundMessageInfo": null,
"lastOutboundMessageInfo": null,
- "supportEmailAddresses": [],
+ "supportEmailAddresses": ["help@example.com"],
"createdAt": "2023-10-19T14:12:25.266Z",
"createdBy": {
"actorType": "system",
diff --git a/_snippets/webhooks/email-received.mdx b/_snippets/webhooks/thread-email-received.mdx
similarity index 96%
rename from _snippets/webhooks/email-received.mdx
rename to _snippets/webhooks/thread-email-received.mdx
index cfb90fc..c7ab76a 100644
--- a/_snippets/webhooks/email-received.mdx
+++ b/_snippets/webhooks/thread-email-received.mdx
@@ -16,10 +16,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-19T14:12:25.142Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/email-sent.mdx b/_snippets/webhooks/thread-email-sent.mdx
similarity index 96%
rename from _snippets/webhooks/email-sent.mdx
rename to _snippets/webhooks/thread-email-sent.mdx
index bbf178d..7e7dba4 100644
--- a/_snippets/webhooks/email-sent.mdx
+++ b/_snippets/webhooks/thread-email-sent.mdx
@@ -16,10 +16,6 @@
"externalId": null,
"fullName": "Peter Santos",
"shortName": "Peter",
- "assignedAt": null,
- "assignedToUser": null,
- "status": "IDLE",
- "statusChangedAt": "2023-10-19T21:24:36.109Z",
"markedAsSpamAt": null,
"markedAsSpamBy": null,
"customerGroupMemberships": [],
diff --git a/_snippets/webhooks/thread-note-created.mdx b/_snippets/webhooks/thread-note-created.mdx
new file mode 100644
index 0000000..9ef8bcd
--- /dev/null
+++ b/_snippets/webhooks/thread-note-created.mdx
@@ -0,0 +1,103 @@
+```json
+{
+ "timestamp": "2023-11-02T14:25:42.570Z",
+ "workspaceId": "w_01GST0W989ZNAW53X6XYHAY87P",
+ "payload": {
+ "eventType": "thread.note_created",
+ "thread": {
+ "id": "th_01HD44FHMCDSSWE38N14FSYV6K",
+ "customer": {
+ "id": "c_01HD44FHDPG82VQ4QNHDR4N2T0",
+ "email": {
+ "email": "peter@example.com",
+ "isVerified": false,
+ "verifiedAt": null
+ },
+ "externalId": null,
+ "fullName": "Peter Santos",
+ "shortName": "Peter",
+ "markedAsSpamAt": null,
+ "markedAsSpamBy": null,
+ "customerGroupMemberships": [],
+ "createdAt": "2023-10-04T14:17:41.991Z",
+ "createdBy": {
+ "actorType": "system",
+ "system": "email_inbound_handler"
+ },
+ "updatedAt": "2023-10-04T14:17:41.991Z",
+ "updatedBy": {
+ "actorType": "system",
+ "system": "email_inbound_handler"
+ }
+ },
+ "title": "Unable to tail logs",
+ "previewText": "Hey, I am currently unable to tail the logs of the service svc-8af1e3",
+ "priority": 2,
+ "externalId": null,
+ "status": "TODO",
+ "statusChangedAt": "2023-11-02T08:57:32.943Z",
+ "statusChangedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ },
+ "statusDetail": null,
+ "assignee": null,
+ "assignedAt": null,
+ "labels": [],
+ "firstInboundMessageInfo": {
+ "timestamp": "2023-10-27T10:50:24.323Z",
+ "messageSource": "EMAIL"
+ },
+ "firstOutboundMessageInfo": {
+ "timestamp": "2023-10-27T10:50:52.944Z",
+ "messageSource": "EMAIL"
+ },
+ "lastInboundMessageInfo": {
+ "timestamp": "2023-10-27T15:05:30.223Z",
+ "messageSource": "EMAIL"
+ },
+ "lastOutboundMessageInfo": {
+ "timestamp": "2023-10-27T15:04:49.521Z",
+ "messageSource": "EMAIL"
+ },
+ "supportEmailAddresses": ["help@example.com"],
+ "createdAt": "2023-10-27T10:50:24.323Z",
+ "createdBy": {
+ "actorType": "system",
+ "system": "email_inbound_handler"
+ },
+ "updatedAt": "2023-11-02T08:57:32.943Z",
+ "updatedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ }
+ },
+ "note": {
+ "timelineEntryId": "t_01HE86SXY5FCRG2M1X9ZVRX09Q",
+ "id": "n_01HE86SXY54QYS46T9HZF218DQ",
+ "text": "VIP customer",
+ "markdown": "**VIP** customer",
+ "createdAt": "2023-11-02T14:25:42.341Z",
+ "createdBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ },
+ "updatedAt": "2023-11-02T14:25:42.341Z",
+ "updatedBy": {
+ "actorType": "user",
+ "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
+ },
+ "deletedAt": null,
+ "deletedBy": null
+ }
+ },
+ "id": "pEv_01HE86SY5A9KKTACZW3FGQJ0CS",
+ "webhookMetadata": {
+ "webhookTargetId": "whTarget_01HD4400VTDJQ646V6RY37SR7K",
+ "webhookDeliveryAttemptId": "whAttempt_01HE86V6GP2JZCQ3D6AXK81TWD",
+ "webhookDeliveryAttemptNumber": 3,
+ "webhookDeliveryAttemptTimestamp": "2023-11-02T14:26:23.894Z"
+ },
+ "type": "thread.note_created"
+}
+```
diff --git a/custom.css b/custom.css
index cf0b759..c451587 100644
--- a/custom.css
+++ b/custom.css
@@ -12,12 +12,27 @@ img[src^='/public/logo'] {
font-weight: 500;
}
-/* By default titles have tight leading, this removes this. */
+/* By default h2s are very bold, this reduces the font-weight */
+.prose :where(h2):not(:where([class~='not-prose'] *)) {
+ font-weight: 600;
+}
+
+/* Within plain we never want a tighter leading than the default so override this globally. */
.tracking-tight {
letter-spacing: 0;
}
+/* Remove tight leading on titles within the content */
+.prose :where(h1, h2, h3):not(:where([class~='not-prose'] *)) {
+ letter-spacing: auto;
+}
+
/* Links that are in the content of the page */
.prose :where(a):not(:where([class~='not-prose'] *)) {
font-weight: 500;
}
+
+/* Prevent layout shift from scrollbar appearing */
+html {
+ overflow-y: scroll;
+}
diff --git a/docs/api-reference/customer-cards/introduction.mdx b/docs/api-reference/customer-cards.mdx
similarity index 100%
rename from docs/api-reference/customer-cards/introduction.mdx
rename to docs/api-reference/customer-cards.mdx
diff --git a/docs/api-reference/graphql/authentication.mdx b/docs/api-reference/graphql/authentication.mdx
index d391396..807b98d 100644
--- a/docs/api-reference/graphql/authentication.mdx
+++ b/docs/api-reference/graphql/authentication.mdx
@@ -1,6 +1,5 @@
---
title: 'Authentication'
-description: "To make API calls you need an API key. To create an API key you'll first need to create a Machine User."
---
Machine Users can have multiple API Keys to make it easy to rotate keys. Every API key also has fine grained permissions.
diff --git a/docs/api-reference/graphql/customers.mdx b/docs/api-reference/graphql/customers.mdx
index 075c110..765d147 100644
--- a/docs/api-reference/graphql/customers.mdx
+++ b/docs/api-reference/graphql/customers.mdx
@@ -1,9 +1,10 @@
---
title: 'Customers'
sidebarTitle: 'Overview'
-description: 'Customers that reach out to you will automatically be created in Plain without requiring any API integration.'
---
+Customers that reach out to you will automatically be created in Plain without requiring any API integration.
+
However, using our API to manage customers proactively can be helpful when you are optimizing your support workflow.
For example:
diff --git a/docs/api-reference/graphql/customers/delete.mdx b/docs/api-reference/graphql/customers/delete.mdx
index c2aa1e4..18437bc 100644
--- a/docs/api-reference/graphql/customers/delete.mdx
+++ b/docs/api-reference/graphql/customers/delete.mdx
@@ -2,8 +2,6 @@ import DeleteCustomerTypescriptSDK from '../../../snippets/typescript-sdk/delete
import DeleteCustomerGraphQL from '../../../snippets/graphql/delete-customer.mdx';
import { Tab, Tabs } from 'nextra-theme-docs';
-# 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).
@@ -15,12 +13,11 @@ This operation requires the following permissions:
- `customer:delete`
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/docs/api-reference/graphql/customers/get.mdx b/docs/api-reference/graphql/customers/get.mdx
index 1e776a8..b667f1c 100644
--- a/docs/api-reference/graphql/customers/get.mdx
+++ b/docs/api-reference/graphql/customers/get.mdx
@@ -4,13 +4,15 @@ title: 'Fetch customers'
We provide a number of methods for fetching customers:
-1. [Get customers](#get-customers)
+1. [Get customers](#get-customers) (To fetch more than one customer at a time)
1. [Get customer by ID](#get-customer-by-id)
1. [Get customer by email](#get-customer-by-email)
All of these endpoints require the following permissions:
- `customer:read`
+- `customerGroup:read` (Typescript SDK only)
+- `customerGroupMembership:read` (Typescript SDK only)
## Get customers
@@ -19,14 +21,13 @@ Our API allows you to fetch customers as a collection using `getCustomers` in ou
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/).
-
-
-
-
-
-
-
+
+
+
+
+
+
## Get customer by ID
@@ -34,14 +35,13 @@ This is a very flexible endpoint which supports a variety of options for filteri
If you already have the ID of a customer from within Plain or one of our other endpoints you can fetch more details about them using `getCustomerById` in our SDKs or the `customer` query in GraphQL.
-
-
-
-
-
-
-
+
+
+
+
+
+
## Get customer by email
@@ -49,12 +49,11 @@ If you already have the ID of a customer from within Plain or one of our other e
To fetch a customer by email you can use `getCustomerByEmail` in our SDKs or the `customerByEmail` query in GraphQL.
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/docs/api-reference/graphql/customers/upsert.mdx b/docs/api-reference/graphql/customers/upsert.mdx
index 75b80a4..a1ad3cd 100644
--- a/docs/api-reference/graphql/customers/upsert.mdx
+++ b/docs/api-reference/graphql/customers/upsert.mdx
@@ -1,8 +1,10 @@
---
title: 'Upserting customers'
-description: 'Creating and updating customers is handled via a single API called `upsertCustomer`. You will find this name in both our API and our SDKs.'
+description: 'Learn how to create and update customers programatically.'
---
+Creating and updating customers is handled via a single API called `upsertCustomer`. You will find this name in both our API and our SDKs.
+
When you upsert a customer, you define:
1. The identifier: This is the field you'd like to use to select the customer and is one of
@@ -20,6 +22,8 @@ This operation requires the following permissions:
- `customer:create`
- `customer:edit`
+- `customerGroup:read` (Typescript SDK only)
+- `customerGroupMembership:read` (Typescript SDK only)
This will:
diff --git a/docs/api-reference/graphql/events.mdx b/docs/api-reference/graphql/events.mdx
index 33e12e4..c2b0646 100644
--- a/docs/api-reference/graphql/events.mdx
+++ b/docs/api-reference/graphql/events.mdx
@@ -1,24 +1,24 @@
---
title: 'Events'
sidebarTitle: 'Overview'
-description: 'When helping a customer it can be useful to have context about their recent activity in your product. For example, if someone is getting in touch about a 401 error, it could be important to know that they recently deleted an API key in their settings.'
+description: 'Log important events to have the full picture of what happened in Plain.'
---
+When helping a customer it can be useful to have context about their recent activity in your product. For example, if someone is getting in touch about a 401 error, it could be important to know that they recently deleted an API key in their settings.
+
Events are created via the Plain API and you have full control of what they look like using Plain's UI components.
-When you create an event for a customer it will show in all of their threads past and present. If you are building a more advanced API integration you can also create an event specific to a thread by providing a thread id when creating it.
+There are two types of events
-Events are stored permanently in Plain.
+- **[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.
## 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.
-## Playground
-
-
- **Coming soon!**
+### Playground
- We're still working on a nice interactive playground but in the meantime you may want to use the [Customer Cards Playground](https://app.plain.com/developer/customer-cards-playground/) as they both use the same [UI components](/ui-components/) so you can get a good visual sense of what your event will look like.
+The UI Components Playground lets you build and preview the component JSON used to create an event. Use this to prototype an event before starting to build your integration.
-
+[**UI Components Playground →**](https://app.plain.com/developer/ui-components-playground/)
diff --git a/docs/api-reference/graphql/events/create-customer-event.mdx b/docs/api-reference/graphql/events/create-customer-event.mdx
index 65474ba..3b9015c 100644
--- a/docs/api-reference/graphql/events/create-customer-event.mdx
+++ b/docs/api-reference/graphql/events/create-customer-event.mdx
@@ -2,14 +2,15 @@
title: 'Create a customer event'
---
-
- This API is being actively developed and is not yet ready for production usage. If you are
- interested in using events please get in touch with us at [help@plain.com](mailto:help@plain.com)
-
+
+ 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).
+
To create an event you need a customer ID.
-You can get this by [upserting a customer](/pages/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](/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:
@@ -22,111 +23,20 @@ In this example we'll be creating the following event:
- `customerEvent:read`
- `customer:read`
- ```tsx
- import { PlainClient, uiComponent } from '@team-plain/typescript-sdk';
+
- const client = new PlainClient({
- apiKey: 'XXX',
- debug: true,
- });
+ Which would console.log:
- const res = await client.createCustomerEvent({
- title: 'API key generated',
-
- customerIdentifier: {
- // You can use the email:
- email: 'jane@acme.com',
-
- // ...or if you set external id on customers:
- // externalId: 'YOUR_ID',
-
- // ...or you can use the customer's id in Plain:
- // customerId: 'c_123'
- },
-
- components: [
- uiComponent.text({
- text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.',
- }),
- uiComponent.spacer({
- size: 'M',
- }),
- uiComponent.linkButton({
- label: 'View in admin',
- url: 'https://admin.your-app.com',
- }),
- ],
-
- // Optional - if provided, this will ensure that this event can only
- // be created once and fail on the second time. This external id acts
- // as an idempotency key while also letting you correlate an event to
- // something your systems.
- externalId: 'XXX',
-
- // Optional - if provided then the event will only be shown
- // in a single thread vs all threads from a customer
- threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ',
- });
-
- if (res.error) {
- console.error(res.error);
- } else {
- console.log(res.data);
- }
- ```
- Which would console.log:
- ```json
- {
- "__typename": "CustomerEvent",
- "id": "ce_01HB924RWAW8H3Q8KZDFWYBJHZ",
- "externalId": null,
- "customer": {
- "id": "c_01H14DFQ4PDYBH398J1E99TWSS"
- },
- "title": "API key generated",
- "components": [
- {
- "__typename": "ComponentText",
- "text": "New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles."
- }
- {
- "__typename": "ComponentSpacer",
- "spacerSize": "M"
- }
- {
- "__typename": "ComponentLinkButton",
- "linkButtonLabel": "View in admin",
- "linkButtonUrl": "https://admin.your-app.com"
- }
- ],
- "createdAt": {
- "__typename": "DateTime",
- "iso8601": "2023-09-26T15:36:23.690Z",
- "unixTimestamp": "1695742583690"
- },
- "createdBy": {
- "__typename": "MachineUserActor",
- "machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY"
- },
- "updatedAt": {
- "__typename": "DateTime",
- "iso8601": "2023-10-05T10:10:04.785Z",
- "unixTimestamp": "1696500604785"
- },
- "updatedBy": {
- "__typename": "MachineUserActor",
- "machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY"
- }
- }
- ```
+
+
For this you'll need an API key with the following permissions:
- `customerEvent:create`
- `customerEvent:read`
-
+
diff --git a/docs/api-reference/graphql/events/create-thread-event.mdx b/docs/api-reference/graphql/events/create-thread-event.mdx
new file mode 100644
index 0000000..c528381
--- /dev/null
+++ b/docs/api-reference/graphql/events/create-thread-event.mdx
@@ -0,0 +1,39 @@
+---
+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).
+
+
+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.
+
+In this example we'll be creating the following event:
+
+![Example event](/public/images/events/events-example.png)
+
+
+
+ For this you'll need an API key with the following permissions:
+ - `threadEvent:create`
+ - `threadEvent:read`
+ - `thread:read`
+ - `customer:read`
+
+
+ Which would console.log:
+
+
+
+
+ For this you'll need an API key with the following permissions:
+ - `threadEvent:create`
+ - `threadEvent:read`
+
+
+
+
+
diff --git a/docs/api-reference/graphql/introduction.mdx b/docs/api-reference/graphql/introduction.mdx
index 06797ed..2b7a42e 100644
--- a/docs/api-reference/graphql/introduction.mdx
+++ b/docs/api-reference/graphql/introduction.mdx
@@ -1,15 +1,12 @@
---
-title: 'GraphQL API'
-sidebarTitle: 'Overview'
-description: "Plain's GraphQL API can be used to manage any aspect of Plain. It's the API we use to build the Plain app which means there are no restrictions on what you can do via the API vs the Plain app."
+title: 'Introduction'
+sidebarTitle: 'Introduction'
+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 [talk to us](mailto:help@plain.com) or explore our schema.
-
-
+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!
## Key details
diff --git a/docs/api-reference/graphql/messaging.mdx b/docs/api-reference/graphql/messaging.mdx
index fd688b5..2c5e52d 100644
--- a/docs/api-reference/graphql/messaging.mdx
+++ b/docs/api-reference/graphql/messaging.mdx
@@ -8,13 +8,12 @@ description: 'We provide various methods to message your customers with the Plai
+
diff --git a/docs/api-reference/graphql/messaging/reply-to-thread.mdx b/docs/api-reference/graphql/messaging/reply-to-thread.mdx
new file mode 100644
index 0000000..94c39c5
--- /dev/null
+++ b/docs/api-reference/graphql/messaging/reply-to-thread.mdx
@@ -0,0 +1,42 @@
+---
+title: 'Reply to thread'
+---
+
+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)
+
+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.
+
+
+ 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.
+
+
+
+
+ Only one permission is needed:
+
+ - `thread:reply`
+
+
+
+ Where `result.data` is:
+
+
+
+
+
+
+ Only one permission is needed:
+
+ - `thread:reply`
+
+
+
+
+
+
diff --git a/docs/api-reference/graphql/schema.mdx b/docs/api-reference/graphql/schema.mdx
index 9c80ec0..9faedd2 100644
--- a/docs/api-reference/graphql/schema.mdx
+++ b/docs/api-reference/graphql/schema.mdx
@@ -1,6 +1,5 @@
---
title: 'Schema'
-description: We build the Plain app using this API so there are no limits in terms of what you can do programmatically vs. using the Plain app."
---
If you need the schema programmatically for code generation or if you just want to read the schema you can view the [raw GraphQL schema](https://core-api.uk.plain.com/graphql/v1/schema.graphql).
diff --git a/docs/api-reference/ui-components/introduction.mdx b/docs/api-reference/ui-components.mdx
similarity index 80%
rename from docs/api-reference/ui-components/introduction.mdx
rename to docs/api-reference/ui-components.mdx
index 845c2d5..ae996ca 100644
--- a/docs/api-reference/ui-components/introduction.mdx
+++ b/docs/api-reference/ui-components.mdx
@@ -1,9 +1,10 @@
---
-title: 'UI Component'
+title: 'UI Components'
sidebarTitle: 'Overview'
-description: "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 using Plain's [Customer Timeline Entries](/pages/custom-timeline-entries)and [Customer Cards](/pages/customer-cards).
+
For example - this is a button that links to Stripe.
```json
diff --git a/docs/api-reference/webhooks/introduction.mdx b/docs/api-reference/webhooks.mdx
similarity index 99%
rename from docs/api-reference/webhooks/introduction.mdx
rename to docs/api-reference/webhooks.mdx
index 9740cda..917d1a4 100644
--- a/docs/api-reference/webhooks/introduction.mdx
+++ b/docs/api-reference/webhooks.mdx
@@ -1,5 +1,6 @@
---
title: 'Webhooks'
+sidebarTitle: 'Overview'
---
Webhooks allow you to get notified about events happening in your Plain workspace. You can react to these events in many ways, such as:
diff --git a/docs/api-reference/webhooks/customer-created.mdx b/docs/api-reference/webhooks/customer-created.mdx
index 6f1a998..e5f7017 100644
--- a/docs/api-reference/webhooks/customer-created.mdx
+++ b/docs/api-reference/webhooks/customer-created.mdx
@@ -1,8 +1,9 @@
---
title: 'Customer created'
-description: 'This event is fired when a new customer is created in your workspace.'
---
+This event is fired when a new customer is created in your workspace.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FcustomerCreatedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/docs/api-reference/webhooks/customer-deleted.mdx b/docs/api-reference/webhooks/customer-deleted.mdx
index 1713653..bf0e3e1 100644
--- a/docs/api-reference/webhooks/customer-deleted.mdx
+++ b/docs/api-reference/webhooks/customer-deleted.mdx
@@ -1,8 +1,9 @@
---
title: 'Customer deleted'
-description: 'This event is fired when a customer is deleted from your workspace.'
---
+This event is fired when a customer is deleted from your workspace.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FcustomerDeletedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/docs/api-reference/webhooks/customer-group-membership-changed.mdx b/docs/api-reference/webhooks/customer-group-membership-changed.mdx
index 660aceb..eec2cc1 100644
--- a/docs/api-reference/webhooks/customer-group-membership-changed.mdx
+++ b/docs/api-reference/webhooks/customer-group-membership-changed.mdx
@@ -1,8 +1,9 @@
---
title: 'Customer Group Membership Changed Event'
-description: 'This event is fired whenever a customer is added or removed from a customer group.'
---
+This event is fired whenever a customer is added or removed from a customer group.
+
The [`changeType`](https://json-schema.app/view/%23%2Fdefinitions%2FcustomerGroupMembershipsChangedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json) field allows you to know what kind of change has occurred. It can be one of the following:
- `ADDED`: a customer group membership was added
diff --git a/docs/api-reference/webhooks/customer-updated.mdx b/docs/api-reference/webhooks/customer-updated.mdx
index e5196a3..a6f323d 100644
--- a/docs/api-reference/webhooks/customer-updated.mdx
+++ b/docs/api-reference/webhooks/customer-updated.mdx
@@ -1,8 +1,9 @@
---
title: 'Customer updated'
-description: 'This event is fired when a customer is updated in your workspace. You can expect this event:'
---
+This event is fired when a customer is updated in your workspace. You can expect this event:
+
- when a customer is marked as spam
- when a customer is un-marked as spam
- when the details of a customer are updated
diff --git a/docs/api-reference/webhooks/thread-assignment-transitioned.mdx b/docs/api-reference/webhooks/thread-assignment-transitioned.mdx
index 7ec4035..28e6d87 100644
--- a/docs/api-reference/webhooks/thread-assignment-transitioned.mdx
+++ b/docs/api-reference/webhooks/thread-assignment-transitioned.mdx
@@ -1,8 +1,9 @@
---
title: 'Thread assignment transitioned'
-description: 'This event is fired when the assignee of a thread changes or a thread is unassigned.'
---
+This event is fired when the assignee of a thread changes or a thread is unassigned.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadPriorityChangedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/docs/api-reference/webhooks/thread-chat-sent.mdx b/docs/api-reference/webhooks/thread-chat-sent.mdx
new file mode 100644
index 0000000..0d16960
--- /dev/null
+++ b/docs/api-reference/webhooks/thread-chat-sent.mdx
@@ -0,0 +1,13 @@
+---
+title: 'Chat sent'
+---
+
+This event is fired when a chat message is sent to a customer in a thread.
+
+## Schema
+
+[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadChatSentPublicEventPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
+
+Example:
+
+
diff --git a/docs/api-reference/webhooks/thread-created.mdx b/docs/api-reference/webhooks/thread-created.mdx
index 6018e4c..6886e54 100644
--- a/docs/api-reference/webhooks/thread-created.mdx
+++ b/docs/api-reference/webhooks/thread-created.mdx
@@ -1,8 +1,9 @@
---
title: 'Thread created'
-description: 'This event is fired when a new thread is created in your workspace.'
---
+This event is fired when a new thread is created in your workspace.
+
You can subscribe to this event **if you want to build an auto-responder**. To do so, when you receive this event, use the `replyToThread` mutation to send a reply back to the customer.
diff --git a/docs/api-reference/webhooks/email-received.mdx b/docs/api-reference/webhooks/thread-email-received.mdx
similarity index 82%
rename from docs/api-reference/webhooks/email-received.mdx
rename to docs/api-reference/webhooks/thread-email-received.mdx
index d722a42..640e905 100644
--- a/docs/api-reference/webhooks/email-received.mdx
+++ b/docs/api-reference/webhooks/thread-email-received.mdx
@@ -1,8 +1,9 @@
---
title: 'Email received'
-description: 'This event is fired when an email is received in your workspace.'
---
+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
@@ -16,4 +17,4 @@ description: 'This event is fired when an email is received in your workspace.'
Example:
-
+
diff --git a/docs/api-reference/webhooks/email-sent.mdx b/docs/api-reference/webhooks/thread-email-sent.mdx
similarity index 83%
rename from docs/api-reference/webhooks/email-sent.mdx
rename to docs/api-reference/webhooks/thread-email-sent.mdx
index 55a905e..0c00bde 100644
--- a/docs/api-reference/webhooks/email-sent.mdx
+++ b/docs/api-reference/webhooks/thread-email-sent.mdx
@@ -1,8 +1,9 @@
---
title: 'Email sent'
-description: 'This event is fired when an email is sent in your workspace.'
---
+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
@@ -16,4 +17,4 @@ description: 'This event is fired when an email is sent in your workspace.'
Example:
-
+
diff --git a/docs/api-reference/webhooks/thread-labels-changed.mdx b/docs/api-reference/webhooks/thread-labels-changed.mdx
index 7f20448..5158496 100644
--- a/docs/api-reference/webhooks/thread-labels-changed.mdx
+++ b/docs/api-reference/webhooks/thread-labels-changed.mdx
@@ -1,8 +1,9 @@
---
title: 'Thread labels changed'
-description: 'This event is fired when labels are added to or removed from a thread.'
---
+This event is fired when labels are added to or removed from a thread.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadLabelsChangedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/docs/api-reference/webhooks/thread-note-created.mdx b/docs/api-reference/webhooks/thread-note-created.mdx
new file mode 100644
index 0000000..15b55ce
--- /dev/null
+++ b/docs/api-reference/webhooks/thread-note-created.mdx
@@ -0,0 +1,13 @@
+---
+title: 'Note created'
+---
+
+This event is fired when a note is created in a thread.
+
+## Schema
+
+[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadNoteCreatedPublicEventPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
+
+Example:
+
+
diff --git a/docs/api-reference/webhooks/thread-priority-changed.mdx b/docs/api-reference/webhooks/thread-priority-changed.mdx
index 59ce4e6..0abc0b9 100644
--- a/docs/api-reference/webhooks/thread-priority-changed.mdx
+++ b/docs/api-reference/webhooks/thread-priority-changed.mdx
@@ -1,8 +1,9 @@
---
title: 'Thread priority changed'
-description: 'This event is fired when the priority of a thread changes.'
---
+This event is fired when the priority of a thread changes.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadPriorityChangedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/docs/api-reference/webhooks/thread-status-transitioned.mdx b/docs/api-reference/webhooks/thread-status-transitioned.mdx
index eb6c64e..d219f34 100644
--- a/docs/api-reference/webhooks/thread-status-transitioned.mdx
+++ b/docs/api-reference/webhooks/thread-status-transitioned.mdx
@@ -1,8 +1,9 @@
---
title: 'Thread status transitioned'
-description: 'This event is fired when the status of a thread changes.'
---
+This event is fired when the status of a thread changes.
+
## Schema
[**View JSON Schema →**](https://json-schema.app/view/%23%2Fdefinitions%2FthreadStatusTransitionedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json)
diff --git a/mint.json b/mint.json
index 190de0b..412dcdf 100644
--- a/mint.json
+++ b/mint.json
@@ -82,7 +82,8 @@
"group": "Events",
"pages": [
"docs/api-reference/graphql/events",
- "docs/api-reference/graphql/events/create-customer-event"
+ "docs/api-reference/graphql/events/create-customer-event",
+ "docs/api-reference/graphql/events/create-thread-event"
]
},
{
@@ -97,6 +98,7 @@
"group": "Messaging",
"pages": [
"docs/api-reference/graphql/messaging",
+ "docs/api-reference/graphql/messaging/reply-to-thread",
"docs/api-reference/graphql/messaging/send-email",
"docs/api-reference/graphql/messaging/reply-email"
]
@@ -120,12 +122,12 @@
]
},
{
- "group": "Other APIs",
+ "group": "Reference",
"pages": [
{
"group": "Customer Cards",
"pages": [
- "docs/api-reference/customer-cards/introduction",
+ "docs/api-reference/customer-cards",
"docs/api-reference/customer-cards/documentation",
"docs/api-reference/customer-cards/playground",
"docs/api-reference/customer-cards/examples"
@@ -134,24 +136,26 @@
{
"group": "Webhooks",
"pages": [
- "docs/api-reference/webhooks/introduction",
+ "docs/api-reference/webhooks",
"docs/api-reference/webhooks/thread-created",
"docs/api-reference/webhooks/thread-status-transitioned",
"docs/api-reference/webhooks/thread-assignment-transitioned",
- "docs/api-reference/webhooks/email-received",
- "docs/api-reference/webhooks/email-sent",
"docs/api-reference/webhooks/thread-labels-changed",
+ "docs/api-reference/webhooks/thread-priority-changed",
+ "docs/api-reference/webhooks/thread-note-created",
+ "docs/api-reference/webhooks/thread-email-received",
+ "docs/api-reference/webhooks/thread-email-sent",
+ "docs/api-reference/webhooks/thread-chat-sent",
"docs/api-reference/webhooks/customer-created",
"docs/api-reference/webhooks/customer-updated",
"docs/api-reference/webhooks/customer-deleted",
- "docs/api-reference/webhooks/customer-group-membership-changed",
- "docs/api-reference/webhooks/thread-priority-changed"
+ "docs/api-reference/webhooks/customer-group-membership-changed"
]
},
{
"group": "UI Components",
"pages": [
- "docs/api-reference/ui-components/introduction",
+ "docs/api-reference/ui-components",
"docs/api-reference/ui-components/badge",
"docs/api-reference/ui-components/container",
"docs/api-reference/ui-components/copy-button",
diff --git a/package.json b/package.json
index 55287cc..f47f3ca 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,9 @@
},
"scripts": {
"dev": "mintlify dev",
- "lint": "prettier --check './**/*.{js,ts,tsx,md,mdx}'"
+ "lint": "pnpm run lint:links && pnpm run lint:prettier",
+ "lint:links": "mintlify broken-links",
+ "lint:prettier": "prettier --check './**/*.{js,ts,tsx,md,mdx}'"
},
"dependencies": {
"mintlify": "^4.0.58",