> ## Documentation Index
> Fetch the complete documentation index at: https://docs.posttu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a Mastodon direct message

> Send a Mastodon direct message via Posttu's Mastodon REST API (POST /api/v1/mastodon/conversations/message/send) and MCP server.



## OpenAPI

````yaml openapi.json POST /api/v1/mastodon/conversations/message/send
openapi: 3.1.0
info:
  title: Posttu API
  version: 1.0.0
  description: >-
    Posttu V1 REST API — Workflow automation, social-media post management,
    inbox, tags, and calendar.
servers:
  - url: https://posttu.com
    description: Production
security: []
paths:
  /api/v1/mastodon/conversations/message/send:
    post:
      tags:
        - Mastodon
      summary: Send a Mastodon direct message
      description: |-
        Send a Mastodon direct message
        Requires API key scope: `mastodon:write`.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                channelId:
                  type: string
                  description: Mastodon channel ID
                  example: ch_md123
                chatId:
                  type: string
                  description: Recipient handle (@user@instance)
                messageData:
                  allOf:
                    - $ref: '#/components/schemas/CreateMessage'
                    - description: Message body, including text and media
                      example:
                        message: Hello!
                idempotencyKey:
                  type: string
              required:
                - channelId
                - chatId
                - messageData
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MastodonUserMessageSendResponse'
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateMessage:
      type: object
      properties:
        fansly:
          type: object
          properties:
            lockedText:
              type: array
              items:
                type: object
                properties:
                  text:
                    type: string
                  permissions:
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            flags:
                              type: number
                            verificationFlags:
                              type:
                                - number
                                - 'null'
                            metadata:
                              type:
                                - string
                                - 'null'
                            validAfter:
                              type:
                                - number
                                - 'null'
                            validBefore:
                              type:
                                - number
                                - 'null'
                            price:
                              type: number
                              default: 0
                            type:
                              type: number
                              default: 0
                          required:
                            - flags
                      - type: array
                        items:
                          anyOf:
                            - type: object
                              properties:
                                price:
                                  type: number
                                  minimum: 5
                                  default: 5
                                  description: >-
                                    The price to purchase the locked text.
                                    Default value is 5.
                                tipped:
                                  type: number
                                  minimum: 0.5
                                  default: 0.5
                                  description: >-
                                    Limit to users who tipped at least this
                                    amount. Default value is 0.5.
                                following:
                                  type: boolean
                                  description: >-
                                    Grant access to users who are following the
                                    account.
                                subscribed:
                                  type: boolean
                                  description: >-
                                    Grant access to users who are subscribed to
                                    the account. cannot be used with
                                    subscription
                            - type: object
                              additionalProperties:
                                type: object
                                properties:
                                  price:
                                    type: number
                                    minimum: 5
                                    default: 5
                                    description: >-
                                      The price to purchase the locked text.
                                      Default value is 5.
                                  tipped:
                                    type: number
                                    minimum: 0.5
                                    default: 0.5
                                    description: >-
                                      Limit to users who tipped at least this
                                      amount. Default value is 0.5.
                                  following:
                                    type: boolean
                                    description: >-
                                      Grant access to users who are following
                                      the account.
                                  subscribed:
                                    type: boolean
                                    description: >-
                                      Grant access to users who are subscribed
                                      to the account. cannot be used with
                                      subscription
                required:
                  - text
              description: Fansly locked texts
            media:
              type: array
              items:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        source:
                          type: string
                          enum:
                            - POSTTU
                            - FANSLY
                            - ONLYFANS
                            - FANVUE
                        previewId:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Preview id of the media, leave blank if not
                            applicable
                        coverId:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Cover id of the media for videos, leave blank if not
                            applicable
                        sourceChannelId:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Source channel id of the media, leave blank if
                            source is posttu
                        isPreview:
                          type:
                            - boolean
                            - 'null'
                          description: Is preview image
                        isCover:
                          type:
                            - boolean
                            - 'null'
                          description: Is cover image
                      required:
                        - id
                        - source
                      description: Array of media
                  order:
                    type: number
                    description: >-
                      Order of the media bundle in the message. The API requires
                      a value; it is filled from the array index when omitted.
                    example: 1
                  permissions:
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            flags:
                              type: number
                            verificationFlags:
                              type:
                                - number
                                - 'null'
                            metadata:
                              type:
                                - string
                                - 'null'
                            validAfter:
                              type:
                                - number
                                - 'null'
                            validBefore:
                              type:
                                - number
                                - 'null'
                            price:
                              type: number
                              default: 0
                            type:
                              type: number
                              default: 0
                          required:
                            - flags
                      - type: array
                        items:
                          anyOf:
                            - type: object
                              properties:
                                price:
                                  type: number
                                  minimum: 5
                                  default: 5
                                  description: >-
                                    The price to purchase the locked text.
                                    Default value is 5.
                                validAfter:
                                  type:
                                    - number
                                    - 'null'
                                  default: null
                                  description: >-
                                    Avaliable after this date (unix timestamp in
                                    seconds). Default value is null.
                                validBefore:
                                  type:
                                    - number
                                    - 'null'
                                  default: null
                                  description: >-
                                    Avaliable until this date (unix timestamp in
                                    seconds). Default value is null.
                                list:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      description: The id of the list.
                                    label:
                                      type: string
                                      description: The name of the list.
                                  required:
                                    - id
                                    - label
                                subscription:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      default: ''
                                      description: >-
                                        The id of the subscription level. leave
                                        blank if you want to match any
                                        subscription level defaults to empty
                                        string
                                    name:
                                      type: string
                                      default: ''
                                      description: >-
                                        The name of the subscription level.
                                        leave blank if you want to match any
                                        subscription name defaults to empty
                                        string
                                    before:
                                      type: number
                                      default: 0
                                      description: >-
                                        Limit to users who had an active
                                        subscription before this date. e.g.
                                        1672531200 (unix timestamp in seconds)
                                    after:
                                      type: number
                                      default: 0
                                      description: >-
                                        Limit to users who had an active
                                        subscription after this date. e.g.
                                        1672531200 (unix timestamp in seconds)
                                following:
                                  type: boolean
                                  description: >-
                                    Grant access to users who are following the
                                    account.
                                subscribed:
                                  type: boolean
                                  description: >-
                                    Grant access to users who are subscribed to
                                    the account. cannot be used with
                                    subscription
                              description: >-
                                Used to build media permission for fansly. Can't
                                have both 'subscribed' and 'subscription' in the
                                same object.
                            - type: object
                              additionalProperties:
                                type: object
                                properties:
                                  price:
                                    type: number
                                    minimum: 5
                                    default: 5
                                    description: >-
                                      The price to purchase the locked text.
                                      Default value is 5.
                                  validAfter:
                                    type:
                                      - number
                                      - 'null'
                                    default: null
                                    description: >-
                                      Avaliable after this date (unix timestamp
                                      in seconds). Default value is null.
                                  validBefore:
                                    type:
                                      - number
                                      - 'null'
                                    default: null
                                    description: >-
                                      Avaliable until this date (unix timestamp
                                      in seconds). Default value is null.
                                  list:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                        description: The id of the list.
                                      label:
                                        type: string
                                        description: The name of the list.
                                    required:
                                      - id
                                      - label
                                  subscription:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                        default: ''
                                        description: >-
                                          The id of the subscription level. leave
                                          blank if you want to match any
                                          subscription level defaults to empty
                                          string
                                      name:
                                        type: string
                                        default: ''
                                        description: >-
                                          The name of the subscription level.
                                          leave blank if you want to match any
                                          subscription name defaults to empty
                                          string
                                      before:
                                        type: number
                                        default: 0
                                        description: >-
                                          Limit to users who had an active
                                          subscription before this date. e.g.
                                          1672531200 (unix timestamp in seconds)
                                      after:
                                        type: number
                                        default: 0
                                        description: >-
                                          Limit to users who had an active
                                          subscription after this date. e.g.
                                          1672531200 (unix timestamp in seconds)
                                  following:
                                    type: boolean
                                    description: >-
                                      Grant access to users who are following
                                      the account.
                                  subscribed:
                                    type: boolean
                                    description: >-
                                      Grant access to users who are subscribed
                                      to the account. cannot be used with
                                      subscription
                                description: >-
                                  Used to build media permission for fansly.
                                  Can't have both 'subscribed' and
                                  'subscription' in the same object.
                required:
                  - items
              description: >-
                Array of media for fansly. Media placed in items will be bundled
                together.
        onlyfans:
          type: object
          properties:
            lockedText:
              type: boolean
              default: false
        price:
          type: number
          description: Message price for onlyfans and fanvue
          example: 5
        message:
          type: string
          description: Message content
          example: Hello!
        media:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  id:
                    type: string
                    description: Media ID from the source
                  source:
                    type: string
                    enum:
                      - ONLYFANS
                      - FANSLY
                      - FANVUE
                      - POSTTU
                    default: POSTTU
                    description: Source of the media.
                  previewId:
                    type:
                      - string
                      - 'null'
                    description: Preview ID
                  coverId:
                    type:
                      - string
                      - 'null'
                    description: Cover ID
                  sourceChannelId:
                    type: string
                    description: >-
                      Source channel ID required when source is not posttu
                      upload or id
                  isPreview:
                    type:
                      - boolean
                      - 'null'
                    description: Is preview image
                  isCover:
                    type:
                      - boolean
                      - 'null'
                    description: Is cover image
                required:
                  - id
              order:
                type: number
                description: Order of the media in the message
                example: 1
            required:
              - item
          description: >-
            Array of media that will be used in this request including preview
            and cover images if any. If the platform is fansly, you must also
            pass media in the fansly.media field if you want to add custom
            permissions or bundle media together, otherwise the default
            permissions will be applied to the media items and will treat this
            as a single bundle of media.
        mediaPreviewIds:
          type: array
          items:
            type: string
          description: >-
            Array of media preview IDs for fanvue and onlyfans. To be shown for
            free as a preview of a pay-to-view. Fanvue supports only 1 preview,
            Onlyfans supports multiple previews. Fansly ignores this field use
            fansly.media field to set preview images for fansly
        scheduledFor:
          type: string
          format: date-time
          description: Scheduled time
        replyTo:
          type: string
          description: Reply to message ID
        meta:
          type: object
          properties:
            messagingType:
              type: string
              enum:
                - RESPONSE
                - UPDATE
                - TAGGED_MESSAGE
                - PRIVATE_REPLY
              description: Meta messaging type
            messageTag:
              type: string
              enum:
                - HUMAN_AGENT
                - CONFIRMED_EVENT_UPDATE
                - ACCOUNT_UPDATE
                - POST_PURCHASE_UPDATE
              description: Meta message tag for out-of-window messages
            commentId:
              type: string
              description: >-
                Meta Private Reply: ID of comment to privately message the
                author
              example: '17923485720938'
            comment_id:
              type: string
            postId:
              type: string
              description: 'Meta Private Reply: ID of post to privately message the author'
              example: '982347192837'
            post_id:
              type: string
      description: Message payload
      example:
        text: Hello!
    MastodonUserMessageSendResponse:
      type: object
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/MastodonStatus'
            - type:
                - object
                - 'null'
        conversationId:
          type: string
        success:
          type: boolean
        error:
          type: string
      required:
        - data
        - success
    MastodonStatus:
      type: object
      properties:
        id:
          type: string
        created_at:
          type: string
        in_reply_to_id:
          type:
            - string
            - 'null'
        in_reply_to_account_id:
          type:
            - string
            - 'null'
        sensitive:
          type: boolean
        spoiler_text:
          type: string
        visibility:
          type: string
          enum:
            - public
            - unlisted
            - private
            - direct
        language:
          type:
            - string
            - 'null'
        uri:
          type: string
        url:
          type:
            - string
            - 'null'
        replies_count:
          type: number
        reblogs_count:
          type: number
        favourites_count:
          type: number
        edited_at:
          type:
            - string
            - 'null'
        favourited:
          type: boolean
        reblogged:
          type: boolean
        muted:
          type: boolean
        bookmarked:
          type: boolean
        pinned:
          type: boolean
        content:
          type: string
        reblog:
          oneOf:
            - $ref: '#/components/schemas/MastodonStatus'
            - type: 'null'
        account:
          $ref: '#/components/schemas/MastodonAccount'
        media_attachments:
          type: array
          items:
            $ref: '#/components/schemas/MastodonMediaAttachment'
        mentions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              username:
                type: string
              url:
                type: string
              acct:
                type: string
            required:
              - id
              - username
              - url
              - acct
        tags:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              url:
                type: string
            required:
              - name
              - url
        emojis:
          type: array
          items: {}
        card: {}
        poll:
          $ref: '#/components/schemas/MastodonPoll'
        quote:
          oneOf:
            - $ref: '#/components/schemas/MastodonStatus'
            - type: 'null'
      required:
        - id
        - created_at
        - in_reply_to_id
        - in_reply_to_account_id
        - sensitive
        - spoiler_text
        - visibility
        - language
        - uri
        - url
        - replies_count
        - reblogs_count
        - favourites_count
        - edited_at
        - content
        - reblog
        - account
        - media_attachments
        - poll
      additionalProperties: {}
    MastodonAccount:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
        username:
          type: string
        acct:
          type: string
        display_name:
          type: string
        locked:
          type: boolean
        bot:
          type: boolean
        created_at:
          type: string
        note:
          type: string
        url:
          type: string
        avatar:
          type: string
        avatar_static:
          type: string
        header:
          type: string
        header_static:
          type: string
        followers_count:
          type: number
        following_count:
          type: number
        statuses_count:
          type: number
        last_status_at:
          type:
            - string
            - 'null'
        emojis:
          type: array
          items: {}
        fields:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: string
              verified_at:
                type:
                  - string
                  - 'null'
            required:
              - name
              - value
              - verified_at
      required:
        - id
        - username
        - acct
        - display_name
        - locked
        - bot
        - created_at
        - note
        - url
        - avatar
        - avatar_static
        - header
        - header_static
        - followers_count
        - following_count
        - statuses_count
        - last_status_at
      additionalProperties: {}
    MastodonMediaAttachment:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - image
            - video
            - gifv
            - audio
            - unknown
        url:
          type:
            - string
            - 'null'
        preview_url:
          type: string
        remote_url:
          type:
            - string
            - 'null'
        text_url:
          type:
            - string
            - 'null'
        meta:
          type:
            - object
            - 'null'
          properties:
            original:
              type: object
              properties:
                width:
                  type: number
                height:
                  type: number
                size:
                  type: string
                aspect:
                  type: number
                duration:
                  type: number
                bitrate:
                  type: number
            small:
              type: object
              properties:
                width:
                  type: number
                height:
                  type: number
                size:
                  type: string
                aspect:
                  type: number
            focus:
              type: object
              properties:
                x:
                  type: number
                'y':
                  type: number
              required:
                - x
                - 'y'
          additionalProperties: {}
        description:
          type:
            - string
            - 'null'
        blurhash:
          type:
            - string
            - 'null'
      required:
        - id
        - type
        - url
        - preview_url
        - remote_url
        - text_url
        - description
        - blurhash
      additionalProperties: {}
    MastodonPoll:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
        expires_at:
          type:
            - string
            - 'null'
        expired:
          type: boolean
        multiple:
          type: boolean
        votes_count:
          type: number
        voters_count:
          type:
            - number
            - 'null'
        options:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              votes_count:
                type:
                  - number
                  - 'null'
            required:
              - title
              - votes_count
        voted:
          type: boolean
        own_votes:
          type: array
          items:
            type: number
        emojis:
          type: array
          items: {}
      required:
        - id
        - expires_at
        - expired
        - multiple
        - votes_count
        - voters_count
        - options
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key via the Authorization header: `Bearer <api-key>`'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.