Skip to content

Cases ​

Endpoints for interacting with Cases

The case object ​

Cases can either represent a Person or an Entity. There are different fields available to each type although there are also common fields. The tables below detail the fields available.

Which details a case must have is up to you: choose them with Required Fields. In the tables, ✅ is always required, and Required Fields is required when your Required Fields say so. Until you save Required Fields, a person needs GivenNames or Fullname, and an entity needs EntityName. To create a case with only its documents, for example when you keep the person's details in your own system, first save Required Fields without a name, such as {"name": "none"}. Checks that need no personal details, such as Tamper detection, can then run on it.

Common fields ​

PropertyRequiredMax LengthNotes
URN✅255Identifier of the case. Used to match the case to any object in your system
Type✅Type of the case. Must be either: 'Person' or 'Entity'
stopCaseCreateIfAutoDetectFailsBoolean, if true and one file fails auto detection case will not be created. Not the same as rejectAllIfAutoDetectFailure on document upload

Entity fields ​

PropertyRequiredMax LengthNotes
EntityNameRequired FieldsName of the entity.
EntityTypeId✅Type of the case. Must be either: 'Business' or 'Charity'
EntityRegistrationNumberRequired Fields20Used to store the registration number of the entity like a Company House Id. Must be under 20 characters if supplied

Person fields ​

A person's name is either a full name (Fullname), or given names and a surname (GivenNames and Surname). Their address is either combined (FullAddress), or split across the address lines, postcode and country. The name and address Required Fields say which forms you accept, if either is required.

KYC and Financial vulnerability need GivenNames and Surname, and a split address unless you allow them a combined one with Combined Address Services. A full name isn't split for them. See KYC and Financial vulnerability for what else they need.

Until you save Required Fields, the Portal also asks for a surname with given names, a date of birth and an address when a case is edited. A case created without them can only be edited in the Portal once they're added. An edit in the Portal keeps the address in the form it was given in. To change a case's details through the API, including which form its name and address are in, see Update a case.

PropertyRequiredMax LengthNotes
TitleRequired FieldsOptions: Mr, Miss, Mrs or Dr
GivenNamesRequired Fields40With Surname, the split form of the name.
SurnameRequired Fields40With GivenNames, the split form of the name.
FullnameRequired Fields80The full form of the name.
DOBDayRequired FieldsHas to be a valid date. KYC needs all three parts, and Financial vulnerability all three or none.
DOBMonthRequired FieldsHas to be a valid date. KYC needs all three parts, and Financial vulnerability all three or none.
DOBYearRequired FieldsHas to be a valid date. KYC needs all three parts, and Financial vulnerability all three or none.
GenderRequired FieldsOptions: Male, Female, Other or PreferNotToSay
PhoneNumbersRequired FieldsComma separated list of phone numbers
EmailAddressesRequired FieldsComma separated list of email addresses
Addressline1Required Fields10House Number. When an address is required, this or Addressline2 is needed.
Addressline2Required Fields40House Name. When an address is required, this or Addressline1 is needed.
Addressline340Sub Building (flat, appt)
Addressline450Street
Addressline540Locality
Addressline640Town
Addressline740County
AddressPostcodeRequired Fields10
AddressCountryCode2Required FieldsISO 2 letter country code
FullAddressRequired FieldsThe combined form of the address. We try to split it into the address lines, postcode and country.
CountryOfCitizenshipRequired FieldsISO 2 letter country code
EmployerNameRequired Fields255

Get case ​

Returns case info from a case id.

Endpoint/api/cases/{caseId}
MethodGET

Response ​

json

