replyToThread mutation, as long as the thread’s communication channel is either API, CHAT, EMAIL, SLACK or ‘MS_TEAMS’. This information is available in the thread as the channel field.
For TypeScript, the GraphQL SDK gives you a fully typed client for these operations.
cannot_reply_to_thread and a message indicating why.
This operation requires the following permissions:
thread:reply
Mutation
Variables
Impersonation
Impersonation is exclusively available in our
Frontier plan. You can see all available plans in our pricing page.Reply as a customer
This feature allows you to bring native messaging between your customers and Plain, straight into your own product. With impersonation, you can reply to a thread on behalf of one of your customers: impersonated messages will show up as if they were sent by the customers themselves. In order to impersonate a customer, provide theimpersonation parameter in the replyToThread mutation, specifying the identifier of the customer you want to impersonate. You can pick any of the available customer identifiers (emailAddress, customerId or externalId)
Impersonation is only possible for
API, CHAT, EMAIL and SLACK threads (based on the thread’s channel field).SLACK: the message will appear in Slack as a new message from the impersonated customer, including their name and any other customer detailsAPIandEMAIL: the message will be sent as an email with the impersonated customer’s email address as the “From” address, making it appear as if they sent the email directlyCHAT: the message will appear in the thread as coming directly from the impersonated customer, with their name and avatar displayed
EMAIL or API thread, you can optionally add ‘Cc’ and ‘Bcc’ recipients by using the channelSpecificOptions parameter:
thread:replycustomer:impersonate
Mutation
Variables
Reply as a user
Replying as a user sends the message from a team member. The customer sees that team member’s name instead of the machine user’s. Use this when an agent or automation replies on a team member’s behalf.impersonation takes exactly one of asCustomer or asUser. Sending both, or neither, fails with input_validation. MS_TEAMS and DISCORD threads reject it with cannot_reply_to_thread.
Only an API key can reply as a user, and the key’s impersonation allow list must include that user. Set impersonation.asUser.userIdentifier to the user’s userId or emailAddress:
APIandEMAIL: Plain sends the email from the user’s public name, the same as a reply the user sends from PlainCHAT: the message appears in the thread as sent by the user, with their name and avatarSLACK: Plain posts the message and any attachments through the user’s own Slack connection, as if the user sent it from Slack. If the user hasn’t connected Slack in Plain, the reply fails withmissing_user_auth_slack_integration_for_team
actor is the team member and its createdBy is the machine user.
The reply fails with one of these errors:
cannot_reply_to_thread: the user isn’t on the API key’s allow list, the user’s role can’t reply to threads, or the caller isn’t a machine user with an API keynot_found: the user doesn’t exist or has been removed from the workspaceinput_validation: the identifier names a machine user, orimpersonationsets both targets or neither
thread:reply
Mutation
Variables

