SalesLeads

Leads

Sales · 6 operations

GET

List leads

/api/lead

Leads (sales deals) with filters: pipeline, current stage (stageIds) or its kind (stageTypes: INCOMING, REGULAR, CLOSED_WON, CLOSED_LOST), source, managers or hasNoManager, created range, a move into a stage within a range (stageEnteredStart/End: "won this month" is stageTypes=CLOSED_WON with that range), stuck leads (stageUnchangedSince), refusal reasons, linked student. Paginated; "total" is the full count.

list_leads

Query parameters · 48

pagenumbermin 1 · default 1
pageSizenumber1–250 · default 20
stageTypesstring[]Kind of the current stage: CLOSED_WON for won deals, CLOSED_LOST for lost ones, INCOMING and REGULAR for open ones.One of: REGULAR INCOMING CLOSED_WON CLOSED_LOST
sortBystringOne of: lead pipeline stage sourceOfLead createdAt
sortOrderstringOne of: ASC DESC
leadIdsnumber[]—
pipelineIdnumberrequired—
searchstringrequired—
Show 40 more
nameOfLeadstringrequiredlength max 150
studentIdnumberrequired—
reasonForRefusalIdnumberrequired—
reasonForRefusalIdsnumber[]—
managerIdsnumber[]—
hasNoManagerbooleanOnly leads nobody is responsible for.
stageIdsnumber[]Current stage.
sourceOfLeadIdsnumber[]—
createdStartstringCreated from, a school-local calendar day.
createdEndstringCreated until, inclusive: the end of that school-local day.
stageEnteredStartstringMoved into a stage from this school-local day; with stageIds or stageTypes, into one of those stages. "Won this month" is stageTypes=CLOSED_WON with this range.
stageEnteredEndstringMoved into a stage until this school-local day, inclusive.
stageUnchangedSincestringNot moved between stages since this school-local day: leads stuck in their current stage.
notestringrequired—
studentStatusOfStudentIdnumberrequired—
studentFirstNamestringrequired—
studentLastNamestringrequired—
studentMiddleNamestringrequired—
studentIsChildstringrequired—
studentGenderstringrequiredOne of: MALE FEMALE
studentTeacherIdsnumber[]—
studentManagerIdsnumber[]—
studentReasonForRefusalIdsnumber[]—
studentTeachingProgramIdsnumber[]—
studentClassOfStudentIdsnumber[]—
studentSubscriptionIdsnumber[]—
studentBalanceFromnumber—
studentBalanceTonumber—
studentLessonsLeftFromnumber—
studentLessonsLeftTonumber—
studentNotestringrequired—
studentHasGroupbooleanrequired—
studentHasNoGroupbooleanrequired—
studentHasNoLessonsbooleanrequired—
studentIsDebtorbooleanrequired—
studentHasFreeLessonsbooleanrequired—
studentHasFreeTrialLessonsbooleanrequired—
studentHasExpiredSubscriptionbooleanrequired—
studentIsArchivalboolean—
cfstring[]—

Response · 200

application/json

statusCodenumberrequiredexample 200
messagestringrequired—
dataobject4 fields
totalnumberrequired—
totalPagesnumberrequired—
currentPagenumberrequired—
leadsobject[]required13 fields
costOfLeadnumberrequirednullable—
leadIdnumberrequired—
pipelineIdnumberrequirednullable—
stageIdnumberrequirednullable—
nameOfLeadstringrequired—
contactsobject[]required3 fields
typestringrequired—
valuestringrequired—
labelstringrequirednullable—
notestringrequirednullable—
avatarUrlstringrequirednullable—
boughtWithoutTrialbooleanrequired—
archivedAtstringrequirednullableformat YYYY-MM-DDTHH:mm:ss
updatedAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
createdAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
customFieldsobjectany keys
Errors400401403429500
curl "https://your-school.rist.pro/api/lead" \
  -H "Authorization: Bearer $RIST_API_KEY"