{
    "id": 229,
    "type": "Person",
    "urn": "testing-123",
    "riskRating":"High",
    "summary":"The case for **Jerry Seinfeld** has been assigned a **high overall risk rating** due to multiple high-risk flags identified during the checks performed on the documents. Specifically, there are **high risk ratings** related to tamper detection and content validation checks, indicating significant concerns regarding the integrity and accuracy of the documents. Additionally, the content validation revealed **medium risks** associated with discrepancies in the date of birth and **low risks** related to address checks. These combined risks necessitate thorough follow-up to ensure compliance and mitigate potential issues.\n\nIn terms of checks performed, both the **Bank Statement #1** and **Passport #1** underwent completed tamper detection and content validation checks. However, critical checks such as **IDV** for both documents remain **not run**, leaving gaps in the risk assessment. While KYC and financial vulnerability checks were completed, the absence of these checks raises concerns about the overall reliability of the gathered information, which could impact the overall risk evaluation process.",
    "assignedUsername": "Warren Russell",
    "title": "Mr",
    "givenNames": "Jerry",
    "surname": "Seinfeld",
    "fullname": "Jerry Seinfeld",
    "dobYear": 1990,
    "dobMonth": 10,
    "dobDay": 10,
    "countryOfCitizenship": "",
    "gender": "Male",
    "genderId": 1,
    "addressLine1": "22",
    "addressLine2": null,
    "addressLine3": null,
    "addressLine4": "Best street",
    "addressLine5": null,
    "addressLine6": "Newport",
    "addressLine7": null,
    "addressPostcode": "123",
    "fullAddress": null,
    "addressCountry": "United Kingdom",
    "addressCountryCode2": "gb",
    "emailAddresses": [],
    "phoneNumbers": []
}

genderId is the numeric id of gender: 1 Male, 2 Female, 3 Other, 4 PreferNotToSay. addressCountry is the name of the country in addressCountryCode2.

type is Person or Entity. An entity case also has entityName, entityType (Business or Charity) and entityRegistrationNumber, which a person case leaves out.

Create case ​

Creates a new case from the information provided in the request body. The endpoint uses a multipart form data request which makes it easy to provide document files.

Something to note is the documents section of the request. It's an array so multiple documents can be provided but form data arrays can be tricky to get working. This is what it looks like uploading two documents in Postman:

Creating a case with multiple documents in Postman

Each document takes the same fields as Upload documents: type, autoDetect, definitionKey, files, isPoaOnly, category1, country and language. See Upload as a defined document for definitionKey. For a payslip that neither prints a currency nor has one from its payroll country, country also sets the currency the Income rule counts its pay in: the country's default currency.

Endpoint/api/cases
MethodPOST
Content typemultipart/form-data

Request ​

Here is creating a case in C#

csharp
public async Task<string> CreateTestCase(string accessToken)
{
    var client = new HttpClient{
        BaseAddress = new Uri("https://api-sandbox.eyedp.com/")
    };

    var document = await File.ReadAllBytesAsync("TestData/test-passport.jpg");

    var fileContent = new ByteArrayContent(document);
    fileContent.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");

    var content = new MultipartFormDataContent{
        { new StringContent("testing-123"), "urn" },
        { new StringContent("Person"), "Type" },
        { new StringContent("true"), "stopCaseCreateIfAutoDetectFails" },
        { new StringContent("Elaine"), "givenNames" },
        { new StringContent("Benes"), "surname" },
        { new StringContent("10"), "dobDay" },
        { new StringContent("01"), "dobMonth" },
        { new StringContent("1990"), "dobYear" },
        { new StringContent("22"), "addressline1" },
        { new StringContent("Best Street"), "addressline4" },
        { new StringContent("Newport"), "addressline6" },
        { new StringContent("12345"), "addresspostcode" },
        { new StringContent("GB"), "addresscountrycode2" },
        { new StringContent("passport"), "documents[0].type" },
        { new StringContent("true"), "documents[0].autoDetect" },
        { fileContent, "documents[0].files", "test-passport.jpg" }
    };

    var request = new HttpRequestMessage(HttpMethod.Post, "/api/cases");
    request.Content = content;
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

    var response = await client.SendAsync(request);

    response.EnsureSuccessStatusCode();

    return await response.Content.ReadAsStringAsync();
}

And the full create case request in Postman:

Creating a case with in Postman

A request without everything your Required Fields need is rejected with a 400 Bad Request (see Bad requests), with a message for each missing detail, and no case is created. In fields, each message is under the fields to fill in: what's missing from the form you've started, or every field of each form you could use if you've given none of the detail. For example, with {"name": "split", "address": "split"} saved, a request with given names and only the postcode of an address:

json
{
  "errors": [
    "Given names and a surname are required.",
    "An address is required: a house number or name, a postcode and a country."
  ],
  "fields": {
    "Surname": ["Given names and a surname are required."],
    "AddressLine1": ["An address is required: a house number or name, a postcode and a country."],
    "AddressLine2": ["An address is required: a house number or name, a postcode and a country."],
    "AddressCountryCode2": ["An address is required: a house number or name, a postcode and a country."]
  }
}

