Retrieve a list of members

GET /api/search/members-basic/{searchText}

Success: 200 OK

Overview

Finds members by id, by name, or by the company they work for, and returns enough of each to populate a picker: name, site, contact details, price level and account status.

How the search behaves depends entirely on what searchText looks like:

Matching is partial and case-insensitive; there is no scoring or fuzzy matching, so a misspelling returns nothing.

Results are capped at 100 and there is no paging. The cap is applied after sorting by surname then forename, so a broad search silently returns the first hundred alphabetically with no indication that more exist. Narrow the search rather than trying to page it.

By default only members who have an invoicing account are returned — set accountRequired=false to see the rest. No match returns 200 with an empty array.

Endpoint

GET {base_url}/api/search/members-basic/{searchText}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
searchTextstringYesWhat to search for: a member id, a surname, a Surname,Forename pair, or part of a company name. Trimmed before use, maximum 255 characters — longer fails with 400 and Search Text cannot be more than 255 characters. A value that parses as an integer is treated as a member id, and must be greater than zero or the call fails with MemberId must be a valid integer greater than 0. More than one comma fails with When searching by name, please provide either a Last Name, or a Last Name and First Name separated by a comma, and a leading comma with When searching by name, Last Name cannot be empty. The value is used as a SQL LIKE pattern without escaping, so % and _ inside it behave as wildcards.

Query parameters

NameTypeRequiredDescription
accountRequiredbooleanNoWhether to return only members who have an invoicing account. Defaults to true, so by default members without one are invisible to this search — which is the usual explanation for a member you can see elsewhere not appearing here. Set it to false to search all members. It filters, it does not sort, and it does not change any field in the response.

Sample request

cURL
curl -X GET '{base_url}/api/search/members-basic/{searchText}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
[].idinteger (int32)The member's identifier — the value other member endpoints take as memberId, and the value this endpoint matches on when searchText is numeric.
[].siteIdstringThe site the member belongs to, as a site code rather than a name. Results are not filtered by site, so a search across a multi-site tenant returns members from all of them.
[].firstNamestringThe member's forenames — the whole field, which may contain more than one name. This is what the part after the comma in searchText is matched against. Results are sorted by lastName then this.
[].lastNamestringThe member's surname, and the primary sort key. This is what a single-term searchText is matched against, alongside company.
[].telephoneNumberstringThe member's preferred contact number, chosen for you from the numbers held against them according to which one they nominated as their main one — work, mobile, or home as the fallback. It duplicates one of the stored numbers rather than being a separate field, and it is null when that particular number is blank.
[].homeEmailstringThe member's personal email address. Not searched by this endpoint, and not guaranteed unique or present.
[].workEmailstringThe member's work email address, held separately from homeEmail. Often null for consumer members.
[].priceLevelstringThe member's price level as its code, not its description — the band that determines what they are charged, such as an adult or concession rate. Resolve the code against your price level configuration if you need a label to display.
[].statusobjectThe member's account status, with the colours the back office uses to display it. Always present, because the search joins to the status record — a member with no valid status does not appear in results at all.
[].status.idstringThe status code, for example the value your integration should branch on. Stable across tenants' renaming of the description.
[].status.namestringThe status's description as configured in the back office — free text, so do not compare against it; use status.id.
[].status.textColourstringThe foreground colour the back office shows this status in, converted from the back office's legacy colour format to a #RRGGBB hex string. An empty string rather than null when no colour is configured.
[].status.backgroundColourstringThe background colour for the status, in the same #RRGGBB form and likewise an empty string when unset. Pair it with textColour if you are mirroring the back office's colour coding; there is no guarantee the two contrast.
[].status.bookablebooleanFalse when the member's status is configured as restricted from creating bookings; true otherwise.
[].companystringThe member's employer as recorded against them. This is the second field a single-term search matches on, which is why a name search can return people whose surname does not match at all. null for members with no company recorded.

Sample response

200 OK
[
  {
    "id": 12345,
    "siteId": "string",
    "firstName": "string",
    "lastName": "string",
    "telephoneNumber": "string",
    "homeEmail": "member@example.com",
    "workEmail": "member@example.com",
    "priceLevel": "string",
    "status": {
      "id": "string",
      "name": "string",
      "textColour": "string",
      "backgroundColour": "string",
      "bookable": true
    },
    "company": "string"
  }
]

Errors

StatusMeaningWhen
400Bad requestsearchText failed validation, with the reason as a plain string body: Search Text cannot be empty, Search Text cannot be more than 255 characters, MemberId must be a valid integer greater than 0, When searching by name, please provide either a Last Name, or a Last Name and First Name separated by a comma, or When searching by name, Last Name cannot be empty.
500Internal server errorAn unexpected server-side failure during the search, with an empty body.

This page as markdown · All pages · llms.txt