BETA

Records explicit feedback (๐Ÿ‘ or ๐Ÿ‘Ž) from the visitor on a conversation turn, with an optional reason when it's ๐Ÿ‘Ž. A ๐Ÿ‘Ž also opens (or reuses, if one already exists) an internal moderation case so Mapaprop's team can review the response.

This API has no per-user identity (only an OAuth client scoped to the account): the feedback is recorded on behalf of the account, not a specific person.

Resource information
AuthenticationRequired (API Token, Bearer)
Scopemapaprop-chat-ai
HTTP MethodPOST
ResponseJSON
Version1

Resource URL

https://mapaprop.app/api/action/mapaprop-chat-ai-v1/feedback

Parameters

KeyTypeRequiredDescription
turnIdlongyesID of the turn the feedback is about. Comes in the response of POST /chat (turnId field) or in the done SSE event of POST /chat/stream. Must belong to the token's account.
ratingstringyesup or down.
reasonCodestringnoReason for the feedback: incorrect, not_resolved, irrelevant or other.
reasonTextstringnoVisitor's free-text comment (maximum 2000 characters).

Sample code

POST /api/action/mapaprop-chat-ai-v1/feedback HTTP/1.1
Host: mapaprop.app
Content-Type: application/json
Authorization: Bearer {access_token}

{
    "turnId": 481512,
    "rating": "down",
    "reasonCode": "incorrect",
    "reasonText": "It told me there were 3 rooms and the photo shows a studio."
}

Response

ObjectFieldTypeRequiredDescription
Responsesuccessbooleanyestrue when the feedback was recorded successfully.
turnIdlongyesThe turnId you sent.
ratingstringyesThe rating you sent (up or down).
feedbackIdintyesID of the created feedback record.
caseCreatedbooleanyestrue only when this call created a NEW moderation case. On up, always false. On down, it's false if the turn already had an open case from a previous feedback (the same case is reused, never duplicated).
moderationCaseIdintnoID of the moderation case (new or existing). Only present when rating is down.

In case of error, the shape above with success: false is not returned: the request is cut off with an error (see the following tables).

Errors

ErrorCause
INVALID_PERMISSION (HTTP 403)The turnId sent doesn't exist, or belongs to another account's conversation.

Validation errors (the request is cut off, success: false is not returned)

ErrorCause
REQUIRED_INPUT โ€” "El campo 'turnId' es requerido"The turnId field is missing, or is less than or equal to 0.
REQUIRED_INPUT โ€” "El campo 'rating' es requerido ('up' o 'down')"The rating field is missing, or its value isn't up or down.
REQUIRED_INPUT โ€” "El campo 'reasonCode' debe ser uno de: incorrect, not_resolved, irrelevant, other"reasonCode was sent with a value other than the allowed ones.
INPUT_TOO_LONG โ€” "El campo 'reasonText' es demasiado largo (max 2000 caracteres)"The reasonText sent exceeds 2000 characters.

Sample response

{
    "success": true,
    "turnId": 481512,
    "rating": "down",
    "feedbackId": 9031,
    "caseCreated": true,
    "moderationCaseId": 214
}

Error example:

{
    "success": false,
    "error": "INVALID_PERMISSION"
}