Threads

Reply in a thread

Posts a reply in a thread and returns it. Needs content: write, and is a write.

The reply is written by the person the credential belongs to, and the people in the thread are notified the way they are for any reply. It needs content, media, or both.

Leave parent out to reply to the thread itself. Name a reply in parent to reply to it: a conversation is two levels deep, so the parent has to be a direct reply to the thread, and a reply to a reply to a reply answers 422. quoted optionally quotes the thread or any message in it. Both take a message's id or short_id, and both have to be in this thread.

A reply has no visibility of its own: it is exactly as readable as its thread. A locked thread takes no replies and answers 409.

Publishes message.created.

post/threads/{thread}/messages

Request

  • Base URL: https://api.usecommune.com
  • URL: https://api.usecommune.com/threads/{thread}/messages
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://usecommune.com/api/oauth/authorize, token URL https://usecommune.com/api/oauth/token, scopes: content:write)

Headers

Idempotency-Keystring required

A value of your choosing naming the change this request is making.

Send the same value again to retry the same request. Commune replays the answer the first attempt gave instead of making the change twice, and marks the replay with an Idempotent-Replay: true response header. Send a different value for a different change: a key reused for a request that differs in any way answers 409, because replaying an answer to a question you did not ask is a wrong answer you could not detect.

A UUID per change is the usual choice. Remembered for 24 hours, per credential, so two credentials choosing the same value never see each other's answers.

Required, not optional.

Request body

OR

Response

The reply, as created.

object'message' required

Always message.

idstring uuid required

Stable identifier.

short_idstring nullable

Eight character base62 identifier used by the message's permalink. Null for a message old enough that none was assigned.

depthinteger required

1 for a reply to the thread, 2 for a reply to a reply. Commune does not nest deeper, so a client can render the tree with a fixed two level layout.

contentstring required

The message body as HTML. Treat it as untrusted markup and render it in a sandboxed context.

created_atstring date-time required

When the reply was written.

updated_atstring date-time

When the row last changed for any reason.

edited_atstring date-time nullable

When the author last edited the text or attachments. Not touched by reactions or other side effects, so it is a faithful edited marker.

Example response

{
  "thread": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "newsletter": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "author": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "parent": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "quoted": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "highlight": {
    "object": "newsletter",
    "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
  },
  "reactions": [
    {
      "emoji": "🎉",
      "users": [
        {
          "object": "newsletter",
          "id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
        }
      ]
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.