Skip to main content
POST
/
feedback
Create user feedback
curl --request POST \
  --url https://app.melodi.fyi/api/external/feedback \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "feedbackType": "POSITIVE",
  "feedbackText": "<string>",
  "externalThreadId": "<string>",
  "externalMessageId": "<string>",
  "projectId": 123,
  "externalUser": {
    "externalId": "<string>",
    "email": "<string>",
    "name": "<string>",
    "username": "<string>",
    "segments": {
      "team": "engineering",
      "role": "developer"
    }
  },
  "attributes": {
    "Quality": "Wonderful",
    "Relevance": "High"
  }
}'
{
  "id": 123,
  "feedbackType": "<string>",
  "feedbackText": "<string>",
  "externalUser": {
    "id": 123,
    "organizationId": 123,
    "externalId": "<string>",
    "name": "<string>",
    "email": "<string>",
    "username": "<string>",
    "segments": [
      {
        "id": 123,
        "organizationId": 123,
        "name": "<string>",
        "userSegmentTypeId": 123,
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "type": {
          "id": 123,
          "organizationId": 123,
          "name": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        }
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  },
  "attributeOptions": [
    {
      "id": 123,
      "attributeId": 123,
      "name": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "attribute": {
        "id": 123,
        "organizationId": 123,
        "projectId": 123,
        "name": "<string>",
        "options": [
          {
            "id": 123,
            "attributeId": 123,
            "name": "<string>",
            "createdAt": "2023-11-07T05:31:56Z",
            "updatedAt": "2023-11-07T05:31:56Z"
          }
        ],
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

api-key
string
header
required

Your Melodi API key

Body

application/json

Create feedback request object. Feedback is always associated with a message:

  • If only externalThreadId is provided, feedback will be attached to the last message in the thread
  • If both externalThreadId and externalMessageId are provided, feedback will be attached to the specified message Note: externalThreadId is only unique per project, so including projectId is recommended to ensure correct thread identification.
feedbackType
enum<string>
required

Type of feedback

Available options:
POSITIVE,
NEGATIVE
externalThreadId
string
required

External ID of the thread containing the target message

feedbackText
string

Text content of the feedback

externalMessageId
string

ID of the specific message for feedback. If not provided, feedback will be attached to the thread's last message

projectId
integer

Recommended - ID of the project this thread belongs to. Helps ensure correct thread identification

externalUser
object

External user information for associating feedback with a user Request object for creating or updating an external user

attributes
object

Key-value pairs where:

  • key: attribute name (must match an existing attribute in the project)
  • value: option name (must match an existing option for that attribute)
Example:
{
"Quality": "Wonderful",
"Relevance": "High"
}

Response

Feedback successfully created

id
integer
required

Unique identifier for the feedback

attributeOptions
object[]
required

List of attribute options with their full attribute details

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
feedbackType
string | null

Type of the feedback

Maximum length: 255
feedbackText
string | null

Text content of the feedback

externalUser
object

Information about the external user who provided the feedback Represents an external user. Note: The combination of organizationId and externalId must be unique.

I