# Records

Records are actual data instances belonging to a CaraerObject. They contain property values that conform to the object's schema defined by Properties. Records support dynamic relationships via Relations, enabling graph-like data modeling where Records can reference and navigate to related Records. Records can be filtered, sorted, paginated, and displayed in various views (table, flow, page, preview). They support extending (association with multiple objects), soft deletion with restore capability, and property parsing for formatted display. Records are the core data entities that users create, update, and manage. Each Record has a UUID, belongs to a primary Object, can have extended objects (making it visible in multiple object contexts), and maintains createdAt/updatedAt timestamps. Records enable the platform's dynamic, content-driven data management.

## Get record details

 - [GET /api/v2/records/{uuid}](https://developer.caraer.com/apis/records/show.md): Retrieves detailed information about a record by its UUID. Returns a ShowResponse containing the record details. Prefer GET /{objectName}/{uuid} when the object context is known.

## Update a record by UUID

 - [PUT /api/v2/records/{uuid}](https://developer.caraer.com/apis/records/updatebyuuid.md): Updates a record identified by UUID. Optional object query param resolves the object context (same as GET /{uuid}?object=...). When omitted, the record's current/primary object is used. Prefer PUT /{objectName}/{uuid} when the object context is known.

## Delete a record

 - [DELETE /api/v2/records/{uuid}](https://developer.caraer.com/apis/records/delete.md): Deletes a record specified by its UUID.

## Get record details by object

 - [GET /api/v2/records/{objectName}/{uuid}](https://developer.caraer.com/apis/records/showbyobject.md): Retrieves a record by object name and UUID. Same response as GET /{uuid}?object={objectName}.

## Update a record

 - [PUT /api/v2/records/{objectName}/{uuid}](https://developer.caraer.com/apis/records/update.md): Updates a record's details identified by its UUID. The record data is provided as a RecordDTO. Returns an UpdateResponse with the updated record. Validation: Record properties are validated according to the property rules defined for the object. Each property may have validation rules such as required, type constraints, character limits, uniqueness, etc.

## Bulk create or update records

 - [PUT /api/v2/records/{objectName}/bulk](https://developer.caraer.com/apis/records/bulkedit.md): Creates or updates multiple records in one request. Returns HTTP 201 when every item succeeds (no per-record errors). Returns HTTP 200 when one or more items fail validation; successful items are still persisted and listed in data.records, with failures in errors.

## Restore a deleted record

 - [POST /api/v2/records/{uuid}/restore](https://developer.caraer.com/apis/records/restore.md): Restores a soft-deleted record identified by its UUID. Returns a SuccessResponse confirming that the record has been restored.

## Extend a record

 - [POST /api/v2/records/{uuid}/extend](https://developer.caraer.com/apis/records/extend.md): Extends a record identified by its UUID to one or more objects. You can use this to move a record or add it to another object so it'll be visible in the new object.Returns a SuccessResponse confirming that the record has been extended.

## Create a new record

 - [POST /api/v2/records/{objectName}](https://developer.caraer.com/apis/records/create.md): Creates a new record for the specified object using the provided RecordDTO data. Returns a CreateResponse with the newly created record. Validation: Record properties are validated according to the property rules defined for the object. Each property may have validation rules such as required, type constraints, character limits, uniqueness, etc.

## Create or update a record

 - [POST /api/v2/records/{objectName}/createOrUpdate](https://developer.caraer.com/apis/records/createorupdate.md): Creates a new record or updates an existing one. Match order: body/path uuid already in the graph, then unique property values. If a matching record exists, it is updated; otherwise, a new record is created. Returns a CreateResponse or UpdateResponse with the record details. Validation: Record properties are validated according to the property rules defined for the object. Each property may have validation rules such as required, type constraints, character limits, uniqueness, etc.

## Bulk delete records

 - [POST /api/v2/records/{objectName}/bulk-delete](https://developer.caraer.com/apis/records/bulkdelete.md): Archives, anonymizes, or permanently deletes multiple records in one request. Returns HTTP 200 when every item succeeds. Returns HTTP 200 with per-record errors when one or more items fail; successful items are still applied and listed in data.uuids.

## Search records

 - [POST /api/v2/records/search](https://developer.caraer.com/apis/records/search.md): Performs a search for records based on the specified criteria in the request body. Returns a PaginationResponse containing matching records.

## Search records across objects

 - [POST /api/v2/records/search/cross-object](https://developer.caraer.com/apis/records/searchcrossobject.md): Searches records across multiple object types in one request. Use fromObjectUuid + relationName to limit to relation target objects (e.g. event attendees), or objectUuids for an explicit list, or omit both to search all company objects (capped). Returns preview-shaped results suitable for relation pickers.

## Create a relation between records

 - [POST /api/v2/records/relations/{fromUuid}/{relationName}/{toUuid}](https://developer.caraer.com/apis/records/createrelation.md): Creates a relation between two records identified by their UUIDs using the provided relation name.

## Delete a relation between records

 - [DELETE /api/v2/records/relations/{fromUuid}/{relationName}/{toUuid}](https://developer.caraer.com/apis/records/deleterelation.md): Deletes a relation between two records identified by their UUIDs and the relation name.

## Update relation edge properties

 - [PATCH /api/v2/records/relations/{fromUuid}/{relationName}/{toUuid}](https://developer.caraer.com/apis/records/updaterelationedge.md): Patches values stored on an existing relation edge. Only keys present in edgeProperties are written; a null value clears a key.

## Advanced graph-aware record query

 - [POST /api/v2/records/query](https://developer.caraer.com/apis/records/query.md): Executes a two-pass GraphRAG query using natural language or a declarative plan. Returns records with scores and graph evidence.

## Fetch paginated records

 - [POST /api/v2/records/index](https://developer.caraer.com/apis/records/index.md): Retrieves a paginated list of records. If a preview type is specified in the request, returns records formatted for preview; otherwise, returns full record details.

## Fetch records for table view

 - [POST /api/v2/records/index/table](https://developer.caraer.com/apis/records/indextable.md): Retrieves records formatted for table display. Returns a PaginationResponse containing records formatted for table view.

## Fetch records for page view

 - [POST /api/v2/records/index/page](https://developer.caraer.com/apis/records/indexpage.md): Retrieves a paginated list of webpages for page view. The search query is temporarily removed from the pagination request and passed separately. Returns a PaginationResponse containing WebpageDTO objects.

## Fetch records for flow view

 - [POST /api/v2/records/index/flow](https://developer.caraer.com/apis/records/indexflow.md): Retrieves a list of records formatted for flow view based on a specific property. If the property is not provided in the request, defaults to the 'status' property of the main object. Returns a SuccessResponse containing the flow records.

## Suggest analytics widgets with AI

 - [POST /api/v2/records/analytics/suggest-widgets](https://developer.caraer.com/apis/records/suggestanalyticswidgets.md): Uses structured OpenAI output plus schema validation to propose dashboard charts for an object. Returns an empty list when AI is unavailable.

## Aggregate records for analytics charts

 - [POST /api/v2/records/aggregate](https://developer.caraer.com/apis/records/aggregate.md): Groups Neo4j records by property or time bucket and returns series points with optional drilldown filters.

## Batch aggregate records for analytics dashboards

 - [POST /api/v2/records/aggregate/batch](https://developer.caraer.com/apis/records/aggregatebatch.md): Runs multiple aggregation requests for dashboard widgets.

## Get record preview

 - [GET /api/v2/records/{uuid}/previews/{name}](https://developer.caraer.com/apis/records/preview.md): Retrieves a preview for a record specified by its UUID and preview name. Returns a ShowResponse containing the preview data.

