Skip to main content

Description

This hook is triggered when a test instance is updated (e.g., score is calculated, status changes).

Integration Details

  • Subscription Key: ae.test_instance.updated
  • Use Case: Automatically fetch results or update a candidate’s status in your ATS once a score is available.
  • Related Events: ae.test_instance.created
  • Previous State: Includes an old object containing the record’s state before the update.

Trigger

  • Event Type: ae_test_instance_updated
  • Source: Update of a record in the ti_instance table.

Payload Example

{
  "id": 789,
  "old_id": 1234,
  "external_id": "ext_ti_789",
  "candidate": {
    "id": 101,
    "is_active": true,
    "old_id": 5678,
    "external_id": "ext_can_101",
    "user_id": 123,
    "email": "candidate@example.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "middle_name": "Marie",
    "phone_number": "+19876543210",
    "cf": {},
    "country": "USA",
    "tenant_id": 1,
    "is_tnc_accepted": true,
    "is_recording_consent_accepted": true,
    "resume_file_id": 2001,
    "profile_pic_file_id": 3001
  },
  "catalog_assessment": {
    "id": 202,
    "assessment": {
      "id": 303,
      "name": "Python Proficiency Test",
      "level": "intermediate",
      "status": "published",
      "configuration_id": 401,
      "created_at": "2023-11-01T10:00:00Z",
      "updated_at": "2023-11-01T10:00:00Z",
      "created_by": 1,
      "updated_by": 1
    },
    "catalog": {
      "id": 404,
      "description": "Standard technical assessment catalog.",
      "name": "Standard Assessments",
      "created_at": "2023-11-01T10:00:00Z",
      "updated_at": "2023-11-01T10:00:00Z",
      "created_by": 1,
      "updated_by": 1
    }
  },
  "measurement": {
    "id": 505,
    "status": "completed",
    "time_taken": "00:20:00",
    "report_url": "https://reports.example.com/789",
    "report_file_id": 999,
    "measured_at": "2023-11-05T10:30:00Z",
    "measurement_attributes": [
      {
        "id": 1,
        "remarks": "Strong logic",
        "description": "Candidate demonstrated strong analytical skills.",
        "section_configuration_attribute": {
          "attribute": {
            "id": 10,
            "name": "Logical Reasoning",
            "is_required": true,
            "min_value": 0,
            "max_value": 100,
            "skill": {
              "id": 5,
              "name": "Logic"
            }
          }
        },
        "numerical_score": 85,
        "percentile_score": 92,
        "ordinal": {
          "id": 1,
          "label": "High",
          "value": "85",
          "sort_key": 1,
          "min_value": 80
        },
        "created_at": "2023-11-05T10:00:00Z",
        "created_by": 1,
        "updated_at": "2023-11-05T10:30:00Z",
        "updated_by": 1
      }
    ]
  },
  "score": 85,
  "tenant_id": 1,
  "created_at": "2023-11-05T10:00:00Z",
  "created_by": 1,
  "updated_by": 1,
  "updated_at": "2023-11-05T10:35:00Z",
  "old": {
    "id": 789,
    "score": 0,
    "updated_at": "2023-11-05T10:00:00Z"
  }
}

Payload Type Showcase

{
  id: number;
  old_id: number | null;
  external_id: string;
  candidate: {
    id: number;
    is_active: boolean;
    old_id: number | null;
    external_id: string | null;
    user_id: number;
    email: string;
    first_name: string | null;
    last_name: string | null;
    middle_name: string | null;
    phone_number: string | null;
    cf: Record<string, any>;
    country: string | null;
    tenant_id: number;
    is_tnc_accepted: boolean;
    is_recording_consent_accepted: boolean | null;
    resume_file_id: number | null;
    profile_pic_file_id: number | null;
  };
  catalog_assessment: {
    id: number;
    assessment: {
      id: number;
      name: string;
      level: string;
      status: string;
      configuration_id: number;
      created_at: string;
      updated_at: string;
      created_by: number;
      updated_by: number;
    };
    catalog: {
      id: number;
      description: string | null;
      name: string;
      created_at: string;
      updated_at: string;
      created_by: number;
      updated_by: number;
    };
  };
  measurement: {
    id: number;
    status: string;
    time_taken: string | null;
    report_url: string | null;
    report_file_id: number | null;
    measured_at: string;
    measurement_attributes: {
      id: number;
      remarks: string | null;
      description: string | null;
      section_configuration_attribute: {
        attribute: {
          id: number;
          name: string;
          is_required: boolean;
          min_value: number;
          max_value: number;
          skill: {
            id: number;
            name: string;
          } | null;
        };
      };
      numerical_score: number | null;
      percentile_score: number | null;
      ordinal: {
        id: number;
        label: string;
        value: string;
        sort_key: number;
        min_value: number | null;
      } | null;
      created_at: string;
      created_by: number;
      updated_at: string;
      updated_by: number;
    }[];
  };
  score: number | null;
  tenant_id: number;
  created_at: string;
  created_by: number;
  updated_by: number;
  updated_at: string;
  old: Partial<{
    id: number;
    score: number | null;
    updated_at: string;
    updated_by: number;
  }>;
}