AddressLine1 and AddressLine2 are the house number and house name: either one would do. The keys use the API's own casing, which can differ from the table above (Addressline1, DOBYear), so compare them case-insensitively (see Bad requests). Each missing detail has one of these messages, alongside any other problem with the request. Before you save Required Fields, only the first two can appear.

MissingMessage
A person's name, before you save Required FieldsGiven names or Full name are required
An entity's name, before you save Required FieldsEntity name is required
name, in either formA name is required: a full name, or given names and a surname.
name, splitGiven names and a surname are required.
dateOfBirthA date of birth is required: day, month and year.
address, in either formAn address is required: a house number or name, a postcode and a country, or a full address.
address, splitAn address is required: a house number or name, a postcode and a country.
titleA title is required.
genderA gender is required.
countryOfCitizenshipA country of citizenship is required.
emailAddressesAn email address is required.
phoneNumbersA phone number is required.
employerNameAn employer name is required.
entityNameAn entity name is required.
entityRegistrationNumberA registration number is required.

Response ​

The response contains the id of the created case.

Any document Id's that were successfully created and a list of auto detection failures.

json
{
    "caseId": 827,
    "successDocumentIds": [
        1488
    ],
    "failureDocuments": [
        {
            "fileName": "test_photo.png",
            "error": "Unable to auto-detect document type."
        }
    ]
}

Update a case ​

Changes the details of an existing case, such as to correct a typo or match your own records. The case keeps its history, documents and check results.

Endpoint/api/cases/{caseId}
MethodPATCH
Content typeapplication/merge-patch+json or application/json

An update has the same rules and effects as an edit in the Portal:

  • It's checked against your Required Fields: it can't clear a required detail the case has.
  • It's recorded in the case's history, and sent to your case change webhook with source set to publicApi.
  • Content Validation runs again if the update changes a detail it reads, as after an edit in the Portal (see Content Validation). No other check runs again, so you choose when to run them. Case Progress shows which checks' results are now out of date.
  • An update that changes nothing isn't recorded and sends no webhook.

A case created by uploading documents can't be updated until its documents have been read.

How an update works ​

The body is a JSON merge patch: send only the fields you want to change.

  • A field you leave out stays as it is.
  • A field you send as null is cleared.
  • emailAddresses and phoneNumbers replace the whole list. An empty list clears it.
  • Any other field is an error, including urn, which can't be changed, and the other fields Get case returns that aren't details, such as id or riskRating. So you can't send back a Get case response as it is.
  • Fields for the other type of case are an error, such as dobYear on an entity case.

Nothing is saved unless every field can be applied, and the 400 lists every one that can't.

Name ​

Send the name in one form. Sending fullname removes givenNames and surname, and sending givenNames or surname removes fullname, so you can switch a case from one form to the other. Sending fullname with givenNames or surname is an error.

Address ​

An update keeps an address in the form you gave it:

The case's addressYou can send
NoneEither form, but not both.
Combined, fullAddressA new fullAddress, which we try to split again, or changes to the address lines we split it into. Changing a line makes the address split, and removes fullAddress.
Combined, but we couldn't split itOnly a new fullAddress.
Split into address linesOnly the address lines. You can send just the ones that change, such as addressLine6.

Sending fullAddress as null clears a combined address, and the lines it was split into.

Request ​

FieldTypeCase typeDescription
titlestringPersonSuch as Mr, Miss, Mrs or Dr.
givenNamesstringPersonUp to 40 characters.
surnamestringPersonUp to 40 characters.
fullnamestringPersonUp to 80 characters.
dobDay, dobMonth, dobYearintegerPersonTogether, a valid date that isn't in the future.
genderstringPersonMale, Female, Other or PreferNotToSay.
countryOfCitizenshipstringPersonISO 2 letter country code, such as GB. Get case returns it with the country's name, such as GB - United Kingdom, so send only the code.
emailAddressesarray of stringsPersonReplaces every email address.
phoneNumbersarray of stringsPersonReplaces every phone number.
addressLine1 to addressLine7stringPersonAs in Person fields.
addressPostcodestringPersonUp to 10 characters.
addressCountryCode2stringPersonISO 2 letter country code.
fullAddressstringPersonUp to 255 characters.
entityNamestringEntityThe entity's name.
entityTypestringEntityBusiness or Charity.
entityRegistrationNumberstringEntityUp to 20 characters.
http
PATCH /api/cases/229
Content-Type: application/merge-patch+json

