> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.withpersona.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpersona.com/_mcp/server.

# Search Inquiries

POST https://api.withpersona.com/api/v1/inquiries/search
Content-Type: application/json

Search for inquiries using a flexible query language.

## Search vs. List Endpoints

The Search and List endpoints serve different purposes and have distinct performance characteristics.

Use the **Search** endpoint (`POST /inquiries/search`) when you need to perform complex queries with boolean logic (AND/OR/NOT), filter on multiple statuses simultaneously, or apply multiple conditions at once. Search is optimized for flexible querying and is faster than paginating through all resources when looking for specific records.

Use the **List** endpoint (`GET /inquiries`) for simple listing with basic filters like reference ID.

## Data Freshness

Do not use search for read-after-write flows because the data will not be immediately available to search.
Under normal operating conditions, data is searchable within approximately 1 minute of creation or modification.
Propagation of new or updated data could be delayed during an outage.
For workflows that require immediate data availability after creating or updating an inquiry, use the List Inquiries endpoint instead.

### Searchable Attributes

The following attributes can be used in query predicates:

| Attribute | Description |
|-----------|-------------|
| `status` | Inquiry status (e.g., `pending`, `completed`, `approved`, `declined`) |
| `created_at` | Inquiry creation timestamp |
| `updated_at` | Inquiry last updated timestamp |
| `reference_id` | Reference ID associated with the inquiry's account |
| `inquiry_template_id` | Inquiry template ID (e.g., `itmpl_ABC123`) |


Reference: https://docs.withpersona.com/api-reference/inquiries/search-inquiries

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `fields` (map from string to string, optional) — Comma-separated list(s) of attributes to include in the response. This can be used to customize which attributes will be serialized in the response. See [Serialization](https://docs.withpersona.com/serialization#sparse-fieldsets) for more details.
- `page` (InquiriesSearchPostParametersPage, optional)

### Headers

- `Key-Inflection` (enum, optional) — Determines casing for the API response.
  - Allowed values: `camel`, `kebab`, `snake`
- `Idempotency-Key` (string, optional) — Ensures the request is idempotent.
- `Persona-Version` (enum, optional) — Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).
  - Allowed values: `2025-12-08`, `2025-10-27`, `2023-01-05`, `2022-09-01`, `2021-08-18`, `2021-07-05`, `2021-02-21`, `2020-05-18`

### Body (application/json)

This endpoint expects an Inquiries_search-inquiries_Request.

- `query` (InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery, optional) — Search query using boolean logic (AND/OR/NOT) and comparison operators. Supports predicates with operators: eq (equal), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal).
- `sort` (InquiriesSearchPostRequestBodyContentApplicationJsonSchemaSort, optional) — Sort configuration for results
- `page` (InquiriesSearchPostRequestBodyContentApplicationJsonSchemaPage, optional) — Pagination parameters

## Response

### 200

This endpoint returns a collection of Inquiry objects matching the search criteria.

- `data` (list of inquiry, required) — An array of Inquiries matching the search criteria
- `links` (InquiriesSearchPostResponsesContentApplicationJsonSchemaLinks, required)

## Errors

### 400 Bad Request Error

The request was unacceptable, often due to invalid parameters.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 401 Unauthorized Error

An invalid API key was provided.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 403 Forbidden Error

The given API key doesn’t have permissions to perform the request or a quota has been exceeded.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 404 Not Found Error

The requested resource doesn’t exist.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 409 Conflict Error

The request conflicts with another request, often due to attempting to create a duplicate resource.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 422 Unprocessable Entity Error

The request modifies the resource in an unacceptable way, often due to an invalid action or parameter.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 429 Too Many Requests Error

Your organization’s rate limit has been exceeded. We recommend an exponential backoff on requests.

- `errors` (list of InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

## Types

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery

Search query using boolean logic (AND/OR/NOT) and comparison operators. Supports predicates with operators: eq (equal), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal).

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaSort

Sort configuration for results

- `attribute` (string, required) — The attribute name to sort by
- `direction` (string, required, default: desc) — Sort direction. Possible values: asc (ascending), desc (descending).

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaPage

Pagination parameters

- `after` (string, optional) — Cursor for forward pagination
- `before` (string, optional) — Cursor for backward pagination
- `size` (integer, optional, default: 10) — Number of results to return per page

### InquiriesSearchPostParametersPage

- `after` (string, optional) — Cursor for forward pagination. Use the value from `links.next` in the previous response.
- `before` (string, optional) — Cursor for backward pagination. Use the value from `links.prev` in the previous response.
- `size` (integer, optional, default: 10) — Number of results to return per page.

### inquiry

An Inquiry object

- `id` (string, required)
- `attributes` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributes, required)
- `relationships` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationships, required)

### InquiriesSearchPostResponsesContentApplicationJsonSchemaLinks

- `prev` (string, required, nullable) — URL pointing to the previous page of data, or null if on the first page. Must be used with POST request and original request body.
- `next` (string, required, nullable) — URL pointing to the next page of data, or null if on the last page. Must be used with POST request and original request body.

### InquiriesSearchPostResponsesContentApplicationJsonSchemaErrorsItems

- `title` (string, optional)
- `details` (string, optional)

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery0

Boolean AND clause - combines multiple conditions where ALL must be true. This clause is recursive: each item in the `and` array can be another AND, OR, NOT clause, or a leaf predicate, enabling complex nested queries. Maximum nesting depth: 2 levels, Maximum clauses per AND: 20

