Skip to main content
POST
/
identities
/
filter
Filter identities
curl --request POST \
  --url http://localhost:5001/identities/filter \
  --header 'X-blnk-key: <api-key>'
Use client.Identity.Filter to query identities with structured filters.
The Go SDK exposes Filter on each service rather than a unified Search.filter helper. Use client.Identity.Filter for identities, and see filter records for other collections.
1

Call the method

client.Identity.Filter
result, resp, err := client.Identity.Filter(
	blnkgo.FilterParams{
		Filters: []blnkgo.Filter{
			{
				Field: "email_address",
				Operator: blnkgo.OpEqual,
				Value: "john.doe@example.com",
			},
			{
				Field: "category",
				Operator: blnkgo.OpEqual,
				Value: "customer",
			},
		},
		Limit: 20,
		Offset: 0,
		IncludeCount: true,
	},
)
FieldTypeDescription
Filters[]blnkgo.FilterArray of filter conditions, each with a Field, Operator, and a Value or Values.
SortBystringField to sort by. Defaults to created_at.
SortOrderstringSort direction, asc or desc. Defaults to desc.
IncludeCountboolReturn TotalCount in the response. Defaults to false.
LimitintMaximum records to return. Defaults to 20, max 100.
OffsetintRecords to skip for pagination. Defaults to 0.
2

Use the filtered results

Read result.Data for matching identities. Use result.TotalCount with Limit and Offset to paginate when IncludeCount is true.
3

Response

200 OK
{
  "data": [
    {
      "identity_id": "idt_3b63c8da-af29-4cc3-ad38-df17d87456e6",
      "identity_type": "individual",
      "first_name": "John",
      "last_name": "Doe",
      "email_address": "john.doe@example.com",
      "category": "customer",
      "created_at": "2024-11-26T08:36:36.238244338Z"
    }
  ],
  "total_count": 1
}
FieldTypeDescription
dataobject[]Array of matching identity records.
total_countnumberTotal matching records. Only present when IncludeCount is true.

How identities work

Linking balances and handling profile data.

How DB filtering works

Supported operators and field reference.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.