Skip to main content
The RCM (Relationship and Collections Management) endpoints let you initiate structured outreach campaigns for documents whose loan status is "BEHIND", and record opt-out events for compliance purposes. Every action you take through these endpoints is written to an immutable compliance log and emitted as an activity feed event.
RCM campaigns can only be started on documents that have an attached loan with a status of "BEHIND". If the loan is "CURRENT" or no loan exists, the API returns 400.

Start an RCM campaign

POST /v1/documents/:id/rcm
Creates a new outreach campaign for the specified document. You choose which communication channels to activate and provide guidance on tone and cadence. The campaign is recorded in the compliance log with an event type of campaign_started.

Request headers

Authorization
string
required
Bearer token obtained from your Clerk session. Example: Bearer eyJhbGc...
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The unique identifier of the document for which to start a campaign. The document must be owned by your account and must have a loan with status "BEHIND".

Request body

At least one of sms, email, or call must be true. The API returns 400 if all three are false.
sms
boolean
required
Set to true to include SMS as an outreach channel.
email
boolean
required
Set to true to include email as an outreach channel.
call
boolean
required
Set to true to include phone calls as an outreach channel.
tone
string
required
Guidance on the communication tone, for example "professional and empathetic" or "firm but respectful". Maximum 80 characters.
cadence
string
required
Guidance on the outreach schedule, for example "once per week" or "day 1, day 5, day 14". Maximum 80 characters.
notes
string
Optional free-form notes for the campaign, for example relevant account context or escalation instructions. Maximum 2000 characters. Leading and trailing whitespace is trimmed before storage.

Response

Returns 201 Created with the newly created campaign record.
campaign
object
required
The created RCM campaign.

Example

curl --request POST \
  --url https://your-api.example.com/v1/documents/doc_01j9z8x7w6v5u4t3s2r1q0p/rcm \
  --header 'Authorization: Bearer <your-session-token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "sms": true,
    "email": true,
    "call": false,
    "tone": "professional and empathetic",
    "cadence": "day 1, day 5, day 14",
    "notes": "Borrower previously responded well to SMS outreach."
  }'

Record an opt-out

POST /v1/documents/:id/rcm/opt-out
Records an opt-out event for an active campaign. Opt-outs are written to the compliance log with an event type of opt_out and emitted to your activity feed. If you set channel to "all", the campaign is deactivated (its active flag is set to false).
Compliance events logged by this endpoint are permanent and cannot be deleted. Always record opt-outs accurately — they form part of your regulatory audit trail.

Request headers

Authorization
string
required
Bearer token obtained from your Clerk session.
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The unique identifier of the document whose campaign is being opted out of.

Request body

campaignId
string
required
The unique identifier of the RCM campaign to opt out of. The campaign must belong to the document specified in the path and must be owned by your account.
channel
string
required
The channel being opted out. One of "sms", "email", "call", or "all". Passing "all" deactivates the entire campaign by setting its active flag to false.
notes
string
Optional notes describing the opt-out circumstances, for example "Borrower requested no further contact by SMS". Maximum 2000 characters. Leading and trailing whitespace is trimmed before storage.

Response

Returns 200 OK confirming the opt-out was recorded.
ok
boolean
required
Always true on a successful opt-out.

Example

curl --request POST \
  --url https://your-api.example.com/v1/documents/doc_01j9z8x7w6v5u4t3s2r1q0p/rcm/opt-out \
  --header 'Authorization: Bearer <your-session-token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "campaignId": "rcm_01k0b2z9y8x7w6v5u4t3s2r",
    "channel": "sms",
    "notes": "Borrower requested removal from SMS list on 2026-04-27."
  }'

Error cases

Start campaign errors

StatusError messageCause
400Invalid body.A required field is missing or a field value exceeds its character limit.
400At least one channel must be true.sms, email, and call are all false.
400RCM only when a loan exists and status is BEHIND.The document has no loan, or its loan status is "CURRENT".
401Missing Authorization Bearer token.No Authorization header was sent.
401Invalid or expired token.The Bearer token is malformed or has expired.
404Not found.No document with the given id exists, or it belongs to a different account.

Opt-out errors

StatusError messageCause
400Invalid body.A required field is missing or a field value exceeds its character limit.
401Missing Authorization Bearer token.No Authorization header was sent.
401Invalid or expired token.The Bearer token is malformed or has expired.
404Campaign not found or access denied.The campaignId does not exist, does not belong to the specified document, or belongs to a different account.