REST /api/v1/referral-code-records 7 endpoints
GET /api/v1/referral-code-records/api/v1/referral-code-records

List all referral code records

Public

Response Example

{
  "data": [
    {
      "id": "rc_8f3a21bc",
      "mentor_id": "usr_4491",
      "org_id": "org_002",
      "code": "JAN-VERV-8F3A",
      "status": "active",
      "created_at": "2026-01-10T09:00:00Z",
      "deactivated_at": null
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 47
  }
}
GET /api/v1/referral-code-records/api/v1/referral-code-records/:id

Get a referral code record by ID

Public

Response Example

{
  "id": "rc_8f3a21bc",
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A",
  "status": "active",
  "created_at": "2026-01-10T09:00:00Z",
  "deactivated_at": null
}
POST /api/v1/referral-code-records/api/v1/referral-code-records

Create a new referral code record (createCode)

Public

Request Example

{
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A"
}

Response Example

{
  "id": "rc_8f3a21bc",
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A",
  "status": "active",
  "created_at": "2026-03-26T12:00:00Z",
  "deactivated_at": null
}
PUT /api/v1/referral-code-records/api/v1/referral-code-records/:id

Update a referral code record (deactivateCode)

Public

Request Example

{
  "status": "inactive",
  "deactivated_at": "2026-03-26T12:00:00Z"
}

Response Example

{
  "id": "rc_8f3a21bc",
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A",
  "status": "inactive",
  "created_at": "2026-01-10T09:00:00Z",
  "deactivated_at": "2026-03-26T12:00:00Z"
}
DELETE /api/v1/referral-code-records/api/v1/referral-code-records/:id

Delete a referral code record

Public

Response Example

{
  "id": "rc_8f3a21bc",
  "deleted": true,
  "deleted_at": "2026-03-26T12:10:00Z"
}
GET /api/v1/referral-code-records/api/v1/referral-code-records/active

Get the active code for a mentor+org pair (getActiveCode)

Public

Response Example

{
  "id": "rc_8f3a21bc",
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A",
  "status": "active",
  "created_at": "2026-01-10T09:00:00Z",
  "deactivated_at": null
}
GET /api/v1/referral-code-records/api/v1/referral-code-records/lookup

Find a record by code string (findByCode)

Public

Response Example

{
  "id": "rc_8f3a21bc",
  "mentor_id": "usr_4491",
  "org_id": "org_002",
  "code": "JAN-VERV-8F3A",
  "status": "active",
  "created_at": "2026-01-10T09:00:00Z",
  "deactivated_at": null
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}