> For the complete documentation index, see [llms.txt](https://devcenter.unico.io/unico-people/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devcenter.unico.io/unico-people/unico-people-v1/apis/posicoes/change-status.md).

# Change status

Altera o status de uma posição.

<mark style="color:yellow;">`PUT`</mark> \ <mark style="color:$primary;">**Url Produção:**</mark> `https://api.acessorh.com.br`\ <mark style="color:$primary;">**Url Homologação:**</mark> `https://api.rh.homolog.acesso.io`\ <mark style="color:$primary;">**Endpoint:**</mark> `/v1/positions/status/:position`

### **Headers**

| Key                                             | Type   | Description                                                   |
| ----------------------------------------------- | ------ | ------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token de acesso adquirido pela plataforma Identity *(bearer)* |

### **Path Parameters**

| Key                                        | Type   | Description                             |
| ------------------------------------------ | ------ | --------------------------------------- |
| position<mark style="color:red;">\*</mark> | string | UID ou código da posição a ser alterada |

### Descrição do body JSON da request. <a href="#descricao-do-body-json-da-request-1" id="descricao-do-body-json-da-request-1"></a>

#### **Parâmetros obrigatórios.**

| Key                                          | Type            | Description                            |
| -------------------------------------------- | --------------- | -------------------------------------- |
| **status**<mark style="color:red;">\*</mark> | string(options) | Status no qual a posição será alterada |

**Opções de status.**

```
"completed", "archived", "declined"
```

#### **Parâmetros opcionais.**

| Key         | Type   | Description                                                                                                                                                                 |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **unit**    | string | UID da filial do qual a posição pertence. [Colete aqui](/unico-people/unico-people-v1/apis/organizacao.md#get-units).                                                       |
| **decline** | object | Decline é a estrutura com as informações dos motivos de declínio da posição. \*Esse campo é ***obrigatório*** apenas quando o campo de **status** for igual a "*declined*". |

{% hint style="info" %}

* A posição só poderá ser arquivada, se ela já estiver completa ou declinada.
  {% endhint %}

#### Campo decline. <a href="#campo-decline" id="campo-decline"></a>

**Motivos (reason) de declínio para cada type.**

{% columns %}
{% column width="50%" %} <mark style="color:orange;">**DECLINED\_BY\_USER**</mark>

<mark style="color:$info;">motivos-pessoais</mark>

<mark style="color:$info;">proposta-melhor</mark>

<mark style="color:$info;">nao-tem-interesse</mark>

<mark style="color:$info;">sem-retorno</mark>

<mark style="color:$info;">outro</mark>
{% endcolumn %}

{% column width="50%" %} <mark style="color:blue;">**DECLINED\_BY\_HR**</mark>

<mark style="color:$info;">sem-retorno-candidato</mark>

<mark style="color:$info;">falta-documento</mark>

<mark style="color:$info;">escolaridade-inferior</mark>

<mark style="color:$info;">sem-vacina-covid</mark>

<mark style="color:$info;">outro</mark>
{% endcolumn %}
{% endcolumns %}

{% hint style="warning" %}

* <mark style="color:$danger;">**Importante**</mark>!\
  Não é possível declinar posições que estão arquivadas.
  {% endhint %}

### Exemplo de requisição <a href="#exemplo-de-requisicao-1" id="exemplo-de-requisicao-1"></a>

```json
{
	"unit": "84ef8cd7-76ee-4b10-a77b-e0201cdcd117",
	"status": "declined",
        "decline":{
            "type": "DECLINED_BY_HR",
            "reason": "falta-documento",
            "description": "descrição",
            "message":"messagem de declino para o candidato",
        }
}
```

### Exemplo de resposta <a href="#exemplo-de-requisicao-1" id="exemplo-de-requisicao-1"></a>

{% code title="200 OK" %}

```json
"ok"
```

{% endcode %}
