# Create Conversation

`POST /conversation`

> This is a subset of the full specification, limited to the `POST /conversation` operation.
>
> You can find the full specification here: /_bundle/docs/guides/fin-custom-helpdesk/api.yaml

```yaml
openapi: 3.0.3
info:
  version: 0.0.1
  title: Fin Custom Helpdesk API
  description: This is a subset of the full specification, limited to the `POST /conversation` operation.
  contact:
    name: Intercom Developer Support
    url: https://developers.intercom.com
  x-logo:
    url: https://www.intercom.com/favicon.ico
servers:
  - url: https://helpdesk.example.com/api/fin
    description: Your Custom Helpdesk API (replace with your actual domain)
security:
  - BearerAuth: []
tags:
  - name: Conversations
    description: Manage conversations between end-users and agents
paths:
  /conversation:
    post:
      tags:
        - Conversations
      summary: Create Conversation
      description: |
        Called when a new conversation has been created via the Fin Messenger.
        Note we provide the initial message from the conversation as we know many help desks require this to be provided when creating a conversation.
        The response requires both the conversation object and the message object so that these can be mapped correctly to their Fin equivalents.
      operationId: createConversation
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Conversation title (may be blank)
                  example: Question about pricing
                  nullable: true
                user_id:
                  type: string
                  description: ID of the end-user in your system
                  example: user_123
                object_id:
                  type: string
                  description: Unique identifier for the conversation in our system
                  example: '123456'
                initial_message:
                  type: object
                  properties:
                    conversation_id:
                      type: string
                      description: ID of the parent conversation
                      example: conv_456
                    message_type:
                      type: string
                      description: Type of message
                      enum:
                        - comment
                    body:
                      type: string
                      description: |
                        Message content in HTML format.

                        Supported HTML tags are:
                        - Paragraphs `<p>`
                        - Heading 1, Heading 2 `<h1>` `<h2>` (note h3 to h6 appears as a h2)
                        - Bold `<b>`
                        - Italic `<i>`
                        - Links `<a>`
                        - Images `<img>` (can be linked)
                        - Line breaks `<br>`
                        - Code blocks `<code>`
                        - Unordered lists `<ul>`
                        - Ordered lists `<ol>`
                      example: <p>Hi! I'd like to know more about your pricing plans.</p>
                    author:
                      type: object
                      description: The user who authored the message.
                      properties:
                        id:
                          type: string
                          description: Unique identifier for the user in your system
                          example: user_123456
                        user_type:
                          type: string
                          description: Type of user
                          enum:
                            - end_user
                            - agent
                    visibility:
                      type: string
                      description: Message visibility
                      enum:
                        - public
                        - private
                    attributes:
                      type: object
                      description: Attributes associated with the conversation
                      additionalProperties:
                        anyOf:
                          - type: string
                          - type: integer
                          - type: number
                          - type: boolean
                      example:
                        issue_type: Billing
                        priority: High
                    created_at:
                      type: string
                      format: date-time
                      description: ISO 8601 timestamp
                      example: '2025-10-27T14:30:00.000Z'
                    object_id:
                      type: string
                      description: Unique identifier for the message in our system
                      example: '123456'
                    attachments:
                      type: array
                      description: Array of attachments (can be empty)
                      items:
                        $ref: '#/components/schemas/Attachment'
      responses:
        '201':
          description: Conversation created successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - conversation
                  - initial_message
                properties:
                  conversation:
                    $ref: '#/components/schemas/Conversation'
                    description: The newly created conversation in your system.
                  initial_message:
                    $ref: '#/components/schemas/Message'
                    description: The initial message in the conversation that was created in your system.
components:
  securitySchemes:
    BearerAuth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://helpdesk.fin.com/api/auth/oauth/token
          scopes:
            read: Read access to the API (example)
            write: Write access to the API (example)
      description: OAuth2 access token configured in Fin Deployment UI
  schemas:
    EndUser:
      type: object
      description: |
        End user having a conversation with Fin or with an agent.
      required:
        - id
        - user_type
      properties:
        id:
          type: string
          description: Unique identifier for the user in your system
          example: user_123456
          nullable: false
        user_type:
          type: string
          description: Type of user
          enum:
            - end_user
          nullable: false
        name:
          type: string
          description: User's display name
          example: Jane Doe
          nullable: true
        email:
          type: string
          format: email
          description: User's email address
          example: jane.doe@example.com
          nullable: true
        photo_url:
          type: string
          format: uri
          description: URL to user's avatar/profile picture (displayed in Fin Messenger)
          example: https://example.com/avatars/jane.jpg
          nullable: true
        attributes:
          type: object
          description: Attributes associated with the end-user
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
              - type: string
                format: date-time
                description: ISO 8601 timestamp
                example: '2025-10-27T14:30:00.000Z'
          example:
            plan_type: enterprise
            signup_date: '2024-01-15'
            is_premium: true
          nullable: true
    Agent:
      type: object
      description: |
        Agent having a conversation with an end-user.
      properties:
        id:
          type: string
          description: Unique identifier for the user in your system
          example: agent_123456
        user_type:
          type: string
          description: Type of user
          enum:
            - agent
        name:
          type: string
          description: User's display name
          example: Jane Doe
          nullable: true
        email:
          type: string
          format: email
          description: User's email address
          example: jane.doe@example.com
          nullable: true
        photo_url:
          type: string
          format: uri
          description: URL to user's avatar/profile picture (displayed in Fin Messenger)
          example: https://example.com/avatars/jane.jpg
          nullable: true
        alias:
          type: string
          description: Agent's display alias (shown to end-users instead of real name)
          example: Support Jane
          nullable: true
    Conversation:
      type: object
      required:
        - id
        - status
        - user
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Unique identifier for the conversation in your system
          example: conv_456
        status:
          type: string
          description: |
            Current conversation status:
            - `open` - Conversation is actively ongoing with the end-user
            - `resolved` - Conversation is resolved by Fin
            - `closed` - Conversation is finished/archived
            - `ended` - Conversation is ended by the end-user or agent
          enum:
            - open
            - resolved
            - closed
            - ended
        user:
          $ref: '#/components/schemas/EndUser'
        title:
          type: string
          description: Conversation title or subject
          example: Question about pricing plans
          nullable: true
        tags:
          type: array
          description: List of tags associated with the conversation in your system. Can be used to power routing within the Fin workflow among other things.
          items:
            type: string
          example:
            - pricing
            - sales
          nullable: true
        attributes:
          type: object
          description: Attributes associated with the conversation
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          example:
            issue_type: Billing
            priority: High
        assignee:
          $ref: '#/components/schemas/Agent'
          nullable: true
          description: Currently assigned agent (null if unassigned) in your system. Fin typically does not attempt to handle conversations assigned to a human agent. If your system allows for multiple agents to be assigned to a conversation you may choose to return any one of these agents.
        created_at:
          type: string
          format: date-time
          description: When the conversation was created (ISO 8601 UTC)
          example: '2025-10-27T14:30:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: When the conversation was last updated (ISO 8601 UTC)
          example: '2025-10-27T15:45:00.000Z'
    Message:
      type: object
      required:
        - id
        - conversation_id
        - message_type
        - body
        - author
        - visibility
        - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the message in your system
          example: msg_001
        conversation_id:
          type: string
          description: ID of the parent conversation
          example: conv_456
        message_type:
          type: string
          description: Type of message
          enum:
            - comment
        body:
          type: string
          description: Message content in HTML format
          example: <p>Thank you for reaching out! I'd be happy to explain our pricing plans.</p>
        author:
          oneOf:
            - $ref: '#/components/schemas/EndUser'
            - $ref: '#/components/schemas/Agent'
          description: The user who authored the message.
        visibility:
          type: string
          description: |
            Who can see the message:
            - `public` - Visible to end-users (appears in Fin Messenger)
            - `private` - Only visible to agents (internal notes)
          enum:
            - public
            - private
          example: public
        created_at:
          type: string
          format: date-time
          description: When the message was created (ISO 8601 UTC)
          example: '2025-10-27T14:35:00.000Z'
        attachments:
          type: array
          description: Files attached to the message
          items:
            $ref: '#/components/schemas/Attachment'
    Attachment:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: |
            URL where the attachment can be accessed.
            Must be HTTPS. Consider using signed URLs with expiration for sensitive files.
          example: https://example.com/files/pricing-guide.pdf
        filetype:
          type: string
          description: |
            File type/extension.
          example: pdf
        filename:
          type: string
          description: Display name for the file
          example: Pricing Guide 2025
```
