# SOF43 - Create a thread on a service

Call Frequency

Recommended usage: At every message thread
Maximum usage: At every message thread

Endpoint: POST /api/mms/services/{service_code}/threads

## Path parameters:

  - `service_code` (string, required)
    Service code on which the thread is created.

## Query parameters:

  - `shop_id` (integer)
    Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

## Request fields (multipart/form-data):

  - `files` (array)
    List of attachments for the first message of the thread

  - `thread_input` (object, required)
    The content of the thread: body, topic, participants...

  - `thread_input.body` (string, required)
    Body message

  - `thread_input.to` (array, required)
    Recipients

  - `thread_input.topic` (object, required)
    Thread topic

  - `thread_input.topic.type` (string, required)
    Topic type

Enum: "FREE_TEXT", "REASON_CODE"

  - `thread_input.topic.value` (string, required)
    Topic value, which depends on the type:When type equals FREE_TEXT: the topic value is freeWhen type equals REASON_CODE: the topic value must be a reason code (example: MPS_ORDER_MESSAGING_ISSUE)

## Response 201 fields (application/json):

  - `message_id` (string, required)
    Id of the first message created on the thread

  - `thread_id` (string, required)
    Id of the created thread


