API ReferenceapicommsPOST /v1/ask/threads

POST /v1/ask/threads

Service: comms · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "member_user_id": {
      "type": "string"
    },
    "member_name": {
      "type": "string",
      "minLength": 1
    },
    "member_avatar_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "body": {
      "type": "string",
      "minLength": 1
    },
    "assigned_to_user_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "assigned_coach_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "assigned_coach_avatar_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "triage_status": {
      "type": "string"
    }
  },
  "required": [
    "member_name",
    "body"
  ]
}

Responses

201 Ask thread created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "channel_type": {
      "type": "string"
    },
    "preview": {
      "type": "string"
    },
    "last_message_at": {
      "type": "string"
    },
    "last_read_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "triage_status": {
      "type": "string"
    },
    "assigned_to_user_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "coach": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "avatar_url": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "avatar_url"
      ]
    },
    "member_user_id": {
      "type": "string"
    },
    "member_name": {
      "type": "string"
    },
    "member_avatar_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "author_user_id": {
            "type": "string"
          },
          "author_role": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          },
          "author_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "thread_id",
          "author_user_id",
          "author_role",
          "author_name",
          "author_avatar_url",
          "body",
          "created_at"
        ]
      }
    }
  },
  "required": [
    "id",
    "channel_type",
    "preview",
    "last_message_at",
    "last_read_at",
    "triage_status",
    "assigned_to_user_id",
    "coach",
    "member_user_id",
    "member_name",
    "member_avatar_url",
    "messages"
  ]
}

403 Missing brand context or subject mismatch

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

422 Invalid request body

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

500 Ask thread could not be created

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://comms.platform.loop.health/v1/ask/threads \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'