Skip to content

Hierarchical records creation endpoints ​

Building complex data hierarchies no longer requires juggling multiple API calls or meticulously tracking relationships. Legal and financial systems inherently rely on complex data hierarchies - law firms manage cases with multiple clients, each tied to contracts, documents, and payments, while banks process loan applications linked to applicants, co-applicants, and verification records.

Previously, constructing these relationships required step-by-step API calls, increasing the risk of errors and inefficiencies. Now, with our new hierarchical record creation endpoint, you can build entire parent-child structures in a single request, ensuring data consistency, streamlining operations, and significantly reducing processing time:

POST /api/object-models/{model_id}/object-records/descendants/

Request details ​

The request body defines a hierarchical structure where each record has an object_class, associated fields, and optional children:

{  
"object_class": <int>,  
"field_<field_alias>": <any_allowed>,  
"...": "...",  
"children": [  
  {  
   "object_class": <int>,  
   "field_<field_alias>": <any_allowed>,  
   "...": "...",  
   "children": [  
    {  
     "object_class": <int>,  
     "field_<field_alias>": <any_allowed>,  
     "...": "...",  
     "children": []  
    }  
   ]  
 },  
 {  
 "object_class": <int>,  
 "field_<field_alias>": <any_allowed>,  
  "...": "...",  
  "children": []  
  }  
 ]  
}

The field_<field_alias> fields are optional - they depend on the object class configuration and represent class fields.

Nested children arrays define parent-child relationships.

You can create multiple levels of hierarchy in a single request.

Response and processing ​

When you submit the request, it is processed asynchronously, and you receive an immediate response:

{
  "id": 12345,
  "status": "queued",
  "url": "https://{domain}/api/object-models/{model_id}/object-records/transactions/12345/"
}

Response fields:

  • id - unique identifier for the transaction.
  • status - initially set to queued, indicating the request is being processed.
  • url - provides a link to check the transaction status.

To check the processing status, send a request to:

GET /api/object-models/{model_id}/object-records/transactions/{transaction_id}/

Possible statuses:

  • queued - the request is waiting to be processed.
  • processing - the records and relationships are being created.
  • completed - all records have been successfully created.
  • failed - validation errors occurred, and records were not created.

Example response:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing"
}

Validation and ownership ​

If the request fails, it will return failed status. Common reasons include:

  • Standard validation errors for creating object records.
  • Relationship validation issues between parent and child records.
  • Incorrect field values or missing required fields.

No records will be created if validation fails.

The user who submits the request becomes the owner of all created records.

History events ​

Standard history events are logged:

  • owner_initialized - Ownership assigned.
  • record_created - Records successfully created.

The world of complex data structures just got much simpler. Legal cases with intricate client documentation trees, financial applications with multi-layered verifications, and healthcare records with branching patient histories - all can now materialise through a single API call.