> ## Documentation Index
> Fetch the complete documentation index at: https://docs.herondata.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the policy evaluations for an end user

> Evaluates the user's policies against end user on-the-fly




## OpenAPI

````yaml https://app.herondata.io/swagger get /api/end_users/{end_user_id_or_heron_id}/policy_evaluations
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/{end_user_id_or_heron_id}/policy_evaluations:
    get:
      tags:
        - Policy
      summary: Get the policy evaluations for an end user
      description: |
        Evaluates the user's policies against end user on-the-fly
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PolicyEvaluationSchema'
                type: array
          description: Ok
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PolicyEvaluationSchema:
      properties:
        branch:
          allOf:
            - $ref: '#/components/schemas/EvaluatedBranch'
          description: >-
            The branch the deal reached - the first whose condition passed, else
            the default, or one whose condition can't be evaluated
            (condition_unavailable: true). Null for a section with no branches
            (only shared checks), one not yet evaluated, or no match with no
            default
          nullable: true
          readOnly: true
        condition_evaluations:
          description: >-
            The branch conditions evaluated, in order, up to the one that
            matched. They choose the branch and never fail the section. Empty
            for a section without branches
          items:
            $ref: '#/components/schemas/ConditionEvaluation'
          readOnly: true
          type: array
        decision_time_seconds:
          description: >-
            Seconds from intake to decision, measured across the workflow run
            that produced this evaluation. Null unless that run completed -
            still running, failed, a dry run, or evaluated outside a workflow. A
            restarted deal is timed from the restart
          nullable: true
          readOnly: true
          type: number
        failed_checks:
          items:
            $ref: '#/components/schemas/CheckEvaluation'
          type: array
        missing_data_checks:
          items:
            $ref: '#/components/schemas/CheckEvaluation'
          type: array
        pass_status:
          description: >-
            Where the evaluation pass this row belongs to has got to. Null when
            the deal was evaluated outside a workflow, or by a policy with no
            active version
          enum:
            - in_progress
            - completed
            - failed
            - null
          nullable: true
          readOnly: true
        passed_checks:
          items:
            $ref: '#/components/schemas/CheckEvaluation'
          type: array
        policy:
          $ref: '#/components/schemas/PolicySchema'
        policy_version:
          nullable: true
          readOnly: true
          type: integer
        result:
          description: >-
            The section's verdict. Null when the evaluation pass has not decided
            this section yet - read it with `pass_status`, which is
            `in_progress` for those rows
          enum:
            - passed
            - failed
            - review_required
            - missing_data
            - execution_error
            - skipped
            - null
          nullable: true
      type: object
    EvaluatedBranch:
      properties:
        condition_unavailable:
          description: >-
            True when the branch's condition uses an attribute or check that no
            longer exists, so it can't be evaluated: the deal stopped here
            without knowing whether it matched, none of its checks ran, and the
            section is missing data
          readOnly: true
        heron_id:
          description: >-
            Stable across renames, so route or compare on this rather than the
            name
          readOnly: true
          type: string
        name:
          readOnly: true
          type: string
      type: object
    ConditionEvaluation:
      properties:
        attribute_value:
          allOf:
            - $ref: '#/components/schemas/CompanyAttributeValue'
          nullable: true
          readOnly: true
        check:
          allOf:
            - $ref: '#/components/schemas/Check'
          readOnly: true
        matched:
          description: >-
            Whether the condition passed and chose its branch. One that did not
            is not a failed check
          readOnly: true
      type: object
    CheckEvaluation:
      properties:
        attribute_value:
          allOf:
            - $ref: '#/components/schemas/CompanyAttributeValue'
          nullable: true
        check:
          allOf:
            - $ref: '#/components/schemas/Check'
          nullable: true
        effective_result:
          description: >-
            The check's result after failure routing: `review_required` for a
            tripped check whose on_failure is review_required (and not
            auto_decline), else the same as `result`
          enum:
            - pass
            - failed
            - review_required
            - missing_data
          readOnly: true
        evaluations:
          items:
            $ref: '#/components/schemas/CheckEvaluation'
          nullable: true
          type: array
        reason:
          description: >-
            Only populated for customers on policy versions, and only for
            company-attribute checks
          nullable: true
          readOnly: true
          type: string
        result:
          enum:
            - pass
            - failed
            - review_required
            - missing_data
      type: object
    PolicySchema:
      properties:
        checks:
          items:
            $ref: '#/components/schemas/Check'
          type: array
        display_order:
          nullable: true
          type: integer
        heron_id:
          type: string
        name:
          type: string
        use_case:
          enum:
            - background_check
            - cashflow
      required:
        - heron_id
        - name
      type: object
    CompanyAttributeValue:
      properties:
        evidence:
          allOf:
            - $ref: '#/components/schemas/AttributeEvidence'
          description: >-
            Where the value came from, so a reviewer can see what produced it -
            the source records for a background-check finding, the positions
            behind a holdback. Null for attributes that cite nothing
          nullable: true
        value:
          description: >-
            The value, stringified whatever the attribute's type: "3",
            "12500.00", "true", "1999-01-01". Null when the deal has no data for
            this attribute
          type: string
      type: object
    Check:
      properties:
        attribute_description:
          description: >-
            What the attribute measures. Present only for accounts on policy
            versions
          nullable: true
          type: string
        attribute_display_name:
          description: >-
            The attribute's human-readable name. Present only for accounts on
            policy versions
          nullable: true
          type: string
        attribute_label:
          nullable: true
          type: string
        attribute_unit:
          description: >-
            The unit of `attribute_label`, for formatting the attribute's value
            and the check's threshold. Null for a check without an attribute or
            an attribute with no declared unit
          enum:
            - currency
            - percentage
            - count
            - ratio
            - days
            - text
            - null
          nullable: true
        attribute_value_set:
          description: >-
            The vocabulary `attribute_label` draws from, so the editor can offer
            a dropdown. Keys into the /policy_value_sets response. Null for free
            text
          enum:
            - us_state
            - naics_industry
            - restricted_industries
            - null
          nullable: true
        boolean_check:
          allOf:
            - $ref: '#/components/schemas/BooleanCheck'
          nullable: true
        composite_check:
          allOf:
            - $ref: '#/components/schemas/CompositeCheck'
          nullable: true
        date_check:
          allOf:
            - $ref: '#/components/schemas/DateCheck'
          nullable: true
        date_delta_to_now_check:
          allOf:
            - $ref: '#/components/schemas/DateDeltaToNowCheck'
          nullable: true
        enhanced_sql_check:
          allOf:
            - $ref: '#/components/schemas/EnhancedSQLCheck'
          nullable: true
        group:
          nullable: true
          type: string
        identity:
          description: Stable kind:key identity used to match stored check evaluations
          nullable: true
          readOnly: true
          type: string
        name:
          nullable: true
          type: string
        numeric_check:
          allOf:
            - $ref: '#/components/schemas/NumericCheck'
          nullable: true
        parameters:
          additionalProperties:
            type: string
          nullable: true
          type: object
        sql_check:
          allOf:
            - $ref: '#/components/schemas/SQLCheck'
          nullable: true
        string_check:
          allOf:
            - $ref: '#/components/schemas/StringCheck'
          nullable: true
      type: object
    AttributeEvidence:
      properties:
        record_indices:
          items:
            type: integer
          nullable: true
          type: array
        section:
          nullable: true
          type: string
        source_id:
          nullable: true
          type: string
        source_ids:
          items:
            type: string
          nullable: true
          type: array
        source_type:
          type: string
      type: object
    BooleanCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        value:
          type: boolean
      type: object
    CompositeCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        checks:
          items:
            $ref: '#/components/schemas/Check'
          type: array
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        type:
          enum:
            - AND
            - OR
      type: object
    DateCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        type:
          enum:
            - equal
            - not_equal
            - before
            - before_or_on
            - after
            - after_or_on
        value:
          format: date
          type: string
      type: object
    DateDeltaToNowCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        pass_if_value_missing:
          default: false
          type: boolean
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        type:
          enum:
            - greater_than
            - greater_than_or_equal
            - less_than
            - less_than_or_equal
        value:
          additionalProperties: {}
          nullable: true
          type: object
      type: object
    EnhancedSQLCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        check_type:
          enum:
            - equal
            - not_equal
            - greater_than
            - greater_than_or_equal
            - less_than
            - less_than_or_equal
            - before
            - before_or_on
            - after
            - after_or_on
            - is_in
            - is_not_in
        column_name:
          type: string
        comparison_value: {}
        data_type:
          enum:
            - numeric
            - date
            - string
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        query_name:
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
      required:
        - check_type
        - column_name
        - comparison_value
        - data_type
        - query_name
      type: object
    NumericCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        type:
          enum:
            - equal
            - not_equal
            - greater_than
            - greater_than_or_equal
            - less_than
            - less_than_or_equal
        value:
          type: string
      type: object
    SQLCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        column_name:
          type: string
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        query_name:
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
      required:
        - column_name
        - query_name
      type: object
    StringCheck:
      properties:
        auto_decline:
          default: false
          type: boolean
        decline_code:
          description: >-
            The CRM's identifier for this decline reason, e.g. a LendSaas reason
            id. Left unset, the CRM sync falls back to this check's
            decline_description.
          nullable: true
          type: string
        decline_description:
          nullable: true
          type: string
        email_template_name:
          nullable: true
          type: string
        ignore_metric_availability:
          default: false
          type: boolean
        is_mandatory:
          default: false
          type: boolean
        match_count:
          nullable: true
          type: integer
        on_failure:
          default: fail
          enum:
            - fail
            - review_required
        pass_description:
          nullable: true
          type: string
        transaction_scope:
          allOf:
            - $ref: '#/components/schemas/TransactionScope'
          nullable: true
        type:
          enum:
            - equal
            - not_equal
            - starts_with
            - starts_with_any_of
            - does_not_start_with_any_of
            - contains
            - does_not_start_with
            - does_not_contain
            - is_in
            - is_not_in
            - has_none_of
            - has_any_of
            - has_fewer_than_n_matches
            - has_more_than_n_matches
        value:
          type: string
      type: object
    TransactionScope:
      properties:
        file_classes:
          items:
            type: string
          nullable: true
          type: array
        min_reconciliation_status:
          enum:
            - failed
            - not_possible
            - reconciled
            - null
          nullable: true
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.