Reten Docs
Activities Guide

Reading Activities

How to list, filter, and get activity details from the Reten API.

The most common integration pattern is reading activities assigned to your commerces. Use the activities endpoints to list, filter, and inspect activity details.

Listing Activities

Use GET /api/activities with filters to find activities. All list responses are paginated.

Available Filters

ParameterTypeDescription
statusstringFilter by status: READY, UNRESOLVED, DISPATCHED, COMPLETED, CANCELED, FAILED
typestringFilter by type: TASK, MESSAGE
channelstringFilter by channel: SALESMAN, CALLCENTER, WHATSAPP, EMAIL, SMS, PUSH
commerce_idUUIDFilter by specific commerce
scheduled_fromISO 8601Activities scheduled after this date
scheduled_toISO 8601Activities scheduled before this date
searchstringFree text search
pagenumberPage number (default: 1)
per_pagenumberItems per page (default: 25, max: 100)

Example: List READY tasks

curl "https://api.reten.ai/api/activities?status=READY&type=TASK&page=1&per_page=10" \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>"
import axios from 'axios';

const response = await axios.get(
  'https://api.reten.ai/api/activities',
  {
    params: {
      status: 'READY',
      type: 'TASK',
      page: 1,
      per_page: 10,
    },
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const { data: activities, meta } = response.data;

Response

{
  "data": [
    {
      "id": "ee0e8400-e29b-41d4-a716-446655440000",
      "type": "TASK",
      "channel": "SALESMAN",
      "status": "READY",
      "scheduledAt": "2025-01-16T09:00:00.000Z",
      "commerceAssignment": {
        "commerceId": "880e8400-...",
        "commerce": {
          "name": "Main Street Store"
        }
      }
    }
  ],
  "meta": {
    "page": 1,
    "limit": 10,
    "total": 42,
    "totalPages": 5
  }
}

Getting Activity Details

Use GET /api/activities/:id to retrieve a single activity with its commerce assignment and full details.

Example

curl https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>"
const response = await axios.get(
  'https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000',
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const activity = response.data;

Checking Status Events

Every status transition creates an audit trail entry. Use GET /api/activities/:id/status-events to view the complete history.

Example

curl https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000/status-events \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>"
const response = await axios.get(
  `https://api.reten.ai/api/activities/${activityId}/status-events`,
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const events = response.data;
// Each event has: eventType, fromStatus, toStatus, occurredAt

Response

[
  {
    "id": "ff0e8400-...",
    "eventType": "CREATED",
    "fromStatus": null,
    "toStatus": "READY",
    "occurredAt": "2025-01-15T10:30:00.000Z"
  },
  {
    "id": "ff1e8400-...",
    "eventType": "DISPATCH_SUCCESS",
    "fromStatus": "READY",
    "toStatus": "DISPATCHED",
    "occurredAt": "2025-01-15T10:31:00.000Z"
  }
]

Event Types

EventDescription
CREATEDActivity created with READY status
CREATION_FAILEDActivity creation failed
DISPATCH_ATTEMPTDispatch attempt started
DISPATCH_SUCCESSSuccessfully dispatched to provider
DISPATCH_FAILEDDispatch attempt failed
COMPLETEDActivity execution completed
CANCELEDActivity manually canceled
FAILEDActivity execution failed
RESOLUTION_FAILEDTarget user or attribute resolution failed (activity → UNRESOLVED)
RESOLUTION_RETRY_SUCCESSRetry resolved all pending targets/attributes (activity → READY)
RESOLUTION_RETRY_FAILEDRetry did not resolve all pending targets/attributes

Viewing Activity Attributes

Activities can have key-value attributes attached during creation. Use GET /api/activities/:id/attributes to retrieve them.

Example

curl https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000/attributes \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>"
const response = await axios.get(
  `https://api.reten.ai/api/activities/${activityId}/attributes`,
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const attributes = response.data;

Required Permission

All read operations require the VIEW_ACTIVITIES permission, available to SUPER_ADMIN, ADMIN, FDE, and VIEWER roles.