Explore how to combine include
and fields
parameters for flexible and efficient API responses. These List Inquries
examples show how to retrieve only what you need.
Default request
Returns the full inquiry with default attributes.
# GET https://api.withpersona.com/api/v1/inquiries/
{
"data": {
"type": "inquiry",
"id": "inq_2CVZ4HyVg7qaboXz2PUHknAn",
"attributes": {
"status": "approved",
"reference-id": null,
"created-at": "2019-09-09T22:40:56.000Z",
"completed-at": "2019-09-09T22:44:51.000Z",
"expired-at": null,
"...": "..."
},
"relationships": {
"reports": {
"data": []
},
"sessions": {
"data": []
},
"template": {
"data": {
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"type": "template"
}
},
"verifications": {
"data": [
{
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"type": "verification/driver-license"
},
{
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"type": "verification/selfie"
}
]
}
},
},
"included": [
{
"type": "template",
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"attributes": {
"name": "Acme #1"
},
},
{
"type": "verification/driver-license",
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"attributes": {
"status": "passed",
"front-photo-url": "...",
"created-at": "2019-09-09T22:41:29.000Z",
"completed-at": "2019-09-09T22:41:40.000Z",
"...": "..."
},
},
{
"type": "verification/selfie",
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"attributes": {
"status": "passed",
"center-photo-url": "...",
"left-photo-url": "...",
"right-photo-url": "...",
"created-at": "2019-09-09T22:42:43.000Z",
"completed-at": "2019-09-09T22:42:46.000Z",
"...": "..."
},
}
],
"meta": {
"session-token": "..."
}
}
Include related resources
Returns the inquiry and its related verifications.
# GET https://api.withpersona.com/api/v1/inquiries/inq_2CVZ4HyVg7qaboXz2PUHknAn?include=verifications
{
"data": {
"type": "inquiry",
"id": "inq_2CVZ4HyVg7qaboXz2PUHknAn",
"attributes": {
"status": "approved",
"reference-id": null,
"created-at": "2019-09-09T22:40:56.000Z",
"completed-at": "2019-09-09T22:44:51.000Z",
"expired-at": null,
"...": "..."
},
"relationships": {
"reports": {
"data": []
},
"sessions": {
"data": []
},
"template": {
"data": {
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"type": "template"
}
},
"verifications": {
"data": [
{
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"type": "verification/driver-license"
},
{
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"type": "verification/selfie"
}
]
}
},
},
"included": [
{
"type": "verification/driver-license",
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"attributes": {
"status": "passed",
"front-photo-url": "...",
"created-at": "2019-09-09T22:41:29.000Z",
"completed-at": "2019-09-09T22:41:40.000Z",
"...": "..."
},
},
{
"type": "verification/selfie",
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"attributes": {
"status": "passed",
"center-photo-url": "...",
"left-photo-url": "...",
"right-photo-url": "...",
"created-at": "2019-09-09T22:42:43.000Z",
"completed-at": "2019-09-09T22:42:46.000Z",
"...": "..."
},
}
],
"meta": {
"session-token": "..."
}
}
Use sparse fieldsets
Returns only the status
field for the inquiry.
# GET https://api.withpersona.com/api/v1/inquiries/inq_2CVZ4HyVg7qaboXz2PUHknAn?fields[inquiry]=status
{
"data": {
"type": "inquiry",
"id": "inq_2CVZ4HyVg7qaboXz2PUHknAn",
"attributes": {
"status": "approved"
},
"relationships": {
"reports": {
"data": []
},
"sessions": {
"data": []
},
"template": {
"data": {
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"type": "template"
}
},
"verifications": {
"data": [
{
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"type": "verification/driver-license"
},
{
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"type": "verification/selfie"
}
]
}
},
},
"included": [
{
"type": "template",
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"attributes": {
"name": "Acme #1"
},
},
{
"type": "verification/driver-license",
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"attributes": {
"status": "passed",
"front-photo-url": "...",
"created-at": "2019-09-09T22:41:29.000Z",
"completed-at": "2019-09-09T22:41:40.000Z",
"...": "..."
},
},
{
"type": "verification/selfie",
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"attributes": {
"status": "passed",
"center-photo-url": "...",
"left-photo-url": "...",
"right-photo-url": "...",
"created-at": "2019-09-09T22:42:43.000Z",
"completed-at": "2019-09-09T22:42:46.000Z",
"...": "..."
},
}
],
"meta": {
"session-token": "..."
}
}
Sparse Fieldsets with Included Resources
Returns the status
field for the inquiry and the status
+ created-at
fields for related driver’s license verifications.
# GET https://api.withpersona.com/api/v1/inquiries/inq_2CVZ4HyVg7qaboXz2PUHknAn?include=verifications&fields[inquiry]=status&fields[verification/driver-license]=status,created-at
{
"data": {
"type": "inquiry",
"id": "inq_2CVZ4HyVg7qaboXz2PUHknAn",
"attributes": {
"status": "approved"
},
"relationships": {
"reports": {
"data": []
},
"sessions": {
"data": []
},
"template": {
"data": {
"id": "tmpl_JAZjHuAT738Q63BdgCuEJQre",
"type": "template"
}
},
"verifications": {
"data": [
{
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"type": "verification/driver-license"
},
{
"id": "ver_2aguhcwq66zcmqipmrqjxw68",
"type": "verification/selfie"
}
]
}
},
},
"included": [
{
"type": "verification/driver-license",
"id": "ver_KnqQRXmxmtquRE65CHTzymhR",
"attributes": {
"status": "passed",
"created-at": "2019-09-09T22:41:29.000Z"
},
}
],
"meta": {
"session-token": "..."
}
}