# Get borrower case by ID

Endpoint: GET /people/{personId}/cases/{caseId}
Version: 2023-11-29
Security: oauth2, bearerAuth, apiKeyHeader

## Path parameters:

  - `personId` (string, required)
    A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

  - `caseId` (string, required)
    The case object unique identifier.

## Query parameters:

  - `associations` (string)
    Type of related object to return with the case data.
- If null, no references to related objects are inserted into the response.
- If all, insert an array of all relations
- Otherwise insert array of single type.
    Enum: "all", "documents", "cases", "interactions", "loans"

  - `include` (array)
    A comma separated list of field names to include in the response.

## Response 200 fields (application/json):

  - `message` (string)
    Description of the server action or error.

  - `status` (integer)
    HTTP status code.

  - `data` (object)

  - `data.createdAt` (string)

  - `data.deletedAt` (string,null)

  - `data.id` (string)

  - `data.updatedAt` (string,null)

  - `data.associations` (array,null)
    Associated objects of the case.

  - `data.autoCreated` (boolean)
    True if the case was created by some automated method—i.e., not by a human.

  - `data.borrowerIds` (array)
    List of borrower IDs associated with case

  - `data.caseTypeMeta` (object)
    Summary information about the case type configuration which produced the case.

  - `data.caseTypeMeta.base` (string)

  - `data.caseTypeMeta.derivedFromTypeId` (string,null)

  - `data.caseTypeMeta.id` (string)

  - `data.caseTypeMeta.name` (string)

  - `data.caseTypeMeta.version` (integer)

  - `data.companyId` (string)
    The company's ID

  - `data.createdByUser` (object,null)

  - `data.createdByUser.descriptor` (string,null)
    Short description of the user who performed the action.
Different systems may have different data available for a given user. The descriptor
gives the best available short description of the user. It prefers names, then email addresses,
then related IDs.

e.g.,
- "Borrower Tim Jones"
- "Borrower BO-ABCD-1234"
- "Peach Service User"
- "Agent Abigail Smith"
- "Agent bob@acme.com"
- "Agent EM-ABCD-1234"
    Example: "Agent bob@acme.com"

  - `data.createdByUser.employee` (object,null)

  - `data.createdByUser.employee.id` (string)
    The employee's ID

  - `data.createdByUser.id` (string)
    The unique identifier of the user who performed the action.

  - `data.createdByUser.name` (string,null)
    The name of the user who performed the action.

  - `data.createdByUser.userType` (string)
    The type of the user.
    Enum: "agent", "borrower", "service"

  - `data.creatingSupercaseId` (string,null)
    The ID of the supercase if the case was created by one.

  - `data.creationProcedure` (string,null)
    The field indicating which procedure originally created this case.

This is used to mark when a system like, for instance, Compliance Guard 
automatically created a case, which allows a case to be 
differentiated from, for instance, manually created ones.
    Enum: "automatedCollectionsDetection", "automatedOfacDetection", "automatedBankruptcyDetection", "automatedDeceasedDetection", "automatedScraDetection", "supercasePopulationCommit"

  - `data.customFields` (object,null)
    Custom fields are JSON key-value mappings. They are described by a customFieldSchemas property in the corresponding
caseType. This means that arbitrary fields cannot be added to in-flight cases.

  - `data.escalatedAt` (string,null)
    Timestamp of when the case was escalated.

  - `data.escalatedEmployeeId` (string,null)
    The ID of the Employee to which the case should be escalated.

  - `data.escalatedTeamId` (string,null)
    The ID of the Team to which the case should be escalated.

  - `data.escalationIsUrgent` (boolean,null)
    Boolean representing if this escalation is urgent. null if there
is no escalation.

  - `data.externalId` (string,null)
    A lender's identifier for a resource.

After the resource is successfully created, a lender can use the Peach assigned ID OR
the externalId identifiers to fetch the resource.

### Fetching with externalId:

To fetch a resource using an externalId, you MUST use the prefix ext- in the URL.

For example, a loan with an external identifier of ABCDE would be referenced like /api/people/BO-FAKE-IDNT/loans/ext-ABCDE.

### Creating with externalId:

To create a resource with an external identifer, you MUST NOT use the prefix ext-.

For example, if the external identifier should be ABCDE, then pass
{ externalId: "ABCDE", ... } in the request body.

  - `data.lastSubresourceUpdatedAt` (string,null)
    The date-time at which the case or it's subresources were last updated.

A case or case's subresources are considered updated when:

- an attribute of a Case is changed directly—e.g., it's name.
- a Snooze, Do Not Interact, Document Upload Link, or Note is created, deleted or updated.
- an Interaction, Document, Loan, or Transaction is associated or
  unassociated with the case.

  - `data.lastSubresourceUpdatedBy` (object,null)

  - `data.lastViewedAt` (string,null)
    The date-time at which the case was last viewed. 

