# Criando endpoint para receber webhooks

```graphql
mutation {
  createEndpoint(
    organization_id: 123, # ID da organização para qual o webhook será criado
    url: "https://meusistema.com/webhooks/assinaturas", # URL que receberá os eventos
    format: JSON, # Pode ser JSON ou URLENCODED
    type: SIGNATURE, # Tipo de objeto monitorado: DOCUMENT, SIGNATURE ou MEMBER
    name: "Webhook Assinaturas", # Nome identificador do webhook
    events: [SIGNATURE_CREATED, SIGNATURE_ACCEPTED], # Lista de eventos que deseja escutar
    folder_id: "c8e96bce-fb65-4f1b-a97d-29df0e8cde94" # (opcional) ID da pasta associada
  ) {
    secret
    webhook_endpoint {
      id
      url
      active
      events
    }
  }
}
```

## Enuns

#### WebhookFormatEnum

Formato de entrega dos dados:

* URLENCODED
* JSON

#### WebhookEndpointTypeEnum

Categoria do endpoint:

* DOCUMENT
* SIGNATURE
* MEMBER

{% hint style="warning" %}
O tipo selecionado define quais serão os eventos que serão vinculados.

\
O tipo MEMBER só pode selecionar MEMBER\_CREATED, MEMBER\_DELETED. Os demais selecionados serão desconsiderado.
{% endhint %}

#### WebhookEventTypeEnum

Eventos disponíveis para escuta:

* DOCUMENT\_CREATED
* DOCUMENT\_UPDATED
* DOCUMENT\_DELETED
* DOCUMENT\_FINISHED
* SIGNATURE\_CREATED
* SIGNATURE\_UPDATED
* SIGNATURE\_DELETED
* SIGNATURE\_VIEWED
* SIGNATURE\_ACCEPTED
* SIGNATURE\_REJECTED
* SIGNATURE\_BIOMETRIC\_APPROVED
* SIGNATURE\_BIOMETRIC\_UNAPPROVED
* SIGNATURE\_BIOMETRIC\_REJECTED
* MEMBER\_CREATED
* MEMBER\_DELETED

{% hint style="info" %}
Para saber mais sobre as condições para o gatilhos dos eventos. Está disponíveis em [webhooks](/api/2/integracao/webhooks.md#tipos-de-eventos).
{% endhint %}


---

# 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://docs.autentique.com.br/api/corporate/mutations/gestao-de-endpoints-de-webhooks/criando-endpoint-para-receber-webhooks.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.