{
    "surname": "Kramer",
    "title": null,
    "addressLine6": "Bristol",
    "emailAddresses": ["[email protected]"]
}

Response ​

200 OK, with the case as Get case returns it, apart from summary. The summary is written by AI from the case as it is, so it's left out rather than making you wait for a new one. Get the case to read it.

json
{
    "id": 229,
    "type": "Person",
    "urn": "testing-123",
    "givenNames": "Jerry",
    "surname": "Kramer",
    "addressLine6": "Bristol",
    "emailAddresses": ["[email protected]"]
}

Errors ​

StatusMeaningWhat to do
400Nothing was saved. fields lists each field that can't be applied and why, keyed by its name in the request (see Bad requests).Correct or remove the fields listed, and send the update again.
403The case belongs to another client.Check the case id.
404There's no case with that id, or it's been deleted.Check the case id.
409This case is still being filled in from its documents. Try again once extraction has finished.Wait for its documents to be read, then send the update again.

For example, sending urn, entityName and an invalid email address to a person case:

json
{
  "errors": [
    "The URN can't be changed.",
    "Doesn't apply to a person case.",
    "Email address invalid"
  ],
  "fields": {
    "urn": ["The URN can't be changed."],
    "entityName": ["Doesn't apply to a person case."],
    "emailAddresses": ["Email address invalid"]
  }
}

A value of the wrong type, such as text in dobYear, is one of those errors too, and that field is left as it is. JSON that can't be read is refused as a whole (see Bad requests). Text with markup in it is refused on its own, as on create.

Delete case ​

Deletes a case and all associated data.

Cases can also be deleted automatically a number of days after they're created. See Data retention.

Once a case is deleted, no more check webhooks are sent for it. See Webhooks.

IMPORTANT

This process is irreversible: The data cannot be recovered.

Endpoint/api/cases/{caseId}
MethodDELETE
Path paramscaseId (integer)

Confirm Case Type ​

Confirms the IsCaseTypeUnconfirmed flag on a Case that was created via document upload, allowing additional checks to be ran.

Neither Content validation nor Document comparison runs on a case until its type is confirmed. Confirming it starts both, if your client runs them automatically (see automatic check settings) and the case has the extracted documents they need, unless Document comparison has already run on the case; otherwise start them with their workflows.

See "Upload documents and Create Case" for more information on Cases in this unconfirmed state.

Endpoint/api/cases/{caseId}/confirm-type
MethodPOST
Path paramscaseId (integer)

Get case documents ​

Retrieves all documents that have been uploaded to a specific case.

Endpoint/api/cases/{caseId}/documents
MethodGET
Path paramscaseId (integer)

Response ​

The response is an array of CaseDocument objects.

CaseDocument schema ​

FieldTypeDescription
idinteger (int64)Unique identifier of the stored document.
namestring (nullable)The original filename or a display name for the document.
documentTypeDocumentTypeEnumThe document classification (passport, utility bill, bank statement, etc.).
definitionIdstringOnly on a defined document: the definition key and version it was processed with, such as uk_council_tax@2.
uploadedTsstring (date-time)Timestamp of when the document was uploaded.

Example response ​

json
[
  {
    "id": 1012,
    "name": "test-passport.jpg",
    "documentType": "Passport",
    "uploadedTs": "2024-01-10T09:12:44Z"
  },
  {
    "id": 1013,
    "name": "utility-bill.png",
    "documentType": "UtilityBill",
    "uploadedTs": "2024-01-10T09:12:44Z"
  },
  {
    "id": 1014,
    "name": "UK council tax bill #1",
    "documentType": "Defined",
    "definitionId": "uk_council_tax@2",
    "uploadedTs": "2024-01-10T09:12:44Z"
  }
]

Error responses ​

StatusDescription
400 Bad RequestReturned when the caseId is invalid, missing, or does not reference an existing case. The response contains a BadRequestResponse object.