Response example · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {
    "total": 0,
    "totalPages": 0,
    "currentPage": 0,
    "leads": [
      {
        "costOfLead": 0,
        "leadId": 1,
        "pipelineId": 1,
        "stageId": 1,
        "nameOfLead": "string",
        "contacts": [
          {
            "type": "string",
            "value": "string",
            "label": "string"
          }
        ],
        "note": "string",
        "avatarUrl": "string",
        "boughtWithoutTrial": false,
        "archivedAt": "2026-11-09T14:30:00",
        "updatedAt": "2026-11-09T14:30:00",
        "createdAt": "2026-11-09T14:30:00",
        "customFields": {}
      }
    ]
  }
}

How many leads match the GET /api/lead filters, per stage (funnel order), pipeline, source, manager or refusal reason (groupBy). Lost leads by reason: groupBy=reasonForRefusal, stageTypes=CLOSED_LOST with a stageEntered range. One call instead of paging through GET /api/lead.

count_leads

Query parameters · 45

stageTypesstring[]Kind of the current stage: CLOSED_WON for won deals, CLOSED_LOST for lost ones, INCOMING and REGULAR for open ones.One of: REGULAR INCOMING CLOSED_WON CLOSED_LOST
cfstring[]—
leadIdsnumber[]—
pipelineIdnumberrequired—
searchstringrequired—
nameOfLeadstringrequiredlength max 150
studentIdnumberrequired—
reasonForRefusalIdnumberrequired—
Show 37 more
reasonForRefusalIdsnumber[]—
managerIdsnumber[]—
hasNoManagerbooleanOnly leads nobody is responsible for.
stageIdsnumber[]Current stage.
sourceOfLeadIdsnumber[]—
createdStartstringCreated from, a school-local calendar day.
createdEndstringCreated until, inclusive: the end of that school-local day.
stageEnteredStartstringMoved into a stage from this school-local day; with stageIds or stageTypes, into one of those stages. "Won this month" is stageTypes=CLOSED_WON with this range.
stageEnteredEndstringMoved into a stage until this school-local day, inclusive.
stageUnchangedSincestringNot moved between stages since this school-local day: leads stuck in their current stage.
notestringrequired—
studentStatusOfStudentIdnumberrequired—
studentFirstNamestringrequired—
studentLastNamestringrequired—
studentMiddleNamestringrequired—
studentIsChildstringrequired—
studentGenderstringrequiredOne of: MALE FEMALE
studentTeacherIdsnumber[]—
studentManagerIdsnumber[]—
studentReasonForRefusalIdsnumber[]—
studentTeachingProgramIdsnumber[]—
studentClassOfStudentIdsnumber[]—
studentSubscriptionIdsnumber[]—
studentBalanceFromnumber—
studentBalanceTonumber—
studentLessonsLeftFromnumber—
studentLessonsLeftTonumber—
studentNotestringrequired—
studentHasGroupbooleanrequired—
studentHasNoGroupbooleanrequired—
studentHasNoLessonsbooleanrequired—
studentIsDebtorbooleanrequired—
studentHasFreeLessonsbooleanrequired—
studentHasFreeTrialLessonsbooleanrequired—
studentHasExpiredSubscriptionbooleanrequired—
studentIsArchivalboolean—
groupBystringrequiredWhat to count leads by; stage keeps the funnel order.One of: stage pipeline source manager reasonForRefusal

Response · 200

application/json

statusCodenumberrequiredexample 200
messagestringrequired—
dataobject3 fields
omittedRowsnumberRows left out by the limit
totalnumberrequiredRecords matching the filters; a record counted in several rows (a student with two teachers) counts here once.
rowsobject[]required3 fields
idinteger | stringrequirednullableId of the grouped value (teacher id, stage id, weekday 1-7) or its code (lesson status); null means "no value".
namestringrequired—
countnumberrequired—
Errors400401403429500
curl "https://your-school.rist.pro/api/lead/breakdown" \
  -H "Authorization: Bearer $RIST_API_KEY"
Response example · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {
    "omittedRows": 0,
    "total": 0,
    "rows": [
      {
        "id": 1,
        "name": "string",
        "count": 0
      }
    ]
  }
}
GET

Get lead

/api/lead/{id}

One lead with its pipeline stage, manager, contacts and custom fields.

get_lead

Path parameters · 1

idnumberrequired—

Response · 200

application/json

