> ## 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 Disability Analysis

<Info>
  Cria uma <strong>análise de deficiência (PCD)</strong> para um candidato ou colaborador.
  Veja o conceito em [Análise PCD](/public-api/br/conceitos/analise-pcd) e o
  [fluxo completo](/public-api/br/fluxos/analise-pcd).
</Info>

## Visão Geral

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

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

### Campos principais

| Campo             | Obrigatório | Significado (PT)                                                    |
| ----------------- | ----------- | ------------------------------------------------------------------- |
| `name`            | sim         | Nome do candidato/colaborador.                                      |
| `gov_id`          | sim         | CPF (11 dígitos; validado e normalizado).                           |
| `organization_id` | sim         | Organização da análise.                                             |
| `employee_id`     | condicional | Obrigatório quando o candidato **já é colaborador** da organização. |

### Enum de status (resposta)

| Campo    | Valor      | Significado (PT) |
| -------- | ---------- | ---------------- |
| `status` | `PENDING`  | Em análise       |
|          | `APPROVED` | Aprovada         |
|          | `REJECTED` | Rejeitada        |
|          | `EXPIRED`  | Expirada         |

### Exemplo de requisição

```bash theme={null}
curl -X POST "https://public-api.salu.com.vc/dev/routes/v0/analysis/disability" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $SALU_PUBLIC_API_KEY" \
  --data '{
    "name": "MARIA DA SILVA",
    "gov_id": "12345678901",
    "organization_id": "ORGANIZATION_UUID",
    "employee_id": null
  }'
```


## OpenAPI

````yaml POST /v0/analysis/disability
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/analysis/disability:
    post:
      tags:
        - Analysis
        - Analysis
      summary: Public Create Analysis
      operationId: public_create_analysis_v0_analysis_disability_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicApiCreateAnalysisRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiCreateAnalysisResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PublicApiCreateAnalysisRequest:
      properties:
        name:
          type: string
          title: Nome do Candidato
        gov_id:
          type: string
          title: CPF do Candidato
        organization_id:
          type: string
          format: uuid
          title: ID da Organização
        employee_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: ID do Colaborador
          description: Obrigatório quando o candidato já é colaborador da organização.
      additionalProperties: false
      type: object
      required:
        - name
        - gov_id
        - organization_id
      title: PublicApiCreateAnalysisRequest
    PublicApiCreateAnalysisResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        gov_id:
          type: string
          title: Gov Id
        status:
          $ref: '#/components/schemas/AnalysisStatusEnum'
        request_date:
          type: string
          format: date-time
          title: Request Date
        validation_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Validation Date
        observation:
          anyOf:
            - type: string
            - type: 'null'
          title: Observation
        employee_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Employee Id
        organization:
          $ref: '#/components/schemas/SimpleOrganization'
        disabilities:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Disabilities
        expiration_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiration Date
        expired:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Expired
        analysis_files:
          items:
            $ref: '#/components/schemas/PublicApiAnalysisFileResponse'
          type: array
          title: Analysis Files
          default: []
      type: object
      required:
        - id
        - name
        - gov_id
        - status
        - request_date
        - organization
      title: PublicApiCreateAnalysisResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnalysisStatusEnum:
      type: string
      enum:
        - IN_ANALYSIS
        - INCOMPLETE
        - APPROVED
        - REPROVED
        - EXPIRED
      title: AnalysisStatusEnum
    SimpleOrganization:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: SimpleOrganization
    PublicApiAnalysisFileResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        file_path:
          type: string
          title: File Path
        mimetype:
          type: string
          title: Mimetype
        document_type:
          $ref: '#/components/schemas/AnalysisDocumentTypeEnum'
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - name
        - file_path
        - mimetype
        - document_type
        - created_at
      title: PublicApiAnalysisFileResponse
    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
    AnalysisDocumentTypeEnum:
      type: string
      enum:
        - DISABILITY_MEDICAL_REPORT
        - DISABILITY_CLASSIFICATION
        - MEDICAL_CERTIFICATE
      title: AnalysisDocumentTypeEnum
      description: Document types specifically for analysis workflows.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````