Skip to main content

Hello, I'm developing a plugin for composer mode and I need to edit the current draft.

As I understand from looking at the documentation, I need to make an API call with the message id of the draft in the url which is "msg_" but from the context in composer mode what I get is a draft id like "dra:***".

I thought about making an API call first to list the messages of a conversation since I do get the conversation id from the context and from there extract the msg_ of the message if it has a draft. The problem I find is when there are several active drafts in a conversation since I only want to edit the draft of the user who is using the plugin.

Is there any way to get the msg_ of the current draft through the context in composer mode?

Thanks very much in advance.

Just found out that the draft has many methods in the Context API, among them, fetchDraft() and updateDraft(); accepting the dra:xxxxx as the parameter to refer to them.

https://dev.frontapp.com/reference/fetchdraft
https://dev.frontapp.com/reference/updatedraft


Hi ​@Juan
 

Great question — and you're absolutely right in your follow-up!

When working within Composer Mode in the plugin SDK, you don’t need to convert the dra:xxxxx ID to a msg_ ID. The Context API provides direct support for working with drafts using that same dra: identifier.

To address your initial need:

✅ Yes, you can update the current draft directly using the draft ID — no need to fetch the full conversation or resolve multiple messages.

Here’s what you can do:

  1. Get the draft ID from the composer context.

  2. Use context.updateDraft() to modify it as needed.

  3. If you need to read the draft contents first, use context.fetchDraft().

These methods are tailored for plugin use and respect the current user's context, so you're always working with that user's draft, even in conversations with multiple active drafts.

It sounds like you’ve since figured these details out and what will work best for you, but please let us know if any other questions arise! 

Best, 
Justin


Reply