Reten Docs

List Forms

Read the result forms that task-type activities are answered with.

A task-type activity carries a formId: the id of its result form. Your system reads that form, shows it to whoever handled the activity, and sends the answers when submitting the result. Reten validates the answers against the version of the form that was answered and derives the result from them. A task created before result forms existed carries formId as null and is answered only with the current format.

Read the form by the formId of each activity (List Activities and dispatch both carry it). Do not deduce it from the project or from any other field of the activity: two activities of the same project can carry different forms.

GET /api/integration/activity-forms

Returns the forms within reach of the request (see Scope), each one complete and in its current version, paginated and ordered from the oldest to the newest. Use it to synchronize every form at once, for example at the start of the day.

Authentication: Required — permission activity:view

Required header

HeaderValue
x-api-keyYOUR_API_KEY

x-project-id is optional: this is a project-optional endpoint. A header that is sent is validated — see Project errors.

Query parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
per_pagenumberNoItems per page (default: 25, max: 100)

The list has no filters.

Example

curl -X GET "BASE_URL/api/integration/activity-forms?page=1&per_page=25" \
  -H "x-api-key: YOUR_API_KEY"
const response = await fetch(
  `${BASE_URL}/api/integration/activity-forms?page=1&per_page=25`,
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    },
  }
);

const { data, pagination } = await response.json();
import requests

response = requests.get(
    f"{BASE_URL}/api/integration/activity-forms",
    headers={
        "x-api-key": "YOUR_API_KEY",
    },
    params={
        "page": 1,
        "per_page": 25,
    },
)

data = response.json()

Response 200 OK

Each item has the shape of the read by id.

