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
| Header | Value |
|---|---|
x-api-key | YOUR_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
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (default: 1) |
per_page | number | No | Items 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
| Status | Description |
|---|---|
400 | page or per_page is not valid |
401 | Invalid, revoked or expired API key, or its owner is inactive (see Errors) |
403 | The key does not have the activity:view permission |
400 / 403 / 404 | The 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
| Header | Value |
|---|---|
x-api-key | YOUR_API_KEY |
x-project-id is optional, as in the list.
Path parameters
| Parameter | Type | Description |
|---|---|---|
formId | string (UUID) | Form id: the formId of the activity |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
version | number | No | Version 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
| Status | Description |
|---|---|
400 | formId is not a valid UUID, or version is not an integer from 1 to 2147483647 |
401 | Invalid, revoked or expired API key, or its owner is inactive (see Errors) |
403 | The key does not have the activity:view permission |
404 | The 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 |
404 | The 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 / 404 | The 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 theformIdof a form of the tenant. The forms of other projects are out of reach: they are not listed, and their id responds404ACTIVITY_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
idis recommended. - Every form has versions.
versionis 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. updatedAtchanges 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, compareversion.- On each synchronization, compare the
versionof 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
idand theversionof the form it was answered with, and send them asformIdandformVersion. 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
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Form identifier |
version | number | Version of the sections in this response, an integer from 1 |
updatedAt | string (ISO 8601) | Date and time the form last changed |
intentCategory | string | Category 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 |
sections | array | Sections of the form, in order |
Section fields
| Field | Type | Description |
|---|---|---|
label | string | Section header. Without it, the section has no header |
questions | array | Questions of the section, in order |
A section is shown when at least one of its questions is visible.
Question fields
| Field | Type | Description |
|---|---|---|
key | string | Unique in the form: it is the key the question is answered with, and the one conditions refer to |
type | string | See Question types |
label | string | Text of the question |
required | boolean | The question is required while it is visible |
requiredWhen | object | Condition that makes the question required. It never comes together with required; without either, the question is optional |
visibleWhen | object | Condition that makes the question visible. Without it, the question is always visible |
options | array | Only on choice questions (SINGLE_CHOICE and MULTIPLE_CHOICE) |
Option fields
| Field | Type | Description |
|---|---|---|
code | string | Stable and different from the label: it is what is sent in the answers and what conditions compare. Unique within its question |
label | string | Text of the option |
subtitle | string | Text under the label |
warning | string | Notice of the consequence of choosing the option |
visibleWhen | object | Condition 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:
| Key | Type | What it is in the result |
|---|---|---|
comment | SHORT_TEXT or LONG_TEXT | The comment |
future_scheduled_at | DATE | The scheduled date |
modality | SINGLE_CHOICE, with options among visit and remote | Whether 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
type | Asks for | Value of the answer |
|---|---|---|
SINGLE_CHOICE | One option | The code of the option, as a string |
MULTIPLE_CHOICE | One or more options | A list of codes, not empty and without repeats |
SHORT_TEXT | A one-line text | A string, not empty after trimming |
LONG_TEXT | A multi-line text | A string, not empty after trimming |
NUMBER | A number | A JSON number |
DATE | A date | A string YYYY-MM-DD |
TIME | A time | A 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.
operator | Question it refers to | value | True when the answer… |
|---|---|---|---|
EQUALS | SINGLE_CHOICE | A code | is that code |
IN | SINGLE_CHOICE | A list of codes | is one of the list |
NOT_IN | SINGLE_CHOICE | A list of codes | exists and is none of the list |
INCLUDES | MULTIPLE_CHOICE | A code | contains that code |
ANSWERED | Any type | No value | exists |
logicalOperatorisAND(every one of thechildrenis true) orOR(at least one is).NOT_INwrites "everything except these options". Without an answer it is false, like every comparison.ANSWEREDdoes 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:
- 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.
- 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.
- Without an answer, every comparison on that question is false,
NOT_INincluded.ANSWEREDis true if the answer exists, and false if not. - Required only if visible.
requiredandrequiredWhenare enforced only on visible questions. A requiredMULTIPLE_CHOICEasks 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_RANGEerror in the422of the submission.