- `and` (list of map from string to any, required)

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery1

Boolean OR clause - combines multiple conditions where AT LEAST ONE must be true. This clause is recursive: each item in the `or` array can be another AND, OR, NOT clause, or a leaf predicate, enabling complex nested queries. Maximum nesting depth: 2 levels, Maximum clauses per OR: 20

- `or` (list of map from string to any, required)

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery2

Boolean NOT clause - negates a single condition. This clause is recursive: the `not` value can be another AND, OR, NOT clause, or a leaf predicate, enabling complex nested queries. Maximum nesting depth: 2 levels

- `not` (map from string to any, required)

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQuery3

Attribute predicate

- `attribute` (string, required) — The attribute name to filter on (e.g., 'status', 'created_at', 'reference_id', 'inquiry_template_id')
- `operator` (string, required) — Comparison operator. Possible values: eq (equal), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal).
- `value` (InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQueryOneOf3Value, required) — Value to compare against

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributes

- `status` (string, required) — The status of the Inquiry Possible values: - created - pending - completed - expired - failed - needs_review - approved - declined Do not assume this is a static enumeration; Persona may add new values in the future without a versioned update.
- `reference-id` (string, required, nullable)
- `note` (string, required, nullable)
- `behaviors` (map from string to any, required, nullable) — Risk signals surfaced to enterprise customers. Specific keys are not enumerated in the public spec and may be added or removed over time. Contact your Persona account team for more information.
- `tags` (list of string, required)
- `creator` (string, required)
- `reviewer-comment` (string, required, nullable)
- `created-at` (datetime, required)
- `updated-at` (datetime, required)
- `started-at` (datetime, required, nullable)
- `expires-at` (datetime, required, nullable)
- `completed-at` (datetime, required, nullable)
- `failed-at` (datetime, required, nullable) — Set when an Inquiry transitions to `failed`. Not typically set on `declined` Inquiries — those carry `completed-at` from the transition that preceded the decision.
- `marked-for-review-at` (datetime, required, nullable)
- `decisioned-at` (datetime, required, nullable)
- `expired-at` (datetime, required, nullable)
- `redacted-at` (datetime, required, nullable)
- `previous-step-name` (string, required, nullable)
- `next-step-name` (string, required, nullable)
- `fields` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFields, required) — JSON key-value pairs of field name to field value. Exact schema depends on the configuration of the Inquiry template for this Inquiry.
- `birthdate` (date, optional, nullable) — Birthdate, must be in the format "YYYY-MM-DD".
- `name-first` (string, optional, nullable) — Given or first name.
- `name-middle` (string, optional, nullable) — Middle name.
- `name-last` (string, optional, nullable) — Family or last name.
- `phone-number` (string, optional, nullable) — Phone number.
- `email-address` (string, optional, nullable) — Email address.
- `social-security-number` (string, optional, nullable) — Social security number.
- `address-street-1` (string, optional, nullable) — Street name of residence address.
- `address-street-2` (string, optional, nullable) — Extension of residence address, usually apartment or suite number.
- `address-city` (string, optional, nullable) — City of residence address. Not all international addresses use this attribute.
- `address-subdivision` (string, optional, nullable) — State or subdivision of residence address. In the US, this should be the unabbreviated name. Not all international addresses use this attribute.
- `address-postal-code` (string, optional, nullable) — ZIP or postal code of residence address. Not all international addresses use this attribute.
- `address-subdivision-abbr` (string, optional, nullable)
- `address-postal-code-abbr` (string, optional, nullable)
- `identification-number` (string, optional, nullable)
- `reviewer` (string, optional, nullable) — The email address or identifier of the reviewer who made the decision on this inquiry. For User reviewers, this is their email address. For Workflow reviewers, this is the workflow token. For API decisions, this is "api".
- `reviewer-type` (string, optional, nullable) — The type of reviewer who made the decision. Can be "user", "workflow", "workflow-run", or "api".
- `driver-license-number` (string, optional, nullable, deprecated)
- `passport-number` (string, optional, nullable, deprecated)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationships

- `account` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsAccount, optional)
- `documents` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsDocuments, optional)
- `template` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTemplate, optional) — Only present for Legacy 2.0 inquiries
- `inquiry-template` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplate, optional) — Only present for Dynamic Flow inquiries
- `inquiry-template-version` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateVersion, optional) — Only present for Dynamic Flow inquiries
- `reports` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsReports, optional)
- `transaction` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTransaction, optional)
- `selfies` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSelfies, optional)
- `sessions` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSessions, optional)
- `verifications` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsVerifications, optional)

### InquiriesSearchPostRequestBodyContentApplicationJsonSchemaQueryOneOf3Value

Value to compare against

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFields

JSON key-value pairs of field name to field value. Exact schema depends on the configuration of the Inquiry template for this Inquiry.

- `name-first` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameFirst, optional)
- `name-middle` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameMiddle, optional)
- `name-last` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameLast, optional)
- `address-street-1` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressStreet1, optional)
- `address-street-2` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressStreet2, optional)
- `address-city` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressCity, optional) — City of residence address. Not all international addresses use this attribute.
- `address-subdivision` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressSubdivision, optional) — State or subdivision of residence address. In the US, this should be the unabbreviated name. Not all international addresses use this attribute.
- `address-postal-code` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressPostalCode, optional) — ZIP or postal code of residence address. Not all international addresses use this attribute.
- `address-country-code` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressCountryCode, optional) — ISO 3166-1 alpha 2 country code.
- `birthdate` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsBirthdate, optional)
- `email-address` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsEmailAddress, optional)
- `phone-number` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsPhoneNumber, optional)
- `driver-license-number` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsDriverLicenseNumber, optional, deprecated)
- `passport-number` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsPassportNumber, optional, deprecated)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsAccount

