> For the complete documentation index, see [llms.txt](https://helpdocs.conducttr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpdocs.conducttr.com/feature-documentation/api/endpoint-reference/messaging/post-messages.md).

# POST messages

<mark style="color:green;">`POST`</mark> `/messages`

Publishes content from a given persona on a given channel to given player(s).

You will need to use GET personas and GET teams to have the required data.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

{% tabs %}
{% tab title="Email example" %}

```json
{
  "persona": "3-49786",
  "channel": "mail",
  "subject": "Great Win",
  "body": "Congrats on securing Conducttr as the season's sponsor!",
  "to": "james.wardprowse@hammers.co.uk",
  "cc": "sally@theoffice.com, mark.jones@uptonpark.co.uk",
  "bcc": "newhamrecorder@eastham.gov.uk
  "sentiment": "positive",
  "team_id": "3437866",
  "type": "team",
  "ts": 1738686056
}
```

{% endtab %}

{% tab title="Website Article" %}

```
{
  "persona": "3-49786",
  "channel": "websites",
  "title": "New World Order",
  "subtitle": "i'm a subtitle",
  "body": "message body to team",
  "to": "6981039fa6ef12.39280090@tstoryteller.com",
  "assets": [
    {
      "type": "image",
      "assetUrl": "https://conducttr-a.akamaihd.net/fa/2306/06/22474/2023-06-06-12-15-47.png",
      "alt": ""
    },
    {
      "type": "video",
      "assetUrl": "https://conducttr-a.akamaihd.net/v/2305/p/51001/syrian-refugee-crisis-pl.m3u8",
      "alt": ""
    }
  ],
  "sentiment": "positive",
  "team_id": 3437872,
  "type": "team",
  "isDraft": 0,
  "ts": 1738686056
}
```

{% endtab %}

{% tab title="Media Pop-up" %}

```
{
  "persona": "3-49786",
  "channel": "notifications",
  "player_email": "6981039fa6ef12.39280090@tstoryteller.com",
  "subject": "hello world",
  "body": "message body to team",
  "assets": [
    {
      "type": "video",
      "assetUrl": "https://conducttr-a.akamaihd.net/v/2305/p/51001/syrian-refugee-crisis-pl.m3u8",
      "alt": ""
    }
  ],
  "sentiment": "positive",
  "team_id": 3437866,
  "type": "team",
  "ts": 1738686056
}
```

{% endtab %}

{% tab title="Social media" %}

```
{
  "persona": "3-49786",
  "channel": "microblog",
  "subject": "hello world",
  "body": "message body to team",
  "assets": [],
  "replies": 1,
  "likes": 3,
  "reposts": 2,
  "sentiment": "positive",
  "team_id": 3437866,
  "type": "team",
  "ts": 1738686056
}
```

{% endtab %}

{% tab title="Hack" %}

```
{
    "persona":"3-52963",
    "channel":"websites",
     "is_hacked": 1 | 0,
     "show_details": 1 | 0,
     "hacked_image" : "https://conducttrdev-a.akamaihd.net/fa/2602/13/22474/robdapanda-pov-from-boat-as-it-passes-under-tower-bridge-ar-f61a14af-ecfd-4ea1-a177-1378d44f4ab9-0.png",
    "team_id":"3441451",
    "type":"team",
    "ts": 1738686056
}
```

{% endtab %}
{% endtabs %}

| Name           | Type                  | Description                                                           |
| -------------- | --------------------- | --------------------------------------------------------------------- |
| `persona`      | string                | persona\_id of the sending persona                                    |
| `player_email` | email address         | if present then message is sent to the player with that email address |
| `channel`      | string                | which channel the message should be published on                      |
| `title`        | string                | required for website article                                          |
| `subject`      | string                | message subject (if it has one)                                       |
| `body`         | string                | the message body                                                      |
| `to`           | string                | required if to a single person                                        |
| `assets`       | list of asset objects | see asset object below                                                |
| `sentiment`    | string                | positive I negative I neutral  this is for social media               |
| `type`         | string                | individual I team                                                     |
| `ts`           | unix timestamp        | message timestamp                                                     |
| `isDraft`      | boolean               | 1 or 0                                                                |
| `replies`      | integer               | number of comments or replies to post                                 |
| `likes`        | integer               | number of likes                                                       |
| `reposts`      | integer               | number of reposts/shares                                              |
| is\_hacked     | integer               | 1 = hack the website, 0 = restore the website                         |
| show\_details  | integer               | 1 = show website details, 0 = hide website details                    |
| hacked\_image  | url                   | url to the image to display instead of the website when hacked        |

**Asset object**

<table><thead><tr><th width="222">Name</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>image I video I audio I document</td></tr><tr><td><code>assetUrl</code></td><td>string</td><td>must be URL to the hosted asset</td></tr><tr><td><code>alt</code></td><td>string</td><td>description of asset</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "message_id": "7b5a92a4-04a0-4b32-848c-1201df844cd1"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://helpdocs.conducttr.com/feature-documentation/api/endpoint-reference/messaging/post-messages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
