Reten Docs

Create Activity Result

Create a task activity result.

POST /api/activity-results/tasks

Create a result for a task activity from the internal admin/operator app. Results can be linked to an existing Reten activity (pass activity_id) or created as standalone entries (omit it).

Auth: Required — Authorization: Bearer <token> + x-tenant-id header, with the SUBMIT_ACTIVITY_RESULT permission.

This is the internal endpoint. External providers use the partner endpoint POST /api/integration/activity-results/tasks, which has a different request shape and is authenticated with x-api-key.

Request Body

All fields are snake_case.

FieldTypeRequiredDescription
activity_idUUIDNoReten activity ID. Omit to create a STANDALONE result not tied to an existing activity.
commerce_idUUIDNoInternal Reten commerce ID.
channelenumNoChannel through which the activity was actioned. One of SALESMAN, CALLCENTER, WHATSAPP, EMAIL, SMS, PUSH.
resultstringYesResult-type code (e.g., success, not_home). Pattern ^[a-zA-Z0-9_-]+$, max 100 chars.
commentstringNoFree text comment, max 500 chars.
future_scheduled_atISO 8601ConditionalRequired only when the selected result-type demands a follow-up date.

Example

curl -X POST https://api.reten.ai/api/activity-results/tasks \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "activity_id": "ee0e8400-e29b-41d4-a716-446655440000",
    "channel": "SALESMAN",
    "result": "success",
    "comment": "Order placed successfully"
  }'
const response = await fetch("https://api.reten.ai/api/activity-results/tasks", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "x-tenant-id": "<tenant-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    activity_id: "ee0e8400-e29b-41d4-a716-446655440000",
    channel: "SALESMAN",
    result: "success",
    comment: "Order placed successfully",
  }),
});
const result = await response.json();
import requests

response = requests.post(
    "https://api.reten.ai/api/activity-results/tasks",
    headers={
        "Authorization": "Bearer <token>",
        "x-tenant-id": "<tenant-id>",
    },
    json={
        "activity_id": "ee0e8400-e29b-41d4-a716-446655440000",
        "channel": "SALESMAN",
        "result": "success",
        "comment": "Order placed successfully",
    },
)
result = response.json()

Response 201 Created

The internal endpoint returns the enriched activity-result entity directly. The representative subset:

{
  "id": "770e8400-e29b-41d4-a716-446655440000",
  "source": "RETEN_ACTIVITY",
  "origin": "PLATFORM",
  "activityId": "ee0e8400-e29b-41d4-a716-446655440000",
  "commerceId": "c1d2e3f4-a5b6-7890-cdef-1234567890ab",
  "resultStatus": "COMPLETED",
  "occurredAt": "2026-04-11T10:30:00.000Z",
  "createdAt": "2026-04-11T10:30:05.000Z",
  "updatedAt": "2026-04-11T10:30:05.000Z",
  "taskDetails": {
    "comment": "Order placed successfully",
    "futureScheduledAt": null,
    "result": {
      "code": "success",
      "label": "Éxito"
    }
  }
}

Notes

  • If activity_id matches an existing activity, source is RETEN_ACTIVITY; if omitted, source is STANDALONE.
  • The status of the activity associated with the result becomes completed (regardless of whether the result is positive or negative, e.g. "no sale" or "schedule for another day").