API Docs

Global settings

Get customers by team

Returns all MPower customers from a selected team

POST/https://api-get-customers-by-team-kigtdz23uq-ew.a.run.app

Headers

Content-Type
application/json
string
x-api-key
<API_KEY>
string

Body Parameters

team_id
Required, not empty.
RQVoPLHcQRAC7c4vCOIu
string

cURL

curl -i \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: <API_KEY>" \
  -d '{
    "team_id": "RQVoPLHcQRAC7c4vCOIu"
  }' \
  https://api-get-customers-by-team-kigtdz23uq-ew.a.run.app

Response

200 Success

{
  "count": 1,
  "customers": {
    "customerDocumentId": {
      "name": "Customer name",
      "surname": "Customer surname",
      "type": 1
    }
  }
}

200 Success - No customers found

{
  "count": 0,
  "customers": {}
}

400 Validation error

{
  "success": false,
  "message": "Invalid payload",
  "errors": [
    {
      "path": "team_id",
      "message": "String must contain at least 1 character(s)"
    }
  ]
}

401 Unauthorized

{
  "error": "Unauthorized"
}

405 Method not allowed

{
  "error": "Method not allowed"
}

500 API key is not configured

{
  "error": "API key is not configured"
}

Behavior / Side effects

Read-only endpoint

  • Reads documents from the customers collection.
  • Does not write, update, or delete Firestore documents.

Request behavior

  • Requires a JSON body with team_id.
  • Does not support additional filters, sorting, or pagination.
  • Returns all customers for the selected team in a single response.

Response shape

  • Returns a top-level customers object.
  • Returns a top-level count number.
  • Each key inside customers is the Firestore customer document ID.
  • Each customer includes only name, surname, and type.
  • count matches the number of keys inside customers.

Field mapping

  • name is read from customers/{customer_id}.name.
  • surname is read from customers/{customer_id}.surname.
  • type is read from customers/{customer_id}.type.

Data quality expectations

  • name, surname, and type are expected to exist for every customer.
  • The API has a defensive fallback and may return null only if the underlying Firestore document is incomplete or malformed.