statusCodenumberrequiredexample 200
messagestringrequired—
dataobject13 fields
costOfLeadnumberrequirednullable—
leadIdnumberrequired—
pipelineIdnumberrequirednullable—
stageIdnumberrequirednullable—
nameOfLeadstringrequired—
contactsobject[]required3 fields
typestringrequired—
valuestringrequired—
labelstringrequirednullable—
notestringrequirednullable—
avatarUrlstringrequirednullable—
boughtWithoutTrialbooleanrequired—
archivedAtstringrequirednullableformat YYYY-MM-DDTHH:mm:ss
updatedAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
createdAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
customFieldsobjectany keys
Errors400401403429500
curl "https://your-school.rist.pro/api/lead/1" \
  -H "Authorization: Bearer $RIST_API_KEY"
Response example · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {
    "costOfLead": 0,
    "leadId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "string",
        "value": "string",
        "label": "string"
      }
    ],
    "note": "string",
    "avatarUrl": "string",
    "boughtWithoutTrial": false,
    "archivedAt": "2026-11-09T14:30:00",
    "updatedAt": "2026-11-09T14:30:00",
    "createdAt": "2026-11-09T14:30:00",
    "customFields": {}
  }
}
POST

Create lead

/api/lead

Create a lead in a pipeline stage. A manager is assigned automatically if the stage distributes leads.

create_lead

Request body

application/json · object

studentIdnumbernullablemin 1
sourceOfLeadIdnumberrequirednullablemin 1
reasonForRefusalIdnumbernullablemin 1
managerIdnumberrequirednullablemin 1
pipelineIdnumberrequiredmin 1
stageIdnumbernullablemin 1
nameOfLeadstringrequiredlength 1–150
contactsobject[]required3 fields
typestringrequiredOne of: PHONE EMAIL MESSENGER URL
valuestringrequiredlength 1–255
labelstringrequirednullablelength max 50
avatarUrlstringrequirednullablelength max 500
notestringrequirednullablelength max 1500
costOfLeadnumbernullablemin 0
labelsOfStatisticobject[]required2 fields
labelOfStatisticIdnumberrequiredmin 1
valuestringrequiredlength max 70
tagIdsnumber[]requirednullablemin 1
customFieldsobjectany keys

Response · 201

application/json

statusCodenumberrequiredexample 201
messagestringrequired—
dataobject13 fields
costOfLeadnumberrequirednullable—
leadIdnumberrequired—
pipelineIdnumberrequirednullable—
stageIdnumberrequirednullable—
nameOfLeadstringrequired—
contactsobject[]required3 fields
typestringrequired—
valuestringrequired—
labelstringrequirednullable—
notestringrequirednullable—
avatarUrlstringrequirednullable—
boughtWithoutTrialbooleanrequired—
archivedAtstringrequirednullableformat YYYY-MM-DDTHH:mm:ss
updatedAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
createdAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
customFieldsobjectany keys
Errors400401403429500
curl -X POST "https://your-school.rist.pro/api/lead" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "studentId": 1,
    "sourceOfLeadId": 1,
    "reasonForRefusalId": 1,
    "managerId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "PHONE",
        "value": "string",
        "label": "string"
      }
    ],
    "avatarUrl": "string",
    "note": "string",
    "costOfLead": 0,
    "labelsOfStatistic": [
      {
        "labelOfStatisticId": 1,
        "value": "string"
      }
    ],
    "tagIds": [
      1
    ],
    "customFields": {}
  }'
Response example · 201
{
  "statusCode": 201,
  "message": "Operation completed successfully",
  "data": {
    "costOfLead": 0,
    "leadId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "string",
        "value": "string",
        "label": "string"
      }
    ],
    "note": "string",
    "avatarUrl": "string",
    "boughtWithoutTrial": false,
    "archivedAt": "2026-11-09T14:30:00",
    "updatedAt": "2026-11-09T14:30:00",
    "createdAt": "2026-11-09T14:30:00",
    "customFields": {}
  }
}
PATCH

Update lead

/api/lead/{id}

Change fields of a lead. Send only the fields to change. To move between stages use PATCH /api/lead/stage/{id}.

update_lead

Path parameters · 1

idnumberrequired—

Request body

application/json · object

