Skip to content

Update type

Request

A PUT request is used to update an existing type configuration. While the type is in draft status requests can move it to active. Setting the status to deprecated will immediately hide it from future GET all requests, and spawn a draft replica which can be edited and published in its place.

Security
oauth2(Required scopes: case.type:update) or bearerAuth or apiKeyHeader
Path
caseTypeIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The case type unique identifier.

Query
versioninteger, (int32)

Optional argument. If provided, the action will be performed on the specified version.

Bodyapplication/jsonrequired
descriptionstring, <= 500 characters

The description for instances of that type. The description could be shown in UI.

Default:""
namestring, <= 50 characters

The default name for instances of that type. The name could be shown in UI.

Default:""
statusstring

The type status. A new type is normally created in the draft status. After you finish with the type configurations and ready to create instances of that type, update the status to active.

You can also update an existing type. Each update will create a new version of the type. Only one version of the type can be active. We'll automatically change the previous version to deprecated. Instances in-flight will continue to use the previous version(s). New instances will be created using the active version.

Default:"draft"
Enum:"draft""active""deprecated"
customFieldSchemasArray of objects or null(customFieldSchema)

Array of custom fields definitions.

loanTypeIdstring

The optional identifier of a loan type. This is useful when a lender has two or more financial products and need different case types per product.

smartReviewsobject
workflowTypeIdstring

The optional identifier of a workflow type. Instances of the workflow type are created for processing cases of this type.

PUT
/case-types/{caseTypeId}
curl -i -X PUT \
  'https://sandboxapi.peach.finance/api/case-types/{caseTypeId}?version=0' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "",
    "name": "",
    "status": "draft",
    "customFieldSchemas": [
      {
        "dataType": "integer",
        "default": 0,
        "description": "",
        "displayOrder": 0,
        "displayPostfix": "string",
        "displayPrefix": "string",
        "fieldName": "string",
        "name": "",
        "required": false,
        "validation": {
          "enum": [
            1,
            10,
            100
          ],
          "length": 1,
          "maxValue": 100,
          "minValue": 0
        }
      }
    ],
    "loanTypeId": "string",
    "smartReviews": {
      "config": {},
      "enable": true
    },
    "workflowTypeId": "string"
  }'

Responses

Success

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(caseType)
Response
{ "message": "string", "status": 0, "data": { "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "companyId": "string", "createdBy": 0, "deprecatedAt": "2019-08-24T14:15:22Z", "deprecatedBy": 0, "deprecationMessage": "string", "derivedFromTypeId": "0", "description": "", "name": "", "publishedAt": "2019-08-24T14:15:22Z", "publishedBy": 0, "status": "draft", "version": 1, "associations": [], "customFieldSchemas": [], "loanTypeId": "string", "object": "caseType", "smartReviews": {}, "workflowTypeId": "string" } }