# Inserção de Dados - Requisições do Tipo POST

Com requisições do tipo **"*****POST",*** você poderá criar clientes, abrir tickets, criar campos personalizados e opções de campos personalizados, entre outros. \
\
Neste exemplo prático, estaremos criando um *ticket* no Tiflux.

Para abrir um ticket, iremos consumir a rota de [Criar ticket.](https://api.tiflux.com/api/v2/#post-/tickets)

Para criar um ticket via API, é necessário fornecer alguns parâmetros, sendo alguns obrigatórios e outros opcionais. Para consultar a lista completa desses parâmetros, [clique aqui](https://api.tiflux.com/api/v2/#post-/tickets).

Segue um exemplo da requisição sendo efetuada através do *Postman:*

<figure><img src="/files/ykxrj1seFdQj9VV4oF6f" alt=""><figcaption></figcaption></figure>

No caso do exemplo acima, eu passei tanto parâmetros obrigatórios como parâmetros opcionais.

Neste caso, o retorno será da seguinte forma:

```json
{
    "ticket": {
        "ticket_number": 4442,
        "client": {
            "id": 1271773,
            "name": "Novo Guia de Uso",
            "social": "Novo Guia de Uso",
            "social_revenue": "23528323000158",
            "status": true
        },
        "closed_ticket_total_spent_solving": null,
        "created_at": "2024-11-12T14:24:25Z",
        "created_by_id": 963604,
        "created_by_way_of": "Tiflux API",
        "created_with_ai": false,
        "custom_fields": null,
        "description": "Aberto via API v2",
        "desk": {
            "id": 46370,
            "active": true,
            "appointment_type": "Without Appointments",
            "display_name": "Triagem",
            "name": "Triagem"
        },
        "equipment": {
            "id": null,
            "name": null,
            "group_id": null,
            "user_id": null
        },
        "feedback": null,
        "followers": null,
        "is_closed": false,
        "is_duplicating": false,
        "is_grouped": false,
        "is_revised": false,
        "last_answer_type": null,
        "last_reopen_date": null,
        "priority": {
            "id": 146872,
            "end_time": "60:00",
            "name": "Low",
            "order": 2,
            "start_time": "06:00"
        },
        "priority_change_reason": null,
        "reopen_count": 0,
        "requestor": {
            "id": 2965212,
            "email": "tifluxsuporte@outlook.com",
            "name": "Novo Guia de Uso",
            "ramal": null,
            "telephone": "+4829364596"
        },
        "responsible": null,
        "services_catalog": null,
        "sla_info": {
            "attend_expiration": null,
            "attend_sla": null,
            "attend_sla_solution": null,
            "desactivate_sla_reason": null,
            "solve_expiration": null,
            "solved_in_time": null,
            "stage_expiration": "2024-11-12T16:54:00Z",
            "stopped": false
        },
        "stage": {
            "id": 277203,
            "first_stage": true,
            "last_stage": false,
            "max_time": "01:00",
            "name": "Pending"
        },
        "status": {
            "id": 149730,
            "default_canceled": false,
            "default_close": false,
            "default_open": true,
            "name": "Opened"
        },
        "ticket_children": [],
        "ticket_reference": {},
        "title": "Aberto via API v2",
        "updated_at": "2024-11-12T14:24:25Z",
        "updated_by_id": 963604,
        "worked_hours": "00:00"
    }
}
```

O retorno consiste em mostrar todos os campos preenchidos ou não na abertura do ticket.

Para obter detalhes sobre cada rota de inserção de dados, incluindo os parâmetros necessários e os respectivos retornos, [consulte a documentação oficial da API.](https://api.tiflux.com/api/v2/#overview)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guia-de-uso.tiflux.com/integracoes/api-tiflux/api-v2/insercao-de-dados-requisicoes-do-tipo-post.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