{
  "data": [
    {
      "id": "5d2f8c1e-7a43-4b96-8e0d-3c9a1f6b2d74",
      "version": 1,
      "updatedAt": "2026-11-02T14:30:00.000Z",
      "intentCategory": "SURVEY",
      "sections": [
        {
          "questions": [
            {
              "key": "code",
              "type": "SINGLE_CHOICE",
              "label": "¿Cómo terminó la gestión?",
              "required": true,
              "options": [
                { "code": "success", "label": "Encuesta respondida" },
                { "code": "call_rescheduled", "label": "Pide que lo llamen otro día" },
                { "code": "other", "label": "Otro" }
              ]
            },
            {
              "key": "future_scheduled_at",
              "type": "DATE",
              "label": "¿Para cuándo queda agendada?",
              "requiredWhen": {
                "question": "code",
                "operator": "IN",
                "value": ["call_rescheduled"]
              }
            },
            {
              "key": "comment",
              "type": "LONG_TEXT",
              "label": "Comentarios"
            }
          ]
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total": 1,
    "total_pages": 1,
    "has_next": false,
    "has_previous": false
  }
}

Errors

StatusDescription
400page or per_page is not valid
401Invalid, revoked or expired API key, or its owner is inactive (see Errors)
403The key does not have the activity:view permission
400 / 403 / 404The x-project-id that was sent is not valid — see Project errors

GET /api/integration/activity-forms/:formId

Returns one form as a plain object, without an envelope, in its current version. With ?version=N it returns that version instead.

Authentication: Required — permission activity:view

Required header

HeaderValue
x-api-keyYOUR_API_KEY

x-project-id is optional, as in the list.

Path parameters

ParameterTypeDescription
formIdstring (UUID)Form id: the formId of the activity

Query parameters

ParameterTypeRequiredDescription
versionnumberNoVersion to read, an integer from 1 to 2147483647. Without it, the response carries the current version

Example

curl -X GET BASE_URL/api/integration/activity-forms/3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81 \
  -H "x-api-key: YOUR_API_KEY"
const formId = "3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81";

const response = await fetch(
  `${BASE_URL}/api/integration/activity-forms/${formId}`,
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    },
  }
);

const form = await response.json();
import requests

form_id = "3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81"

response = requests.get(
    f"{BASE_URL}/api/integration/activity-forms/{form_id}",
    headers={
        "x-api-key": "YOUR_API_KEY",
    },
)

form = response.json()

Response 200 OK

{
  "id": "3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81",
  "version": 3,
  "updatedAt": "2026-11-02T14:30:00.000Z",
  "intentCategory": "SALES",
  "sections": [
    {
      "questions": [
        {
          "key": "modality",
          "type": "SINGLE_CHOICE",
          "label": "¿Cómo hiciste esta gestión?",
          "options": [
            { "code": "visit", "label": "Visita" },
            { "code": "remote", "label": "Llamado o mensaje" }
          ]
        }
      ]
    },
    {
      "label": "Contacto",
      "questions": [
        {
          "key": "contact",
          "type": "SINGLE_CHOICE",
          "label": "¿Hubo contacto con el cliente?",
          "options": [
            { "code": "yes", "label": "Sí" },
            { "code": "no", "label": "No" }
          ]
        },
        {
          "key": "topics",
          "type": "MULTIPLE_CHOICE",
          "label": "¿Qué temas se trataron?",
          "visibleWhen": {
            "question": "contact",
            "operator": "EQUALS",
            "value": "yes"
          },
          "options": [
            { "code": "price", "label": "Precio" },
            { "code": "stock", "label": "Stock" },
            { "code": "delivery", "label": "Entrega" }
          ]
        }
      ]
    },
    {
      "label": "Resultado",
      "questions": [
        {
          "key": "code",
          "type": "SINGLE_CHOICE",
          "label": "¿Cómo terminó la gestión?",
          "required": true,
          "options": [
            { "code": "success", "label": "Venta concretada" },
            {
              "code": "lacks_funds",
              "label": "Sin dinero",
              "visibleWhen": {
                "question": "contact",
                "operator": "EQUALS",
                "value": "yes"
              }
            },
            {
              "code": "call_rescheduled",
              "label": "Pide que lo llamen otro día",
              "subtitle": "Queda agendada una nueva gestión",
              "visibleWhen": {
                "question": "contact",
                "operator": "EQUALS",
                "value": "yes"
              }
            },
            {
              "code": "business_nonexistent",
              "label": "El negocio ya no existe",
              "warning": "El cliente no volverá a sugerirse.",
              "visibleWhen": {
                "question": "contact",
                "operator": "EQUALS",
                "value": "no"
              }
            },
            { "code": "other", "label": "Otro" }
          ]
        },
        {
          "key": "future_scheduled_at",
          "type": "DATE",
          "label": "¿Para cuándo queda agendada?",
          "requiredWhen": {
            "question": "code",
            "operator": "IN",
            "value": ["call_rescheduled"]
          }
        },
        {
          "key": "comment",
          "type": "LONG_TEXT",
          "label": "Comentarios"
        }
      ]
    }
  ]
}

The keys, codes and labels of this example are data of that form, not part of the format: every form defines its own.

Errors

StatusDescription
400formId is not a valid UUID, or version is not an integer from 1 to 2147483647
401Invalid, revoked or expired API key, or its owner is inactive (see Errors)
403The key does not have the activity:view permission
404The id is not a form within reach of the request (see Scope) — No existe el formulario 3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81. — code: ACTIVITY_FORM_NOT_FOUND
404The form does not have the requested version — El formulario 3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81 no tiene la versión 9. — code: ACTIVITY_FORM_VERSION_NOT_FOUND
400 / 403 / 404The x-project-id that was sent is not valid — see Project errors

Scope

A form belongs to a project or to the tenant, and both reads reach the same forms:

  • Without a project (a tenant key or a user token that does not send x-project-id): every form of the tenant, including the ones of each project.
  • With a project (a project key, or x-project-id): the forms of that project and the ones that belong to the tenant, because an activity of a project can carry the formId of a form of the tenant. The forms of other projects are out of reach: they are not listed, and their id responds 404 ACTIVITY_FORM_NOT_FOUND, the same as an id that does not exist.

Keeping forms in sync

  • There are far fewer forms than activities: many activities share a form. Caching each form by its id is recommended.
  • Every form has versions. version is an integer that grows each time the content of the form changes: its questions, options, conditions or labels. A version never changes: a change of content is a new version.
  • updatedAt changes with a new version and also with other data of the form that is not part of this response. To know whether a form changed, compare version.
  • On each synchronization, compare the version of each form with the one of your copy and replace only the ones that changed. The list and the read by id always return the complete form. Reten does not notify when a form changes.
  • A submission is validated against the version that was answered, not against the current one. Store, with each answered activity, the id and the version of the form it was answered with, and send them as formId and formVersion. If the form changes between the answer and the submission, the submission is still accepted.
  • If you need an earlier version, read it with ?version=N.

Form structure

form      { id, version, updatedAt, intentCategory, sections[] }
section   { label?, questions[] }
question  { key, type, label, required? | requiredWhen?, visibleWhen?, options? }
option    { code, label, subtitle?, warning?, visibleWhen? }

Properties are in camelCase, and the values Reten interprets (type, operator, logicalOperator), in UPPER_SNAKE. Keys and codes are in ASCII snake_case. An optional property that does not apply is absent from the response; it never comes as null.

The format carries no presentation hints: how each question is drawn is decided by whoever draws the form.

Form fields

FieldTypeDescription
idstring (UUID)Form identifier
versionnumberVersion of the sections in this response, an integer from 1
updatedAtstring (ISO 8601)Date and time the form last changed
intentCategorystringCategory of the activities that answer it: ONBOARDING, MARKETING, COLLECTION, RETENTION, NOTIFICATION, SURVEY, VALIDATION, SALES, CREDIT, OPERATIONAL or DIGITAL_ADOPTION. It is the same in every version
sectionsarraySections of the form, in order

Section fields

FieldTypeDescription
labelstringSection header. Without it, the section has no header
questionsarrayQuestions of the section, in order

A section is shown when at least one of its questions is visible.

Question fields

FieldTypeDescription
keystringUnique in the form: it is the key the question is answered with, and the one conditions refer to
typestringSee Question types
labelstringText of the question
requiredbooleanThe question is required while it is visible
requiredWhenobjectCondition that makes the question required. It never comes together with required; without either, the question is optional
visibleWhenobjectCondition that makes the question visible. Without it, the question is always visible
optionsarrayOnly on choice questions (SINGLE_CHOICE and MULTIPLE_CHOICE)

Option fields

FieldTypeDescription
codestringStable and different from the label: it is what is sent in the answers and what conditions compare. Unique within its question
labelstringText of the option
subtitlestringText under the label
warningstringNotice of the consequence of choosing the option
visibleWhenobjectCondition that makes the option visible. Without it, the option is always visible

The code question and reserved keys

Every form has a question with the key code: single choice, required and always visible. Its answer is the code of the result. other is always among its options, without a condition; the other options can be shown or hidden depending on earlier answers.

Three more keys have a fixed meaning when the form carries them:

KeyTypeWhat it is in the result
commentSHORT_TEXT or LONG_TEXTThe comment
future_scheduled_atDATEThe scheduled date
modalitySINGLE_CHOICE, with options among visit and remoteWhether the activity was handled as a visit, or as a call or message

Every other key belongs to each form. The label of each question and of each option is set by each form.

In a form of category SALES, success is always an option of code without a condition, and a submission that only answers code with success is always valid: when a sale is made, the activity can be closed with it, without the rest of the form.

Question types

typeAsks forValue of the answer
SINGLE_CHOICEOne optionThe code of the option, as a string
MULTIPLE_CHOICEOne or more optionsA list of codes, not empty and without repeats
SHORT_TEXTA one-line textA string, not empty after trimming
LONG_TEXTA multi-line textA string, not empty after trimming
NUMBERA numberA JSON number
DATEA dateA string YYYY-MM-DD
TIMEA timeA string HH:mm

A yes/no question is a SINGLE_CHOICE with two options.

Conditions

visibleWhen goes on a question or on an option, and requiredWhen on a question. Both carry a condition: a leaf or a group, told apart by their shape.

[
  { "question": "contact", "operator": "EQUALS", "value": "no" },
  { "question": "topics", "operator": "ANSWERED" },
  {
    "logicalOperator": "OR",
    "children": [
      { "question": "code", "operator": "IN", "value": ["call_rescheduled", "visit_rescheduled"] },
      { "question": "topics", "operator": "INCLUDES", "value": "delivery" }
    ]
  }
]

The first two are leaves, the second one without value; the third is a group, whose children are leaves or other groups.

operatorQuestion it refers tovalueTrue when the answer…
EQUALSSINGLE_CHOICEA codeis that code
INSINGLE_CHOICEA list of codesis one of the list
NOT_INSINGLE_CHOICEA list of codesexists and is none of the list
INCLUDESMULTIPLE_CHOICEA codecontains that code
ANSWEREDAny typeNo valueexists
  • logicalOperator is AND (every one of the children is true) or OR (at least one is).
  • NOT_IN writes "everything except these options". Without an answer it is false, like every comparison.
  • ANSWERED does not compare a value: it is true if the question has an answer, and false if not.
  • Text, number, date and time are not compared by their value: they only admit ANSWERED.

How conditions are evaluated

Whoever draws the form and Reten follow the same rules:

  1. Backwards only. A condition refers to a question that comes earlier in the order of the document, across sections, and to codes that question offers. One pass in order is enough.
  2. In cascade. A hidden question counts as unanswered, even if an answer is sent for it, and a hidden option that is chosen counts as not chosen.
  3. Without an answer, every comparison on that question is false, NOT_IN included. ANSWERED is true if the answer exists, and false if not.
  4. Required only if visible. required and requiredWhen are enforced only on visible questions. A required MULTIPLE_CHOICE asks for at least one visible option chosen.

In the example above, with contact answered no, topics is hidden, and code only offers success, business_nonexistent and other.

Rules validated only by Reten

A question can have value rules that are not part of this response: Reten validates them when it receives the submission. Today there is one: a DATE that must be at least "today" plus a number of days.

  • "Today" is the calendar day of occurredAt — when the activity was handled — in the tenant's time zone. A date that was valid when answering is still valid when submitting, even if the submission arrives later.
  • A violation is an OUT_OF_RANGE error in the 422 of the submission.