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

# Create Conversation

> Create a new DM conversation (1:1 or group).

For 1:1: idempotent — returns the existing conversation if one already
exists between the two contacts in this hub.

Requires the caller and all audience contacts to be active hub members.
Returns 422 when fewer than 2 distinct contacts are provided or when the
group cap (50 members) would be exceeded.
Requires Content-Type: application/vnd.api+json.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/hubs/{hub_id}/conversations
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/hubs/{hub_id}/conversations:
    post:
      tags:
        - community-conversations
      summary: Create Conversation
      description: |-
        Create a new DM conversation (1:1 or group).

        For 1:1: idempotent — returns the existing conversation if one already
        exists between the two contacts in this hub.

        Requires the caller and all audience contacts to be active hub members.
        Returns 422 when fewer than 2 distinct contacts are provided or when the
        group cap (50 members) would be exceeded.
        Requires Content-Type: application/vnd.api+json.
      operationId: >-
        community_conversations.post_community_conversations_post_hubs_by_hub_id_conversations
      parameters:
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/ConversationCreateEnvelope'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: >-
                  #/components/schemas/JsonApiResponse_ConversationResponseAttributes_
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ConversationCreateEnvelope:
      properties:
        data:
          $ref: '#/components/schemas/_ConversationCreateData'
      required:
        - data
      title: ConversationCreateEnvelope
      type: object
    JsonApiResponse_ConversationResponseAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_ConversationResponseAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[ConversationResponseAttributes]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    _ConversationCreateData:
      properties:
        attributes:
          $ref: '#/components/schemas/_ConversationCreateAttributes'
        type:
          title: Type
          type: string
      required:
        - type
        - attributes
      title: _ConversationCreateData
      type: object
    JsonApiResource_ConversationResponseAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/ConversationResponseAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[ConversationResponseAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    _ConversationCreateAttributes:
      properties:
        audience_contact_ids:
          items:
            type: string
          title: Audience Contact Ids
          type: array
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - audience_contact_ids
      title: _ConversationCreateAttributes
      type: object
    ConversationResponseAttributes:
      properties:
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        hub_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Hub Id
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
        is_group:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Group
        is_muted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Muted
        is_pinned:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pinned
        last_entry:
          anyOf:
            - $ref: '#/components/schemas/LastEntryPreview'
            - type: 'null'
        last_message_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Message At
        last_message_preview:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Message Preview
        participants:
          default: []
          items:
            $ref: '#/components/schemas/ParticipantSummary'
          title: Participants
          type: array
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        unread_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Unread Count
      title: ConversationResponseAttributes
      type: object
    LastEntryPreview:
      properties:
        author_contact_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Contact Id
        author_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Display Name
        body_preview:
          anyOf:
            - type: string
            - type: 'null'
          title: Body Preview
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        entry_kind:
          $ref: '#/components/schemas/MessageEntryKind'
        event:
          anyOf:
            - $ref: '#/components/schemas/MessageEventData'
            - type: 'null'
      required:
        - entry_kind
      title: LastEntryPreview
      type: object
    ParticipantSummary:
      description: >-
        A DM conversation participant summary for embedding in
        ConversationResponseAttributes.


        Not a JSON:API resource — no type/id fields. Embedded directly in the

        conversation attributes.participants list.
      properties:
        contact_id:
          title: Contact Id
          type: string
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        last_seen_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Seen At
        photo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Url
        photo_url_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Photo Url Expires At
        role:
          title: Role
          type: string
      required:
        - contact_id
        - display_name
        - photo_url
        - last_seen_at
        - role
      title: ParticipantSummary
      type: object
    MessageEntryKind:
      enum:
        - text
        - conversation_title_changed
      title: MessageEntryKind
      type: string
    MessageEventData:
      properties:
        previous_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Title
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - previous_title
        - title
      title: MessageEventData
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````