Skip to main content

GET /mpan/v1/{mpid}/portfolio-mpans

Returns gained MPANs, Change of Supplier processes or distinct MPANs with Change of Agent started in the period.

Request​

Method and path:

  • GET /mpan/v1/{mpid}/portfolio-mpans

Headers:

  • X-API-KEY or Authorization: Bearer <token> (one required). API key takes precedence when both are supplied.

Path parameters:

  • mpid (required): string supplier MPID authorized for the authenticated tenant.

Query parameters:

  • kind (required): newly-gained, change-of-supplier or change-of-agent.
  • from_date and to_date (required): inclusive UTC dates, maximum 3660 days. to_date must be on or after from_date and before 9999-12-31.
  • q (optional): string, maximum 200 characters, default empty string. Literal MPAN substring search; outer whitespace is trimmed. % and _ are literal characters.
  • limit (optional): integer, minimum 1, maximum 200, default 25.
  • offset (optional): integer, minimum 0, default 0.

Request body:

  • None.

Response​

Success:

  • 200 OK
{
"data": [
{
"mpan_core": 1234567890123,
"postcode": null,
"supply_start_date": null,
"process_id": "00000000-0000-4000-8000-000000000001",
"started_at": "2026-10-18T08:30:00Z",
"appointment_type": "data-service-appointment",
"oldest_pending_since": null,
"pending_appointments": []
}
],
"total_count": 1,
"limit": 25,
"offset": 0,
"has_more": false
}

Notes:

  • Gains and Change of Agent return one row per MPAN; Change of Supplier returns one row per started process. Search and date filters apply before counting and pagination.
  • Gains use portfolio summary qualification and the latest qualifying supply start per MPAN in the range.
  • Changes use process_started_timestamp, regardless of current status. Change of Agent uses portfolio summary qualification and selects the latest qualifying process per MPAN within the period, with ties ordered by process ID descending. appointment_type identifies the selected appointment; other kinds return null.
  • Gains sort by supply start descending, then MPAN ascending. Changes sort by start timestamp descending, then process ID descending.
  • oldest_pending_since and pending_appointments retain defaults of null and [] for all kinds.
  • Empty and out-of-range pages return 200 OK with data: [].

Other documented responses:

  • 400 Bad Request for invalid date ranges.
  • 401/403 for authentication or supplier-access failures.
  • 422 Unprocessable Entity for missing or malformed dates, invalid kind, q longer than 200 characters, limit outside 1–200, or negative offset.

Field-level constraints: