This guide walks you, or an AI agent working for you, through a complete phone collection with the Hearsay API:
- Sign in, or create an account, and choose your organization.
- Create a case.
- Create an extraction code and send it to the custodian.
- Read and tag the messages collected from the custodian's phone.
- Export the collected phone data (Android and iOS).
The topics below describe the steps and the rules. The exact request fields, response shapes and status codes are in the endpoint reference on this site, which is the source of truth for field names and types.
Using an AI agent? Give it this guide and the OpenAPI definition of this API. Tell it to treat the definition as the source of truth for field names and types, and to follow the "Safety rules for AI agents" topic.
How a collection flows
flowchart TD A[Sign in and choose the organization] --> B[Create a case] B --> C[Create an extraction code] C --> D[Custodian enters the code in the Hearsay desktop app and uploads the phone data] D --> E[Poll the data status until the phone source is completed] E --> F[Optional: read and tag messages] F --> G[Start an export] G --> H[Poll the export until it is completed] H --> I[Download the file]
Your integration cannot collect phone data itself. It creates the code, delivers it, and waits for the custodian to upload.
End-to-end checklist
- Log in (or register). Store the access and refresh tokens securely.
- Read
userProfile.userOrganizationsand pick the organization. Send its id as theorganizationheader from now on. POST /casecreates the case. Save the case id fromdata.case.id.POST /case/{caseId}/extractionwith the custodian,requestedSources(ios,androidor both) andsendEmail: true. Save the code fromdata.code.- Poll
GET /case/{caseId}/data-status-v2until the phone source is completed and has items. Note itssourceId: that is the device id. - Optional: list the conversations and messages, create case tags, and tag the relevant messages in bulk.
POST /case/{caseId}/exportwithsource: conversation, atype,sortByanddevice(plustagsif you tagged). Save the export id fromdata.id.- Poll
GET /case/{caseId}/export?exportId=…untilstatusiscompleted, or stop onfailed. - Get a signed URL for the export's
file.idand download the file.
Fields to leave alone
Some request and response models contain fields you will not need, such as payment fields and billing summaries. Leave those alone unless Hearsay tells you otherwise.
The calls of a full collection, in order:
POST /auth/login
POST /case
POST /case/{caseId}/extraction
GET /case/{caseId}/data-status-v2 # poll
GET /conversation/search # optional
POST /conversation/entries/tags/{caseId}/bulk # optional
POST /case/{caseId}/export
GET /case/{caseId}/export?exportId=... # poll
GET /common/file/{fileId}/signed-url