> ## 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.

# Create Pendency

<Info>
  Cria uma nova <strong>pendência</strong> (exame/processo) para um funcionário.
</Info>

## Visão Geral

* **Método:** `POST`
* **Path:** `/v0/pendency/`
* **OperationId:** `public_create_pendency_v0_pendency__post`
* **Autenticação:** header `x-api-key`

<OpenAPIPlayground openapi="/public-api/openapi.json" operationId="public_create_pendency_v0_pendency__post" />

### Campos enum e traduções

<Note>
  Use exatamente os valores do enum conforme definidos pela API. Os valores abaixo devem ser enviados exatamente como estão.
</Note>

#### type\_exam

| Campo (request) | Valores permitidos (enum da API) | Significado (PT)       |
| --------------- | -------------------------------- | ---------------------- |
| `type_exam`     | `HIRING`                         | Exame admissional      |
|                 | `DISMISSAL`                      | Exame demissional      |
|                 | `PERIODIC`                       | Exame periódico        |
|                 | `RETURN`                         | Retorno ao trabalho    |
|                 | `RISK_CHANGE`                    | Mudança de risco       |
|                 | `INTERN_HIRING`                  | Admissão de estagiário |

#### Enums de resposta (referência)

| Campo (response) | Valores permitidos | Significado (PT) |
| ---------------- | ------------------ | ---------------- |
| `status`         | `ON_HOLD`          | Em espera        |
|                  | `PENDING`          | Pendente         |
|                  | `PRE_SCHEDULED`    | Pré-agendado     |
|                  | `SCHEDULED`        | Agendado         |
|                  | `DONE`             | Concluído        |
|                  | `CANCELED`         | Cancelado        |
|                  | `ABSENT`           | Ausente          |
|                  | `MISSING_OHC`      | Buscando ASO     |
|                  | `NO_RESPONSE`      | Sem resposta     |

### Exemplo de requisição

```bash theme={null}
curl -X POST "https://public-api.salu.com.vc/dev/routes/v0/pendency/" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $SALU_PUBLIC_API_KEY" \
  --data '{
    "employee_id": "EMPLOYEE_UUID",
    "type_exam": "HIRING",
    "send_email": true,
    "send_date": null
  }'
```


## OpenAPI

````yaml POST /v0/pendency/
openapi: 3.1.0
info:
  title: Public API v0
  description: API publica da Salu para integracoes de SST.
  version: 0.1.0
servers:
  - url: https://public-api.salu.com.vc/dev/routes
    description: Development
  - url: https://public-api.salu.com.vc/prd/routes
    description: Production
security: []
paths:
  /v0/pendency/:
    post:
      tags:
        - Pendency
        - Pendency
      summary: Public Create Pendency
      operationId: public_create_pendency_v0_pendency__post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicApiCreatePendencyRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiCreatePendencyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PublicApiCreatePendencyRequest:
      properties:
        employee_id:
          type: string
          format: uuid
          title: Employee Id
        send_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Send Date
        type_exam:
          $ref: '#/components/schemas/ExamsTypeEnum'
        send_email:
          type: boolean
          title: Send Email
        exam_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Exam Date
      additionalProperties: false
      type: object
      required:
        - employee_id
        - type_exam
        - send_email
      title: PublicApiCreatePendencyRequest
    PublicApiCreatePendencyResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        employee_id:
          type: string
          format: uuid
          title: Employee Id
        type_exam:
          $ref: '#/components/schemas/ExamsTypeEnum'
        status:
          $ref: '#/components/schemas/PendencyStatusEnum'
        priority:
          type: boolean
          title: Priority
        block_status:
          anyOf:
            - $ref: '#/components/schemas/PendencyBlockStatusEnum'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          type: string
          title: Created By
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by:
          type: string
          title: Updated By
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        organization_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization Display Name
        employee_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Employee Name
      type: object
      required:
        - id
        - employee_id
        - type_exam
        - status
        - priority
        - created_at
        - created_by
        - updated_at
        - updated_by
        - organization_id
        - organization_display_name
        - employee_name
      title: PublicApiCreatePendencyResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExamsTypeEnum:
      type: string
      enum:
        - HIRING
        - DISMISSAL
        - PERIODIC
        - RETURN
        - RISK_CHANGE
        - INTERN_HIRING
        - PUNCTUAL
        - CRITICAL_ACTIVITY
        - APPOINTMENT
        - APPOINTMENT_RETURN
        - ANAMNESE
        - EMPLOYEE_ACTION
      title: ExamsTypeEnum
    PendencyStatusEnum:
      type: string
      enum:
        - ON_HOLD
        - PENDING
        - PRE_SCHEDULED
        - SCHEDULED
        - DONE
        - CANCELED
        - ABSENT
        - MISSING_OHC
        - NO_RESPONSE
      title: PendencyStatusEnum
    PendencyBlockStatusEnum:
      type: string
      enum:
        - EXAM_EXTENSION
        - FINDING_CLINIC
        - BLOCKED_CLINIC
        - WAITING_FOR_HR_RESPONSE
        - WAITING_FOR_EMPLOYEE_RESPONSE
        - WAITING_FOR_HEALTH_TEAM_RESPONSE
        - WAITING_FOR_ENGINEERING_TEAM_RESPONSE
        - ARCHIVED
        - UNDER_MANAGEMENT
        - HR_RETURNED_PENDENCY
        - EMPLOYEE_ATTENDANCE_CONFIRMED
      title: PendencyBlockStatusEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````