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

# Exam pendency

> An occupational exam obligation, from request to ASO.

A **Pendency** represents an **occupational exam obligation** for an employee — hiring,
dismissal, periodic, return to work or risk change. It is the record that tracks the lifecycle
**from the exam request to completion** (ASO issued) or **cancellation**.

## Exam types (`type_exam`)

| Code          | Meaning        | When it happens                                  |
| ------------- | -------------- | ------------------------------------------------ |
| `HIRING`      | Pre-employment | On employee hiring.                              |
| `DISMISSAL`   | Dismissal      | On dismissal.                                    |
| `PERIODIC`    | Periodic       | Periodically, per the organization's parameters. |
| `RETURN`      | Return to work | When returning after leave.                      |
| `RISK_CHANGE` | Risk change    | When the employee's hierarchy/risk changes.      |

<Note>
  The complete, canonical set of types is in the **endpoint schema** (OpenAPI). The table above
  covers the main ones.
</Note>

## Lifecycle

```mermaid theme={null}
flowchart LR
    A[Pendency created] --> B[Pending]
    B --> C[Scheduled]
    C --> D[Done / ASO issued]
    B -. cancel .-> X[Canceled]
    C -. cancel .-> X
```

1. **Created** — automatically (on hiring/dismissal, etc.) or via the create endpoint.
2. **Pending** — awaiting scheduling.
3. **Scheduled** — exam booked at a clinic (orchestrated internally by Salú).
4. **Done** — exam completed and **ASO** issued.
5. **Canceled** — closed without completion.

<Info>
  **Clinic scheduling** and **performing** the exam are managed inside the Salú platform —
  there is no public endpoint to schedule. Through the public API you **create**, **list** and
  **cancel** pendencies, and track the `status`.
</Info>

## Create fields

| Field         | Required | Description                                                  |
| ------------- | -------- | ------------------------------------------------------------ |
| `employee_id` | yes      | Employee the exam targets.                                   |
| `type_exam`   | yes      | Exam type (see table above).                                 |
| `send_email`  | yes      | If `true`, triggers communication to the employee.           |
| `send_date`   | no       | Send date/time (defaults to "now" when `send_email = true`). |
| `exam_date`   | no       | Expected exam date.                                          |

To **cancel**, provide the `pendency_id` and, optionally, a `note` with the reason.

## Deadlines (`due_date`)

The exam deadline is computed by the platform per type — for example, the pre-employment exam
with a deadline before hiring and the dismissal exam with a deadline after the dismissal date.
These values appear in the pendency response.

## Endpoints

<CardGroup cols={3}>
  <Card title="List pendencies" icon="list" href="/public-api/en/endpoints/pendencies/public_list_pendencies_v0_pendency__get_en" />

  <Card title="Create pendency" icon="plus" href="/public-api/en/endpoints/pendencies/public_create_pendency_v0_pendency__post_en" />

  <Card title="Cancel pendency" icon="xmark" href="/public-api/en/endpoints/pendencies/public_cancel_pendency_v0_pendency_cancel_post_en" />
</CardGroup>
