Each Persona API response body contains a set of resources, and attributes of each resource.
You can specify the exact resources and attributes to return in each response, using the include and fields request parameters.
Each Persona API returns a set of resources, and attributes of each resource.
status, reference-id, created-at, etc.Each API response follows the JSON:API specification. Each response body is a single JSON-encoded object with the following keys:
The included and meta fields are added to the response when relevant.
By default, each API returns all attributes of:
For example, the Retrieve Inquiry API returns an inquiry (the primary resource), and can also return entities like the account, verifications, and inquiry template associated with that inquiry (some of the related resources).
If the default response does not include the data you want—or includes too much—you can use the include and fields request parameters to customize the response. See below for details.
View sample responses for each API on its reference page:
See Understanding a Persona API payload for a detailed walkthrough of example responses.
Each primary resource may have related resources that can be included in the response.
The data.relationships object lists all available related resources. By default, this relationships object is returned in every response.
Each relationship can be one-to-one or one-to-many. A one-to-one relationship contains a single object, and a one-to-many relationship contains an array of objects. Each object contains the type and id of the related resource.
For example, here is the relationships object for a fetched inquiry:
Note that:
transaction, reviewer, or reports, so these values are null or empty.account relationship is an example of a one-to-one relationship. It contains a single object.verifications relationship is an example of a one-to-many relationship. The contains an array of objects.Use the include query parameter to specify which related resources to return in the included array.
Limitations:
?include=foo.bar is allowed, but not ?include=foo.bar.bazinclude parameter cannot be used on “list all” endpoints.includeView the sample request in the each tab:
Parameter:
?include=verifications
Request:
Response:
data contains an inquiry, and included contains all its verifications.
No other related resources are returned.
Use the fields query parameter to specify which attributes should be returned for a given resource type. This lets you retrieve only the data you need.
Notes:
TYPE is the resource type, e.g. inquiry, verification/government-id, account.data.attributes in the API response.fieldsView the sample request in each tab:
Parameter:
?fields[inquiry]=status
Request:
Response:
fields and include togetherYou can combine include and fields in the same request, and use fields to control attributes on both primary and related resources.
For example, the following request returns:
status attributestatus and created-at attributesParameter:
Request:
Response:
Using include and fields to request only the data you need has multiple benefits: