CRM V4

Contract cohort

GET
/v1/crm-v4/retention/cohort

CRM V4 contracts still active by cohort: each CNPJ is dated by its first month of recurring revenue, ever; the cohorts are the months from the one of startDate to the one before endDate, and a CNPJ is active in a month while it bills recurring revenue in it. Months after the one of endDate are cut, since the recurring revenue is projected over the contract and they would be a forecast. Reads intermediate.int_crm_v4_recurring_revenue_monthly. Aggregates only, no CNPJ in the response. An organization without CRM V4 contracts answers 200 with no cohort. Both dates are required; the period spans at most 366 days. Cached for 30 minutes.

Authorization

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Query Parameters

organizationId*string

Organization identifier (UUID, required)

Formatuuid
startDate*string

First day of the period, inclusive (YYYY-MM-DD, UTC). Required.

Formatdate
endDate*string

Last day of the period, inclusive (YYYY-MM-DD, UTC). Required. At most 366 days from startDate.

Formatdate

Response Body

Successful response

application/json
  1. response
period*
totalCustomers*integer

Sum of the cohorts' sizes.

cohorts*array<>

One item per cohort month, from the month of startDate to the one before endDate, ascending.

curl -X GET "https://example.com/v1/crm-v4/retention/cohort?organizationId=11111111-1111-4111-8111-111111111111&startDate=2026-10-01&endDate=2026-10-02"
{  "period": {    "startDate": "2026-08-01",    "endDate": "2026-10-31"  },  "totalCustomers": 10,  "cohorts": [    {      "cohortMonth": "2026-08",      "customers": 6,      "months": [        {          "offset": 1,          "customers": 6,          "pct": 100        },        {          "offset": 2,          "customers": 5,          "pct": 83.33        }      ]    },    {      "cohortMonth": "2026-09",      "customers": 4,      "months": [        {          "offset": 1,          "customers": 4,          "pct": 100        }      ]    }  ]}