{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeliner/json-schema/pipeliner-custom-entity-schema.json",
  "title": "CustomEntity",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeliner-custom-entity-api-openapi.yml#/components/schemas/CustomEntity",
  "properties": {
    "is_delete_protected": {
      "type": "boolean",
      "description": "Tells if the entity instance is protected against delete (Entities that need to be present in the system at any time). Delete action still may fail if entity is deletable, due some other additional validations.",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier of entity.",
      "readOnly": true
    },
    "is_deleted": {
      "type": "boolean",
      "description": "Specifies if the entity is considered deleted.",
      "readOnly": true
    },
    "modified": {
      "type": "string",
      "format": "date-time",
      "description": "Last modification time.",
      "readOnly": true
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "readOnly": true
    },
    "currency_exchange_rates_list": {
      "type": "string",
      "format": "uri",
      "description": "Currency exchange rate list used to convert monetary fields linked to this record. Empty to inherit the team space default.\n\nRelation to CurrencyExchangeRatesList. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'CurrencyExchangeRatesList' object for properties."
    },
    "owner": {
      "type": "string",
      "format": "uri",
      "description": "Sales user who owns this custom entity record.\n\nRelation to Client. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Client' object for properties."
    },
    "type": {
      "type": "string",
      "format": "uri",
      "description": "Custom entity type that classifies this record. Custom entity types are configurable per team space and define the schema (fields and form) of the records.\n\nRelation to CustomEntityType. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'CustomEntityType' object for properties."
    },
    "unit": {
      "type": "string",
      "format": "uri",
      "description": "Sales unit this record is assigned to. Determines which team members can see the record under unit-based sharing.\n\nRelation to SalesUnit. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'SalesUnit' object for properties."
    },
    "currency_exchange_rates_list_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the currency exchange rate list applied to this record."
    },
    "name": {
      "type": "string",
      "description": "Name of the entity and its default text representation."
    },
    "owner_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the record owner."
    },
    "share_mode": {
      "type": "integer",
      "description": "Sharing model applied on top of the owner/unit visibility (e.g. shared with selected sales units or selected users).\n\nInteger enum value: 0 - Standard, 1 - Private, 2 - AllView, 3 - AllEdit",
      "enum": [
        0,
        1,
        2,
        3
      ]
    },
    "table_name": {
      "type": "string",
      "description": "Discriminator identifying which custom entity type this record belongs to. Read-only; matches CustomEntityType.entity_api_name and is used as the entity name in REST and GraphQL queries.",
      "readOnly": true
    },
    "type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the custom entity type."
    },
    "unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the sales unit."
    },
    "sharing_units": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to CustomEntitySharingSalesUnitRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'CustomEntitySharingSalesUnitRelation' object for properties."
      },
      "description": "Sales units that have been granted shared access to this custom entity record. Editable only when share_mode allows unit sharing."
    },
    "sharing_clients": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to CustomEntitySharingClientRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'CustomEntitySharingClientRelation' object for properties."
      },
      "description": "Users that have been granted shared access to this custom entity record. Editable only when share_mode allows user sharing."
    },
    "documents": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to CloudObjectRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'CloudObjectRelation' object for properties."
      },
      "description": "Documents linked to this custom entity record."
    },
    "static_profiles": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to ProfileRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'ProfileRelation' object for properties."
      },
      "description": "Saved view profiles this custom entity record currently matches."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to TagRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'TagRelation' object for properties."
      },
      "description": "Tag labels applied to this custom entity record."
    },
    "is_favorite": {
      "type": "boolean",
      "description": "True when the current authenticated user has marked this record as favorite. Per-user."
    },
    "revision": {
      "type": "integer",
      "format": "int32",
      "description": "Revision when entity was lastly changed."
    }
  },
  "required": [
    "is_delete_protected",
    "id",
    "owner",
    "type",
    "unit",
    "owner_id",
    "table_name",
    "is_favorite"
  ]
}