sourceOfLeadIdnumbernullablemin 1
reasonForRefusalIdnumbernullablemin 1
managerIdnumbernullablemin 1
pipelineIdnumbermin 1
stageIdnumbermin 1
nameOfLeadstringlength 1–150
contactsobject[]3 fields
typestringrequiredOne of: PHONE EMAIL MESSENGER URL
valuestringrequiredlength 1–255
labelstringrequirednullablelength max 50
avatarUrlstringnullablelength max 500
notestringnullablelength max 1500
costOfLeadnumbernullablemin 0
boughtWithoutTrialboolean—
labelsOfStatisticobject[]2 fields
labelOfStatisticIdnumberrequiredmin 1
valuestringrequiredlength max 70
tagIdsnumber[]nullablemin 1
customFieldsobjectany keys

Response · 200

application/json

statusCodenumberrequiredexample 200
messagestringrequired—
dataobject13 fields
costOfLeadnumberrequirednullable—
leadIdnumberrequired—
pipelineIdnumberrequirednullable—
stageIdnumberrequirednullable—
nameOfLeadstringrequired—
contactsobject[]required3 fields
typestringrequired—
valuestringrequired—
labelstringrequirednullable—
notestringrequirednullable—
avatarUrlstringrequirednullable—
boughtWithoutTrialbooleanrequired—
archivedAtstringrequirednullableformat YYYY-MM-DDTHH:mm:ss
updatedAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
createdAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
customFieldsobjectany keys
Errors400401403429500
curl -X PATCH "https://your-school.rist.pro/api/lead/1" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceOfLeadId": 1,
    "reasonForRefusalId": 1,
    "managerId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "PHONE",
        "value": "string",
        "label": "string"
      }
    ],
    "avatarUrl": "string",
    "note": "string",
    "costOfLead": 0,
    "boughtWithoutTrial": false,
    "labelsOfStatistic": [
      {
        "labelOfStatisticId": 1,
        "value": "string"
      }
    ],
    "tagIds": [
      1
    ],
    "customFields": {}
  }'
Response example · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {
    "costOfLead": 0,
    "leadId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "string",
        "value": "string",
        "label": "string"
      }
    ],
    "note": "string",
    "avatarUrl": "string",
    "boughtWithoutTrial": false,
    "archivedAt": "2026-11-09T14:30:00",
    "updatedAt": "2026-11-09T14:30:00",
    "createdAt": "2026-11-09T14:30:00",
    "customFields": {}
  }
}
PATCH

Move lead to stage

/api/lead/stage/{id}

Move a lead to another pipeline stage. Moving to a refusal stage may require a refusal reason.

move_lead_stage

Path parameters · 1

idnumberrequired—

Request body

application/json · object

stageIdnumberrequiredmin 1
reasonForRefusalIdnumbernullablemin 1

Response · 200

application/json

statusCodenumberrequiredexample 200
messagestringrequired—
dataobject13 fields
costOfLeadnumberrequirednullable—
leadIdnumberrequired—
pipelineIdnumberrequirednullable—
stageIdnumberrequirednullable—
nameOfLeadstringrequired—
contactsobject[]required3 fields
typestringrequired—
valuestringrequired—
labelstringrequirednullable—
notestringrequirednullable—
avatarUrlstringrequirednullable—
boughtWithoutTrialbooleanrequired—
archivedAtstringrequirednullableformat YYYY-MM-DDTHH:mm:ss
updatedAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
createdAtstringrequiredformat YYYY-MM-DDTHH:mm:ss
customFieldsobjectany keys
Errors400401403429500
curl -X PATCH "https://your-school.rist.pro/api/lead/stage/1" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stageId": 1,
    "reasonForRefusalId": 1
  }'
Response example · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {
    "costOfLead": 0,
    "leadId": 1,
    "pipelineId": 1,
    "stageId": 1,
    "nameOfLead": "string",
    "contacts": [
      {
        "type": "string",
        "value": "string",
        "label": "string"
      }
    ],
    "note": "string",
    "avatarUrl": "string",
    "boughtWithoutTrial": false,
    "archivedAt": "2026-11-09T14:30:00",
    "updatedAt": "2026-11-09T14:30:00",
    "createdAt": "2026-11-09T14:30:00",
    "customFields": {}
  }
}