Tag messages your own scripts send through the API
When a message is sent through the Master Inbox API, the thread gets a Sent by API label, so you can report on and audit what your scripts and outside agents send.
Why teams run it
When agents and scripts send on your mailboxes, you need to see exactly what they sent.
Set it up in Master Inbox
- In Master Inbox, open Settings, then Workflows, and click Add a workflow.
- Name it Tag messages your own scripts send through the API.
- Set the trigger to Sending Message and choose All channels.
- Add a condition: Sent from is the API.
- Add the action Add labels: Sent by API.
- Save the workflow and switch it to Active.
Or create it with the API
Everything in the workflow builder is also in the Master Inbox API. This request creates the same workflow. Replace the example ids with your own label, list and campaign ids from GET /workflows/filter-fields. This workflow also uses conditions: add them under trigger_config.conditions, as shown on the conditions page.
curl -X POST https://api.masterinbox.com/api/api-webhook/v1/api/workflows/create-workflow \
-H "Authorization: Bearer $MASTER_INBOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Tag messages your own scripts send through the API",
"trigger_type": "send_message",
"trigger_config": {
"channel_ids": [
"-1"
]
},
"action_configs": [
{
"action_type": "add_labels",
"label_ids": [
176480
]
}
]
}'Full reference: workflow API guide and API docs.
Or ask Claude, ChatGPT or Grok to build it
Our workflow guide is written for AI agents to read. Give your assistant your API key and this prompt:
Read https://app.masterinbox.com/public-workflow-api.md and use my Master Inbox API key to create this workflow: "Tag messages your own scripts send through the API". First call GET /workflows/filter-fields and look up my label, list and channel ids, then create the workflow and tell me what you set up.Questions
Can I narrow it to one API key?
Yes. The sent from condition can target messages from one API key.
Can I alert on them instead?
Yes. Add a Notify in Slack action.
Can I build this workflow through the API?
Yes. Send the create-workflow request shown on this page with your Master Inbox API key. The API checks the payload first and lists every problem by field if anything is off.
Which plan includes this?
This workflow works on the Team plan. Every plan has unlimited users and starts with a free 7-day POC.
Learn more
Related workflows
Log every label change to Google Sheets
When a label is added to a lead, a webhook sends the prospect id, labels, campaign and thread link to Zapier or n8n, which adds or updates a row in...


ReportingLog every message the AI agent sends to a Google Sheet
Each reply sent by a reply agent goes by webhook to Zapier or n8n, which logs the prospect, message and thread link in Google Sheets, giving you an...


ReportingSend not interested replies to your warehouse to find objection patterns
When a reply is labeled Not interested, a webhook sends the reply text, campaign and company to n8n, which writes it to BigQuery, Snowflake or...
ReportingLog every meeting booked to a Google Sheet tracker
Each Cal.com or Calendly booking sends a webhook to Zapier, Make or n8n, which adds a row to your Google Sheet with the prospect, company, campaign,...




Run this on your own inboxes
Free 7-day POC. Unlimited users on every plan.
