# Objects

CaraerObjects are schema definitions for dynamic domain entities (e.g., "Candidate", "Vacancy", "Company"). They define the structure and behavior of Records through Properties (field definitions), Relations (connections to other objects), Views (display configurations), and Traits (behavioral features like Flow, Table, Webpage, User). Objects enable a flexible, schema-on-read data model where entities can be customized per company without code changes. Each Object has a name (lowercase identifier), label (display name), plural form, description, icon, and can be organized into groups. Objects can have traits that add specific behaviors: Flow enables kanban-style workflows, Table provides tabular data views, Webpage allows Records to have public-facing pages, and User enables authentication and user profiles. Objects are the foundation of the platform's dynamic data modeling system.

## Get object by UUID

 - [GET /api/v2/objects/{uuid}](https://developer.caraer.com/apis/objects/getobject.md): Fetches a single object by its UUID. Optional parameters determine whether to include views, properties, and relations in the response.

## Update object by UUID

 - [PUT /api/v2/objects/{uuid}](https://developer.caraer.com/apis/objects/updateobject.md): Updates an existing object identified by its UUID with new details. Optional parameters determine if views, properties, and relations should be included in the response. Validation rules: label (required, must be a string, maximum 32 characters), plural (required, must be a string, maximum 32 characters), name (required, must be a string, must be lowercase, must be unique, must match name pattern (lowercase letters, numbers, underscores), cannot be changed after creation), description (optional, maximum 255 characters), groups (required, must be an array of string, no duplicate values allowed), showInMenu (required, must be a boolean).

## Delete object by UUID

 - [DELETE /api/v2/objects/{uuid}](https://developer.caraer.com/apis/objects/deleteobject.md): Deletes a specific object identified by its UUID.

## Update object indices

 - [PUT /api/v2/objects/updateIndices](https://developer.caraer.com/apis/objects/updateindices_3.md): Updates indices of objects based on the provided mapping. The request body should contain a mapping of object UUIDs to index values. Optional request parameters determine if views, properties, and relations should be included in the response.

## Sync morph objects for existing records

 - [POST /api/v2/objects/{uuid}/syncMorphObjects](https://developer.caraer.com/apis/objects/syncmorphobjects.md): Synchronizes existing records for an object after morph configuration changes. The object path variable accepts UUID or object name. Records that reference the object as primary object, morph object, or label are re-morphed.

## Get specific preview by name

 - [GET /api/v2/objects/{uuid}/previews/{name}](https://developer.caraer.com/apis/objects/getpreview.md): Fetches a preview for an object by the object's UUID and the preview name. Returns the preview data wrapped in a ShowResponse.

## Save object preview

 - [POST /api/v2/objects/{uuid}/previews/{name}](https://developer.caraer.com/apis/objects/savepreview.md): Creates or updates a preview for a specific object. The preview type is determined by the 'name' path variable. Depending on the preview type (e.g., 'detail', 'flow', 'pill', or 'page'), the request body will be mapped to the corresponding PreviewDTO and converted to the appropriate Preview model.

## Grant object record access

 - [POST /api/v2/objects/{objectUuid}/access-grant](https://developer.caraer.com/apis/objects/grantobjectaccess.md): Accepts a request to grant record-level scopes on the object to selected users, teams, and installed apps. Validation runs synchronously; grants are applied asynchronously. Returns 202 Accepted on success.

## Get all previews over all objects

 - [POST /api/v2/objects/previews](https://developer.caraer.com/apis/objects/getpreviews.md): Fetches all previews over all objects. Returns a PaginationResponse containing a list of preview DTOs.

## Fetch paginated objects

 - [POST /api/v2/objects/index](https://developer.caraer.com/apis/objects/getobjects.md): Fetches a paginated list of objects, optionally including views, properties, and/or relations. The request body should contain pagination details such as limit, page, filters, sort, and query.

## Create new object

 - [POST /api/v2/objects/](https://developer.caraer.com/apis/objects/createobject.md): Creates a new Caraer object using the provided details. Optional request parameters specify whether to include views, properties, and relations in the response. Validation rules: label (required, must be a string, maximum 32 characters), plural (required, must be a string, maximum 32 characters), name (required, must be a string, must be lowercase, must be unique, must match name pattern (lowercase letters, numbers, underscores)), description (optional, maximum 255 characters), groups (required, must be an array of string, no duplicate values allowed), showInMenu (required, must be a boolean).

## Get all previews of an object

 - [GET /api/v2/objects/{uuid}/previews](https://developer.caraer.com/apis/objects/getpreviews_1.md): Fetches all previews associated with a specific object. Returns a PaginationResponse containing a list of preview DTOs.

## List access grant candidates

 - [GET /api/v2/objects/access-grant/candidates](https://developer.caraer.com/apis/objects/getaccessgrantcandidates.md): Returns all company users, teams, and installed apps that can receive record access on an object.

## Permanently delete archived object

 - [DELETE /api/v2/objects/{uuid}/permanent](https://developer.caraer.com/apis/objects/permanentlydeletearchivedobject.md): Hard-deletes a soft-deleted object. Only objects with deletedAt set can be removed.