i.e., when this case last had this request made:
POST /api/people/{borrowerId}/cases/{caseId}/views

  - `data.lastViewedBy` (object,null)

  - `data.lenderAck` (boolean,null)
    The lender has acknowledged the auto-generated case.

  - `data.matchDetails` (object)
    The fields that are for what levels the person is matched to a monitoring hit (i.e. bankruptcy)

  - `data.matchDetails.addressMatch` (string)
    Enum: "match", "partialMatch", "noMatch", "notApplicable"

  - `data.matchDetails.dateOfBirthMatch` (string)
    Enum: "match", "partialMatch", "noMatch", "notApplicable"

  - `data.matchDetails.externalMatchCode` (string,null)

  - `data.matchDetails.last4SSNMatch` (string)
    Enum: "match", "partialMatch", "noMatch", "notApplicable"

  - `data.matchDetails.matchDoneBy` (string)
    Enum: "dataVendor", "peach"

  - `data.matchDetails.nameMatch` (string)
    Enum: "match", "partialMatch", "noMatch", "notApplicable"

  - `data.matchDetails.ssnMatch` (string)
    Enum: "match", "partialMatch", "noMatch", "notApplicable"

  - `data.matchToDataSource` (boolean,null)
    true if the person's details have been matched to an external data source.

  - `data.metaData` (object,null)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `data.name` (string)
    The case name. If a name is not provided, the case name is taken from the case type.
For example, Identity Theft.

  - `data.object` (string)
    Enum: "case"

  - `data.openedAt` (string,null)
    Represents the original date-time a case was created, either within 
Peach or in an external system. For cases created directly in Peach CRM, openedAt is identical to createdAt,
marking the initiation within Peach. Conversely, for cases migrated from external sources, openedAt reflects 
the time the case was originally established in the external system. The timestamp must include a timezone (or UTC offset).

  - `data.outcome` (string,null)
    The outcome of a process, case, complaint, or dispute.
- If found to be valid, set value to approved.
This might impact debt collection efforts.
- If dismissed, set value to denied.
This will have no further impact on debt collection efforts.
- If found to be a false positive, set value to falsePositive.
- If completed without an outcome (or no outcome was needed), set to noOutcome.
    Enum: "approved", "denied", "falsePositive", "noOutcome"

  - `data.outcomeUpdatedAt` (string,null)
    Timestamp of last outcome update.

  - `data.outcomeUpdatedBy` (object,null)

  - `data.owningEmployee` (object,null)
    Metadata about the owning employee of the case. The owning employee is the
preferred employee to process tasks relating to this case.

  - `data.owningEmployee.displayName` (string)
    The display name of the employee that owns this case. The display name is the full name 
of the employee or, if not available, the employee's email.

  - `data.owningEmployee.id` (string)
    The ID of the employee that owns this case.

  - `data.owningEmployee.twilioWorkerSid` (string)
    The Twilio worker SID of the employee that owns this case.

  - `data.owningEmployeeId` (string,null)
    The ID of the employee that owns this case. The case owner is the
preferred employee to process tasks relating to this case.

Case ownership must be enabled via setting
tasks.enableCaseOwnership to true in the company configuration.

  - `data.people` (array)
    List of borrower IDs associated with case

  - `data.snoozedAt` (string,null)
    Time when the case was snoozed.

  - `data.snoozedUntil` (string,null)
    Date until the case is snoozed.

  - `data.status` (string)
    The status of a process. This can be updated by a lender or by Peach.

initiated - The lender was notified by a borrower, but no documents or
evidence have been provided yet. A grace period can be set.

processing - Peach matched the borrower to an external data source, or the
lender started an internal process to handle a case, complaint or dispute.

completed - The lender completed an internal process, case, complaint or
dispute. For example:
- A borrower reported identity theft, and the lender reviewed documents
and approved the claim.
- A borrower requested a verification of debt in writing, and the lender sent an email with
details.
- Peach notified the lender about a new bankruptcy, and the lender reviewed
the case and deemed it to be a false positive.

canceled - The lender couldn't complete an internal process and canceled
it. This can happen for various reasons, such as lack of
sufficient documentation.

reopened - The lender re-opened the case.
    Enum: "initiated", "processing", "completed", "canceled", "reopened"

  - `data.statusUpdatedAt` (string,null)
    Timestamp of the last status update.

  - `data.statusUpdatedBy` (object,null)

  - `data.workflowId` (string,null)
    The ID of the workflow instance assigned to this case.

  - `data.typeId` (string, required)
    Unique identifier of the case type.


