{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeliner/json-schema/pipeliner-approval-schema.json",
  "title": "Approval",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeliner-approval-api-openapi.yml#/components/schemas/Approval",
  "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
    },
    "account": {
      "type": "string",
      "format": "uri",
      "description": "Account the approval is requested on, when the trigger record is an Account.\n\nRelation to Account. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Account' object for properties."
    },
    "actor": {
      "type": "string",
      "format": "uri",
      "description": "User who triggered the approval, or empty when triggered automatically.\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."
    },
    "application": {
      "type": "string",
      "format": "uri",
      "description": "Application context the approval was triggered in.\n\nRelation to Application. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Application' object for properties."
    },
    "approval_process": {
      "type": "string",
      "format": "uri",
      "description": "Approval process this approval was raised from.\n\nRelation to ApprovalProcess. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'ApprovalProcess' object for properties."
    },
    "contact": {
      "type": "string",
      "format": "uri",
      "description": "Contact the approval is requested on, when the trigger record is a Contact.\n\nRelation to Contact. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Contact' object for properties."
    },
    "lead": {
      "type": "string",
      "format": "uri",
      "description": "Lead the approval is requested on. Set when lead_oppty_id resolves to a Lead.\n\nRelation to Lead. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Lead' object for properties."
    },
    "oppty": {
      "type": "string",
      "format": "uri",
      "description": "Opportunity the approval is requested on. Set when lead_oppty_id resolves to an Opportunity.\n\nRelation to Opportunity. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Opportunity' object for properties."
    },
    "quote": {
      "type": "string",
      "format": "uri",
      "description": "Quote the approval is requested on, when the trigger record is a Quote.\n\nRelation to Quote. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Quote' object for properties."
    },
    "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked account."
    },
    "actor_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the triggering user."
    },
    "application_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the application."
    },
    "approval_process_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the approval process."
    },
    "approval_status": {
      "type": "integer",
      "description": "Field whose values are strictly defined with an enumeration of values.\n\nInteger enum value: 0 - Pending, 1 - Approved, 2 - Rejected",
      "enum": [
        0,
        1,
        2
      ]
    },
    "comment": {
      "type": "string",
      "description": "Comment the requester attached when raising the approval."
    },
    "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked contact."
    },
    "end_time": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp the approval reached a final status (Approved/Rejected/Cancelled). Empty while the approval is still pending."
    },
    "lead_oppty_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked lead or opportunity, or empty when not linked."
    },
    "quote_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked quote."
    },
    "settings": {
      "type": "object",
      "description": "Snapshot of the approval process schema at the time the approval was raised. Frozen so subsequent changes to the parent approval process do not affect this run."
    },
    "status": {
      "type": "integer",
      "description": "Field whose values are strictly defined with an enumeration of values.\n\nInteger enum value: 1 - Ok, 2 - Warning, 3 - Error, 4 - Scheduled, 5 - Expired",
      "enum": [
        1,
        2,
        3,
        4,
        5
      ]
    },
    "revision": {
      "type": "integer",
      "format": "int32",
      "description": "Revision when entity was lastly changed."
    },
    "approvers": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to ApprovalApprover. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'ApprovalApprover' object for properties."
      },
      "description": "Users who must respond to the approval, with their individual responses."
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "Relation to ApprovalProcessActivityLogLine. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'ApprovalProcessActivityLogLine' object for properties."
      },
      "description": "Activity log lines describing the steps taken on this approval (visible only)."
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp the approval was raised (alias of created)."
    }
  },
  "required": [
    "is_delete_protected",
    "id",
    "application",
    "approval_process",
    "application_id",
    "approval_process_id",
    "settings"
  ]
}