Input validation and output formatting in DX API

Hello

Please provide your thoughts on the 2 points below.

In the Create Case API in DX API v2 (/api/application/v2/cases), is it possible to

  1. Add mandatory field validations and other types of validations on the attributes in the input JSON request? If yes, how?

  2. Customize the response to send more business friendly messages and other details based on implementation?

Thanks in advance for sharing your inputs.

I recommend you to go step by step before passing the input fields.

Step1: {
“caseTypeID”: “ABC-AppName-Work-DXExample”,
“content”: {},
“processID”: “pyStartCase”
}

Step2 : If Step1 works, define the AllowedStartingFields data transform and send the data. Follow the below links for more information.

With DX API v2, validation remains server‑side and rule‑driven.

Implement the AllowedStartingFields data transform on the case type class. It whitelists the scalar/page/page‑list fields that the Create Case API is allowed to take in content, pageInstructions, and attachments.

Alternatively you can also add a validate rule in the case start process for mandatory checks add meaningful messages (Message/Field Value).

On error, DX v2 returns 422 with errorDetails. You typically customize what messages get added and how they’re localized, rather than rewriting the whole JSON structure. Use Message rules, Field Values, and your Validate logic to compose business‑friendly text. Those messages end up in the DX errorDetails[].localizedValue the client receives.
PFB the links for reference-