- `data` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsAccountData, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsDocuments

- `data` (list of SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsDocumentsDataItems, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTemplate

Only present for Legacy 2.0 inquiries

- `data` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTemplateData, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplate

Only present for Dynamic Flow inquiries

- `data` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateData, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateVersion

Only present for Dynamic Flow inquiries

- `data` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateVersionData, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsReports

- `data` (list of SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsReportsDataItems, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTransaction

- `data` (SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTransactionData, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSelfies

- `data` (list of SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSelfiesDataItems, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSessions

- `data` (list of SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSessionsDataItems, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsVerifications

- `data` (list of SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsVerificationsDataItems, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameFirst

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameMiddle

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsNameLast

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressStreet1

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressStreet2

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressCity

City of residence address. Not all international addresses use this attribute.

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressSubdivision

State or subdivision of residence address. In the US, this should be the unabbreviated name. Not all international addresses use this attribute.

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressPostalCode

ZIP or postal code of residence address. Not all international addresses use this attribute.

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsAddressCountryCode

ISO 3166-1 alpha 2 country code.

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsBirthdate

- `type` (string, optional)
- `value` (string, optional, nullable) — Date of birth in YYYY-MM-DD format

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsEmailAddress

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsPhoneNumber

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsDriverLicenseNumber

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryAttributesFieldsPassportNumber

- `type` (string, optional)
- `value` (string, optional, nullable)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsAccountData

- `id` (string, optional)
- `type` ("account", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsDocumentsDataItems

- `id` (string, optional)
- `type` (string, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTemplateData

- `id` (string, optional)
- `type` ("template", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateData

- `id` (string, optional)
- `type` ("inquiry-template", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsInquiryTemplateVersionData

- `id` (string, optional)
- `type` ("inquiry-template-version", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsReportsDataItems

- `id` (string, optional)
- `type` (string, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsTransactionData

- `id` (string, optional)
- `type` ("transaction", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSelfiesDataItems

- `id` (string, optional)
- `type` (string, optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsSessionsDataItems

- `id` (string, optional)
- `type` ("inquiry-session", optional)

### SelfieIncludedObjectsItemsDiscriminatorMappingInquiryRelationshipsVerificationsDataItems

- `id` (string, optional)
- `type` (string, optional)

## Examples

### Success

**Response**

```json
{
  "data": [
    {
      "id": "inq_zEx4jL84ShbUyuwX6AzPSqt6",
      "attributes": {
        "status": "pending",
        "reference-id": "abc-123",
        "note": null,
        "behaviors": {},
        "tags": [
          "tag1",
          "tag2"
        ],
        "creator": "creator@example.com",
        "reviewer-comment": null,
        "created-at": "2023-03-29T19:06:45.000Z",
        "updated-at": "2023-03-30T19:07:01.000Z",
        "started-at": "2023-03-30T19:07:01.000Z",
        "expires-at": "2023-03-31T19:07:01.000Z",
        "completed-at": null,
        "failed-at": null,
        "marked-for-review-at": null,
        "decisioned-at": null,
        "expired-at": null,
        "redacted-at": null,
        "previous-step-name": "start",
        "next-step-name": "verification_document",
        "fields": {
          "birthdate": {
            "type": "date",
            "value": "1995-09-08"
          },
          "address_city": {
            "type": "string",
            "value": "San Francisco"
          },
          "address_country_code": {
            "type": "string",
            "value": "US"
          },
          "address_postal_code": {
            "type": "string",
            "value": "94111"
          },
          "address_street_1": {
            "type": "string",
            "value": "123 Main St"
          },
          "address_street_2": {
            "type": "string",
            "value": null
          },
          "address_subdivision": {
            "type": "string",
            "value": "California"
          },
          "driver_license_number": {
            "type": "string",
            "value": "YL123456"
          },
          "email_address": {
            "type": "string",
            "value": "jane@doe.com"
          },
          "name_first": {
            "type": "string",
            "value": "Jane"
          },
          "name_last": {
            "type": "string",
            "value": "Doe"
          },
          "name_middle": {
            "type": "string",
            "value": "Marie"
          },
          "passport_number": {
            "type": "string",
            "value": "P123456"
          },
          "phone_number": {
            "type": "string",
            "value": null
          }
        },
        "birthdate": "1995-09-08",
        "name-first": "Jane",
        "name-middle": "Marie",
        "name-last": "Doe",
        "phone-number": null,
        "email-address": "jane@doe.com",
        "social-security-number": null,
        "address-street-1": "123 Main St",
        "address-street-2": null,
        "address-city": "San Francisco",
        "address-subdivision": "California",
        "address-postal-code": "94111",
        "address-subdivision-abbr": "CA",
        "address-postal-code-abbr": "94111",
        "identification-number": null,
        "reviewer": "reviewer@example.com",
        "reviewer-type": "user"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "act_n2uq9eKMboaCQzu9ALWYcVdN",
            "type": "account"
          }
        },
        "documents": {
          "data": []
        },
        "template": {
          "data": {}
        },
        "inquiry-template": {
          "data": {
            "id": "itmpl_p8ANAJy9iqadm2buF2xcVgqH",
            "type": "inquiry-template"
          }
        },
        "inquiry-template-version": {
          "data": {
            "id": "itmplv_iXhqfNWqwYLAWs9G8Fm8hPfo",
            "type": "inquiry-template-version"
          }
        },
        "reports": {
          "data": []
        },
        "selfies": {
          "data": []
        },
        "sessions": {
          "data": []
        },
        "verifications": {
          "data": [
            {
              "id": "ver_uHDiwtcx3htjajvEaeMjPQcE",
              "type": "verification/database"
            }
          ]
        }
      },
      "type": "inquiry"
    }
  ],
  "links": {
    "prev": null,
    "next": "/api/v1/inquiries/search?page%5Bafter%5D=inq_ByBdXDqUrguLAHjGZMuDZLCx&page%5Bsize%5D=10"
  }
}
```

**SDK Code**

```python Success
import requests

url = "https://api.withpersona.com/api/v1/inquiries/search"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Success
const url = 'https://api.withpersona.com/api/v1/inquiries/search';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Success
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/inquiries/search"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Success
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/inquiries/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/inquiries/search")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/inquiries/search', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/inquiries/search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/inquiries/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Simple query

**Request**

```json
{
  "query": {
    "attribute": "status",
    "operator": "eq",
    "value": "completed"
  },
  "sort": {
    "attribute": "created_at",
    "direction": "asc"
  },
  "page": {
    "size": 15
  }
}
```

**Response**

```json
{
  "data": [
    {
      "id": "inq_zEx4jL84ShbUyuwX6AzPSqt6",
      "attributes": {
        "status": "pending",
        "reference-id": "abc-123",
        "note": null,
        "behaviors": {},
        "tags": [
          "tag1",
          "tag2"
        ],
        "creator": "creator@example.com",
        "reviewer-comment": null,
        "created-at": "2023-03-29T19:06:45.000Z",
        "updated-at": "2023-03-30T19:07:01.000Z",
        "started-at": "2023-03-30T19:07:01.000Z",
        "expires-at": "2023-03-31T19:07:01.000Z",
        "completed-at": null,
        "failed-at": null,
        "marked-for-review-at": null,
        "decisioned-at": null,
        "expired-at": null,
        "redacted-at": null,
        "previous-step-name": "start",
        "next-step-name": "verification_document",
        "fields": {
          "birthdate": {
            "type": "date",
            "value": "1995-09-08"
          },
          "address_city": {
            "type": "string",
            "value": "San Francisco"
          },
          "address_country_code": {
            "type": "string",
            "value": "US"
          },
          "address_postal_code": {
            "type": "string",
            "value": "94111"
          },
          "address_street_1": {
            "type": "string",
            "value": "123 Main St"
          },
          "address_street_2": {
            "type": "string",
            "value": null
          },
          "address_subdivision": {
            "type": "string",
            "value": "California"
          },
          "driver_license_number": {
            "type": "string",
            "value": "YL123456"
          },
          "email_address": {
            "type": "string",
            "value": "jane@doe.com"
          },
          "name_first": {
            "type": "string",
            "value": "Jane"
          },
          "name_last": {
            "type": "string",
            "value": "Doe"
          },
          "name_middle": {
            "type": "string",
            "value": "Marie"
          },
          "passport_number": {
            "type": "string",
            "value": "P123456"
          },
          "phone_number": {
            "type": "string",
            "value": null
          }
        },
        "birthdate": "1995-09-08",
        "name-first": "Jane",
        "name-middle": "Marie",
        "name-last": "Doe",
        "phone-number": null,
        "email-address": "jane@doe.com",
        "social-security-number": null,
        "address-street-1": "123 Main St",
        "address-street-2": null,
        "address-city": "San Francisco",
        "address-subdivision": "California",
        "address-postal-code": "94111",
        "address-subdivision-abbr": "CA",
        "address-postal-code-abbr": "94111",
        "identification-number": null,
        "reviewer": "reviewer@example.com",
        "reviewer-type": "user"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "act_n2uq9eKMboaCQzu9ALWYcVdN",
            "type": "account"
          }
        },
        "documents": {
          "data": []
        },
        "template": {
          "data": {}
        },
        "inquiry-template": {
          "data": {
            "id": "itmpl_p8ANAJy9iqadm2buF2xcVgqH",
            "type": "inquiry-template"
          }
        },
        "inquiry-template-version": {
          "data": {
            "id": "itmplv_iXhqfNWqwYLAWs9G8Fm8hPfo",
            "type": "inquiry-template-version"
          }
        },
        "reports": {
          "data": []
        },
        "selfies": {
          "data": []
        },
        "sessions": {
          "data": []
        },
        "verifications": {
          "data": [
            {
              "id": "ver_uHDiwtcx3htjajvEaeMjPQcE",
              "type": "verification/database"
            }
          ]
        }
      },
      "type": "inquiry"
    }
  ],
  "links": {
    "prev": null,
    "next": "/api/v1/inquiries/search?page%5Bafter%5D=inq_ByBdXDqUrguLAHjGZMuDZLCx&page%5Bsize%5D=10"
  }
}
```

**SDK Code**

```python Simple query
import requests

url = "https://api.withpersona.com/api/v1/inquiries/search"

payload = {
    "query": {
        "attribute": "status",
        "operator": "eq",
        "value": "completed"
    },
    "sort": {
        "attribute": "created_at",
        "direction": "asc"
    },
    "page": { "size": 15 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Simple query
const url = 'https://api.withpersona.com/api/v1/inquiries/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"query":{"attribute":"status","operator":"eq","value":"completed"},"sort":{"attribute":"created_at","direction":"asc"},"page":{"size":15}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Simple query
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/inquiries/search"

	payload := strings.NewReader("{\n  \"query\": {\n    \"attribute\": \"status\",\n    \"operator\": \"eq\",\n    \"value\": \"completed\"\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"asc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Simple query
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/inquiries/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": {\n    \"attribute\": \"status\",\n    \"operator\": \"eq\",\n    \"value\": \"completed\"\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"asc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Simple query
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/inquiries/search")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": {\n    \"attribute\": \"status\",\n    \"operator\": \"eq\",\n    \"value\": \"completed\"\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"asc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")
  .asString();
```

```php Simple query
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/inquiries/search', [
  'body' => '{
  "query": {
    "attribute": "status",
    "operator": "eq",
    "value": "completed"
  },
  "sort": {
    "attribute": "created_at",
    "direction": "asc"
  },
  "page": {
    "size": 15
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Simple query
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/inquiries/search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": {\n    \"attribute\": \"status\",\n    \"operator\": \"eq\",\n    \"value\": \"completed\"\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"asc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Simple query
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "query": [
    "attribute": "status",
    "operator": "eq",
    "value": "completed"
  ],
  "sort": [
    "attribute": "created_at",
    "direction": "asc"
  ],
  "page": ["size": 15]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/inquiries/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Multi-status query

**Request**

```json
{
  "query": {
    "or": [
      {
        "attribute": "status",
        "operator": "eq",
        "value": "pending"
      },
      {
        "attribute": "status",
        "operator": "eq",
        "value": "completed"
      },
      {
        "attribute": "status",
        "operator": "eq",
        "value": "approved"
      }
    ]
  },
  "sort": {
    "attribute": "created_at",
    "direction": "desc"
  },
  "page": {
    "size": 15
  }
}
```

**Response**

```json
{
  "data": [
    {
      "id": "inq_zEx4jL84ShbUyuwX6AzPSqt6",
      "attributes": {
        "status": "pending",
        "reference-id": "abc-123",
        "note": null,
        "behaviors": {},
        "tags": [
          "tag1",
          "tag2"
        ],
        "creator": "creator@example.com",
        "reviewer-comment": null,
        "created-at": "2023-03-29T19:06:45.000Z",
        "updated-at": "2023-03-30T19:07:01.000Z",
        "started-at": "2023-03-30T19:07:01.000Z",
        "expires-at": "2023-03-31T19:07:01.000Z",
        "completed-at": null,
        "failed-at": null,
        "marked-for-review-at": null,
        "decisioned-at": null,
        "expired-at": null,
        "redacted-at": null,
        "previous-step-name": "start",
        "next-step-name": "verification_document",
        "fields": {
          "birthdate": {
            "type": "date",
            "value": "1995-09-08"
          },
          "address_city": {
            "type": "string",
            "value": "San Francisco"
          },
          "address_country_code": {
            "type": "string",
            "value": "US"
          },
          "address_postal_code": {
            "type": "string",
            "value": "94111"
          },
          "address_street_1": {
            "type": "string",
            "value": "123 Main St"
          },
          "address_street_2": {
            "type": "string",
            "value": null
          },
          "address_subdivision": {
            "type": "string",
            "value": "California"
          },
          "driver_license_number": {
            "type": "string",
            "value": "YL123456"
          },
          "email_address": {
            "type": "string",
            "value": "jane@doe.com"
          },
          "name_first": {
            "type": "string",
            "value": "Jane"
          },
          "name_last": {
            "type": "string",
            "value": "Doe"
          },
          "name_middle": {
            "type": "string",
            "value": "Marie"
          },
          "passport_number": {
            "type": "string",
            "value": "P123456"
          },
          "phone_number": {
            "type": "string",
            "value": null
          }
        },
        "birthdate": "1995-09-08",
        "name-first": "Jane",
        "name-middle": "Marie",
        "name-last": "Doe",
        "phone-number": null,
        "email-address": "jane@doe.com",
        "social-security-number": null,
        "address-street-1": "123 Main St",
        "address-street-2": null,
        "address-city": "San Francisco",
        "address-subdivision": "California",
        "address-postal-code": "94111",
        "address-subdivision-abbr": "CA",
        "address-postal-code-abbr": "94111",
        "identification-number": null,
        "reviewer": "reviewer@example.com",
        "reviewer-type": "user"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "act_n2uq9eKMboaCQzu9ALWYcVdN",
            "type": "account"
          }
        },
        "documents": {
          "data": []
        },
        "template": {
          "data": {}
        },
        "inquiry-template": {
          "data": {
            "id": "itmpl_p8ANAJy9iqadm2buF2xcVgqH",
            "type": "inquiry-template"
          }
        },
        "inquiry-template-version": {
          "data": {
            "id": "itmplv_iXhqfNWqwYLAWs9G8Fm8hPfo",
            "type": "inquiry-template-version"
          }
        },
        "reports": {
          "data": []
        },
        "selfies": {
          "data": []
        },
        "sessions": {
          "data": []
        },
        "verifications": {
          "data": [
            {
              "id": "ver_uHDiwtcx3htjajvEaeMjPQcE",
              "type": "verification/database"
            }
          ]
        }
      },
      "type": "inquiry"
    }
  ],
  "links": {
    "prev": null,
    "next": "/api/v1/inquiries/search?page%5Bafter%5D=inq_ByBdXDqUrguLAHjGZMuDZLCx&page%5Bsize%5D=10"
  }
}
```

**SDK Code**

```python Multi-status query
import requests

url = "https://api.withpersona.com/api/v1/inquiries/search"

payload = {
    "query": { "or": [
            {
                "attribute": "status",
                "operator": "eq",
                "value": "pending"
            },
            {
                "attribute": "status",
                "operator": "eq",
                "value": "completed"
            },
            {
                "attribute": "status",
                "operator": "eq",
                "value": "approved"
            }
        ] },
    "sort": {
        "attribute": "created_at",
        "direction": "desc"
    },
    "page": { "size": 15 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Multi-status query
const url = 'https://api.withpersona.com/api/v1/inquiries/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"query":{"or":[{"attribute":"status","operator":"eq","value":"pending"},{"attribute":"status","operator":"eq","value":"completed"},{"attribute":"status","operator":"eq","value":"approved"}]},"sort":{"attribute":"created_at","direction":"desc"},"page":{"size":15}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Multi-status query
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/inquiries/search"

	payload := strings.NewReader("{\n  \"query\": {\n    \"or\": [\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"pending\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"completed\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"approved\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Multi-status query
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/inquiries/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": {\n    \"or\": [\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"pending\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"completed\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"approved\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Multi-status query
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/inquiries/search")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": {\n    \"or\": [\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"pending\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"completed\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"approved\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")
  .asString();
```

```php Multi-status query
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/inquiries/search', [
  'body' => '{
  "query": {
    "or": [
      {
        "attribute": "status",
        "operator": "eq",
        "value": "pending"
      },
      {
        "attribute": "status",
        "operator": "eq",
        "value": "completed"
      },
      {
        "attribute": "status",
        "operator": "eq",
        "value": "approved"
      }
    ]
  },
  "sort": {
    "attribute": "created_at",
    "direction": "desc"
  },
  "page": {
    "size": 15
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Multi-status query
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/inquiries/search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": {\n    \"or\": [\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"pending\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"completed\"\n      },\n      {\n        \"attribute\": \"status\",\n        \"operator\": \"eq\",\n        \"value\": \"approved\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Multi-status query
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "query": ["or": [
      [
        "attribute": "status",
        "operator": "eq",
        "value": "pending"
      ],
      [
        "attribute": "status",
        "operator": "eq",
        "value": "completed"
      ],
      [
        "attribute": "status",
        "operator": "eq",
        "value": "approved"
      ]
    ]],
  "sort": [
    "attribute": "created_at",
    "direction": "desc"
  ],
  "page": ["size": 15]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/inquiries/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Complex boolean query

**Request**

```json
{
  "query": {
    "and": [
      {
        "attribute": "inquiry_template_id",
        "operator": "eq",
        "value": "itmpl_ABC123"
      },
      {
        "or": [
          {
            "attribute": "status",
            "operator": "eq",
            "value": "completed"
          },
          {
            "attribute": "status",
            "operator": "eq",
            "value": "approved"
          }
        ]
      },
      {
        "attribute": "created_at",
        "operator": "gte",
        "value": "2025-01-01"
      }
    ]
  },
  "sort": {
    "attribute": "created_at",
    "direction": "desc"
  },
  "page": {
    "size": 15
  }
}
```

**Response**

```json
{
  "data": [
    {
      "id": "inq_zEx4jL84ShbUyuwX6AzPSqt6",
      "attributes": {
        "status": "pending",
        "reference-id": "abc-123",
        "note": null,
        "behaviors": {},
        "tags": [
          "tag1",
          "tag2"
        ],
        "creator": "creator@example.com",
        "reviewer-comment": null,
        "created-at": "2023-03-29T19:06:45.000Z",
        "updated-at": "2023-03-30T19:07:01.000Z",
        "started-at": "2023-03-30T19:07:01.000Z",
        "expires-at": "2023-03-31T19:07:01.000Z",
        "completed-at": null,
        "failed-at": null,
        "marked-for-review-at": null,
        "decisioned-at": null,
        "expired-at": null,
        "redacted-at": null,
        "previous-step-name": "start",
        "next-step-name": "verification_document",
        "fields": {
          "birthdate": {
            "type": "date",
            "value": "1995-09-08"
          },
          "address_city": {
            "type": "string",
            "value": "San Francisco"
          },
          "address_country_code": {
            "type": "string",
            "value": "US"
          },
          "address_postal_code": {
            "type": "string",
            "value": "94111"
          },
          "address_street_1": {
            "type": "string",
            "value": "123 Main St"
          },
          "address_street_2": {
            "type": "string",
            "value": null
          },
          "address_subdivision": {
            "type": "string",
            "value": "California"
          },
          "driver_license_number": {
            "type": "string",
            "value": "YL123456"
          },
          "email_address": {
            "type": "string",
            "value": "jane@doe.com"
          },
          "name_first": {
            "type": "string",
            "value": "Jane"
          },
          "name_last": {
            "type": "string",
            "value": "Doe"
          },
          "name_middle": {
            "type": "string",
            "value": "Marie"
          },
          "passport_number": {
            "type": "string",
            "value": "P123456"
          },
          "phone_number": {
            "type": "string",
            "value": null
          }
        },
        "birthdate": "1995-09-08",
        "name-first": "Jane",
        "name-middle": "Marie",
        "name-last": "Doe",
        "phone-number": null,
        "email-address": "jane@doe.com",
        "social-security-number": null,
        "address-street-1": "123 Main St",
        "address-street-2": null,
        "address-city": "San Francisco",
        "address-subdivision": "California",
        "address-postal-code": "94111",
        "address-subdivision-abbr": "CA",
        "address-postal-code-abbr": "94111",
        "identification-number": null,
        "reviewer": "reviewer@example.com",
        "reviewer-type": "user"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "act_n2uq9eKMboaCQzu9ALWYcVdN",
            "type": "account"
          }
        },
        "documents": {
          "data": []
        },
        "template": {
          "data": {}
        },
        "inquiry-template": {
          "data": {
            "id": "itmpl_p8ANAJy9iqadm2buF2xcVgqH",
            "type": "inquiry-template"
          }
        },
        "inquiry-template-version": {
          "data": {
            "id": "itmplv_iXhqfNWqwYLAWs9G8Fm8hPfo",
            "type": "inquiry-template-version"
          }
        },
        "reports": {
          "data": []
        },
        "selfies": {
          "data": []
        },
        "sessions": {
          "data": []
        },
        "verifications": {
          "data": [
            {
              "id": "ver_uHDiwtcx3htjajvEaeMjPQcE",
              "type": "verification/database"
            }
          ]
        }
      },
      "type": "inquiry"
    }
  ],
  "links": {
    "prev": null,
    "next": "/api/v1/inquiries/search?page%5Bafter%5D=inq_ByBdXDqUrguLAHjGZMuDZLCx&page%5Bsize%5D=10"
  }
}
```

**SDK Code**

```python Complex boolean query
import requests

url = "https://api.withpersona.com/api/v1/inquiries/search"

payload = {
    "query": { "and": [
            {
                "attribute": "inquiry_template_id",
                "operator": "eq",
                "value": "itmpl_ABC123"
            },
            { "or": [
                    {
                        "attribute": "status",
                        "operator": "eq",
                        "value": "completed"
                    },
                    {
                        "attribute": "status",
                        "operator": "eq",
                        "value": "approved"
                    }
                ] },
            {
                "attribute": "created_at",
                "operator": "gte",
                "value": "2025-01-01"
            }
        ] },
    "sort": {
        "attribute": "created_at",
        "direction": "desc"
    },
    "page": { "size": 15 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Complex boolean query
const url = 'https://api.withpersona.com/api/v1/inquiries/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"query":{"and":[{"attribute":"inquiry_template_id","operator":"eq","value":"itmpl_ABC123"},{"or":[{"attribute":"status","operator":"eq","value":"completed"},{"attribute":"status","operator":"eq","value":"approved"}]},{"attribute":"created_at","operator":"gte","value":"2025-01-01"}]},"sort":{"attribute":"created_at","direction":"desc"},"page":{"size":15}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Complex boolean query
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/inquiries/search"

	payload := strings.NewReader("{\n  \"query\": {\n    \"and\": [\n      {\n        \"attribute\": \"inquiry_template_id\",\n        \"operator\": \"eq\",\n        \"value\": \"itmpl_ABC123\"\n      },\n      {\n        \"or\": [\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"completed\"\n          },\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"approved\"\n          }\n        ]\n      },\n      {\n        \"attribute\": \"created_at\",\n        \"operator\": \"gte\",\n        \"value\": \"2025-01-01\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Complex boolean query
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/inquiries/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": {\n    \"and\": [\n      {\n        \"attribute\": \"inquiry_template_id\",\n        \"operator\": \"eq\",\n        \"value\": \"itmpl_ABC123\"\n      },\n      {\n        \"or\": [\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"completed\"\n          },\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"approved\"\n          }\n        ]\n      },\n      {\n        \"attribute\": \"created_at\",\n        \"operator\": \"gte\",\n        \"value\": \"2025-01-01\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Complex boolean query
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/inquiries/search")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": {\n    \"and\": [\n      {\n        \"attribute\": \"inquiry_template_id\",\n        \"operator\": \"eq\",\n        \"value\": \"itmpl_ABC123\"\n      },\n      {\n        \"or\": [\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"completed\"\n          },\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"approved\"\n          }\n        ]\n      },\n      {\n        \"attribute\": \"created_at\",\n        \"operator\": \"gte\",\n        \"value\": \"2025-01-01\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}")
  .asString();
```

```php Complex boolean query
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/inquiries/search', [
  'body' => '{
  "query": {
    "and": [
      {
        "attribute": "inquiry_template_id",
        "operator": "eq",
        "value": "itmpl_ABC123"
      },
      {
        "or": [
          {
            "attribute": "status",
            "operator": "eq",
            "value": "completed"
          },
          {
            "attribute": "status",
            "operator": "eq",
            "value": "approved"
          }
        ]
      },
      {
        "attribute": "created_at",
        "operator": "gte",
        "value": "2025-01-01"
      }
    ]
  },
  "sort": {
    "attribute": "created_at",
    "direction": "desc"
  },
  "page": {
    "size": 15
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Complex boolean query
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/inquiries/search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": {\n    \"and\": [\n      {\n        \"attribute\": \"inquiry_template_id\",\n        \"operator\": \"eq\",\n        \"value\": \"itmpl_ABC123\"\n      },\n      {\n        \"or\": [\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"completed\"\n          },\n          {\n            \"attribute\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": \"approved\"\n          }\n        ]\n      },\n      {\n        \"attribute\": \"created_at\",\n        \"operator\": \"gte\",\n        \"value\": \"2025-01-01\"\n      }\n    ]\n  },\n  \"sort\": {\n    \"attribute\": \"created_at\",\n    \"direction\": \"desc\"\n  },\n  \"page\": {\n    \"size\": 15\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Complex boolean query
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "query": ["and": [
      [
        "attribute": "inquiry_template_id",
        "operator": "eq",
        "value": "itmpl_ABC123"
      ],
      ["or": [
          [
            "attribute": "status",
            "operator": "eq",
            "value": "completed"
          ],
          [
            "attribute": "status",
            "operator": "eq",
            "value": "approved"
          ]
        ]],
      [
        "attribute": "created_at",
        "operator": "gte",
        "value": "2025-01-01"
      ]
    ]],
  "sort": [
    "attribute": "created_at",
    "direction": "desc"
  ],
  "page": ["size": 15]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/inquiries/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Empty query (all inquiries)

**Request**

```json
{
  "page": {
    "size": 15
  }
}
```

**Response**

```json
{
  "data": [
    {
      "id": "inq_zEx4jL84ShbUyuwX6AzPSqt6",
      "attributes": {
        "status": "pending",
        "reference-id": "abc-123",
        "note": null,
        "behaviors": {},
        "tags": [
          "tag1",
          "tag2"
        ],
        "creator": "creator@example.com",
        "reviewer-comment": null,
        "created-at": "2023-03-29T19:06:45.000Z",
        "updated-at": "2023-03-30T19:07:01.000Z",
        "started-at": "2023-03-30T19:07:01.000Z",
        "expires-at": "2023-03-31T19:07:01.000Z",
        "completed-at": null,
        "failed-at": null,
        "marked-for-review-at": null,
        "decisioned-at": null,
        "expired-at": null,
        "redacted-at": null,
        "previous-step-name": "start",
        "next-step-name": "verification_document",
        "fields": {
          "birthdate": {
            "type": "date",
            "value": "1995-09-08"
          },
          "address_city": {
            "type": "string",
            "value": "San Francisco"
          },
          "address_country_code": {
            "type": "string",
            "value": "US"
          },
          "address_postal_code": {
            "type": "string",
            "value": "94111"
          },
          "address_street_1": {
            "type": "string",
            "value": "123 Main St"
          },
          "address_street_2": {
            "type": "string",
            "value": null
          },
          "address_subdivision": {
            "type": "string",
            "value": "California"
          },
          "driver_license_number": {
            "type": "string",
            "value": "YL123456"
          },
          "email_address": {
            "type": "string",
            "value": "jane@doe.com"
          },
          "name_first": {
            "type": "string",
            "value": "Jane"
          },
          "name_last": {
            "type": "string",
            "value": "Doe"
          },
          "name_middle": {
            "type": "string",
            "value": "Marie"
          },
          "passport_number": {
            "type": "string",
            "value": "P123456"
          },
          "phone_number": {
            "type": "string",
            "value": null
          }
        },
        "birthdate": "1995-09-08",
        "name-first": "Jane",
        "name-middle": "Marie",
        "name-last": "Doe",
        "phone-number": null,
        "email-address": "jane@doe.com",
        "social-security-number": null,
        "address-street-1": "123 Main St",
        "address-street-2": null,
        "address-city": "San Francisco",
        "address-subdivision": "California",
        "address-postal-code": "94111",
        "address-subdivision-abbr": "CA",
        "address-postal-code-abbr": "94111",
        "identification-number": null,
        "reviewer": "reviewer@example.com",
        "reviewer-type": "user"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "act_n2uq9eKMboaCQzu9ALWYcVdN",
            "type": "account"
          }
        },
        "documents": {
          "data": []
        },
        "template": {
          "data": {}
        },
        "inquiry-template": {
          "data": {
            "id": "itmpl_p8ANAJy9iqadm2buF2xcVgqH",
            "type": "inquiry-template"
          }
        },
        "inquiry-template-version": {
          "data": {
            "id": "itmplv_iXhqfNWqwYLAWs9G8Fm8hPfo",
            "type": "inquiry-template-version"
          }
        },
        "reports": {
          "data": []
        },
        "selfies": {
          "data": []
        },
        "sessions": {
          "data": []
        },
        "verifications": {
          "data": [
            {
              "id": "ver_uHDiwtcx3htjajvEaeMjPQcE",
              "type": "verification/database"
            }
          ]
        }
      },
      "type": "inquiry"
    }
  ],
  "links": {
    "prev": null,
    "next": "/api/v1/inquiries/search?page%5Bafter%5D=inq_ByBdXDqUrguLAHjGZMuDZLCx&page%5Bsize%5D=10"
  }
}
```

**SDK Code**

```python Empty query (all inquiries)
import requests

url = "https://api.withpersona.com/api/v1/inquiries/search"

payload = { "page": { "size": 15 } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Empty query (all inquiries)
const url = 'https://api.withpersona.com/api/v1/inquiries/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"page":{"size":15}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Empty query (all inquiries)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/inquiries/search"

	payload := strings.NewReader("{\n  \"page\": {\n    \"size\": 15\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Empty query (all inquiries)
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/inquiries/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"page\": {\n    \"size\": 15\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Empty query (all inquiries)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/inquiries/search")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"page\": {\n    \"size\": 15\n  }\n}")
  .asString();
```

```php Empty query (all inquiries)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/inquiries/search', [
  'body' => '{
  "page": {
    "size": 15
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Empty query (all inquiries)
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/inquiries/search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"page\": {\n    \"size\": 15\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Empty query (all inquiries)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["page": ["size": 15]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/inquiries/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```