{"uid":"cap_Tl0ZXo_aLrqeGJKNZcEf0","slug":"agentmail-message-id-d71981dc","name":"AgentMail Update Message","description":"Update Message","url":"https://mpp.api.agentmail.to/v0/inboxes/:inbox_id/messages/:message_id?utm_source=zero.xyz","method":"PATCH","headers":{},"bodySchema":{"type":"object","title":"UpdateMessageRequest","properties":{"add_labels":{"type":"array","items":{"type":"string"},"description":"Labels to add to message."},"remove_labels":{"type":"array","items":{"type":"string"},"description":"Labels to remove from message."}}},"responseSchema":{"type":"object","title":"Message","required":["inbox_id","thread_id","message_id","labels","timestamp","from","to","size","updated_at","created_at"],"properties":{"cc":{"type":"array","items":{"type":"string"},"title":"MessageCc","description":"Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."},"to":{"type":"array","items":{"type":"string"},"title":"MessageTo","description":"Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."},"bcc":{"type":"array","items":{"type":"string"},"title":"MessageBcc","description":"Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`."},"from":{"type":"string","title":"MessageFrom","description":"Address of sender. In format `username@domain.com` or `Display Name <username@domain.com>`."},"html":{"type":"string","title":"MessageHtml","description":"HTML body of message."},"size":{"type":"integer","title":"MessageSize","description":"Size of message in bytes."},"text":{"type":"string","title":"MessageText","description":"Plain text body of message."},"labels":{"type":"array","items":{"type":"string"},"title":"MessageLabels","description":"Labels of message."},"headers":{"type":"object","title":"MessageHeaders","description":"Headers in message.","additionalProperties":{"type":"string"}},"preview":{"type":"string","title":"MessagePreview","description":"Text preview of message."},"subject":{"type":"string","title":"MessageSubject","description":"Subject of message."},"inbox_id":{"type":"string","title":"InboxId","description":"The ID of the inbox."},"reply_to":{"type":"array","items":{"type":"string"},"description":"Reply-to addresses. In format `username@domain.com` or `Display Name <username@domain.com>`."},"thread_id":{"type":"string","title":"ThreadId","description":"ID of thread."},"timestamp":{"type":"string","title":"MessageTimestamp","format":"date-time","description":"Time at which message was sent or drafted."},"created_at":{"type":"string","title":"MessageCreatedAt","format":"date-time","description":"Time at which message was created."},"message_id":{"type":"string","title":"MessageId","description":"ID of message."},"references":{"type":"array","items":{"type":"string"},"title":"MessageReferences","description":"IDs of previous messages in thread."},"updated_at":{"type":"string","title":"MessageUpdatedAt","format":"date-time","description":"Time at which message was last updated."},"attachments":{"type":"array","items":{"type":"object","title":"Attachment","required":["attachment_id","size"],"properties":{"size":{"type":"integer","title":"AttachmentSize","description":"Size of attachment in bytes."},"filename":{"type":"string","title":"AttachmentFilename","description":"Filename of attachment."},"content_id":{"type":"string","title":"AttachmentContentId","description":"Content ID of attachment."},"content_type":{"type":"string","title":"AttachmentContentType","description":"Content type of attachment."},"attachment_id":{"type":"string","title":"AttachmentId","description":"ID of attachment."},"content_disposition":{"enum":["inline","attachment"],"type":"string","title":"AttachmentContentDisposition","description":"Content disposition of attachment."}}},"title":"MessageAttachments","description":"Attachments in message."},"in_reply_to":{"type":"string","title":"MessageInReplyTo","description":"ID of message being replied to."},"extracted_html":{"type":"string","description":"Extracted new HTML content."},"extracted_text":{"type":"string","description":"Extracted new text content."}}},"example":null,"exampleRequest":null,"tags":["email","inboxes","domains","drafts","threads","webhooks","messaging","ai","social"],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"unprobed","priceSource":"unknown","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"free","summary":"Free","primary":null,"accepted":[]},"paymentMethods":[],"brandName":"AgentMail","brandSlug":"agentmail","brandBaseUrl":"https://agentmail.to","brandDocsUrl":"https://docs.agentmail.to","whatItDoes":"Updates labels on a specific email message within an AgentMail inbox","exampleAgentPrompt":"In my AgentMail inbox 'support-bot', add the label 'urgent' and remove the label 'unread' from message ID 'msg_abc123'.","exampleUseCases":[{"title":"Organize support tickets by priority","prompt":"Go through my support inbox and mark all messages from VIP customers with the 'vip-priority' label, then remove the 'new' label so my team knows they've been triaged."},{"title":"Automate email workflow categorization","prompt":"When you receive emails in my sales inbox, tag them with 'follow-up-needed' if they're replies, and remove the 'unread' label once you've processed them."},{"title":"Flag and archive processed messages","prompt":"In my operations inbox, add the 'archived' label to all messages from our automated reports, and remove the 'pending-review' label once you've confirmed they're handled."}],"resultDescription":"Returns the full updated Message object including inbox_id, thread_id, message_id, updated labels array, from/to/cc/bcc addresses, subject, plain text and HTML body, preview, headers, size in bytes, and created_at/updated_at timestamps.","failureModes":["404 Not Found if inbox_id or message_id does not exist","401 Unauthorized if Bearer token is missing or invalid","400 Bad Request if add_labels or remove_labels contain invalid values","409 Conflict if attempting to add a label that already exists or remove one that is not present","500 Internal Server Error if the AgentMail service is unavailable"],"whenToPreferThis":"Use this endpoint when you need to programmatically update the labels on a specific email message in an AgentMail inbox — for example, to mark messages as processed, flagged, read, or categorized as part of an automated AI agent email workflow. Prefer this over recreating or deleting messages when only metadata/labeling changes are needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T00:32:12.763Z","isFirstParty":false,"canonicalSlug":"agentmail-message-id-d71981dc"}