# Webhooks de Bloqueio Judicial no Investimento via API

O bloqueio judicial ocorre sempre que uma ordem judicial é expedida ao Stark Bank em relação a uma conta de cliente. Para identificar o bloqueio judicial no Investimento via API, você pode ativar a subscription `credit-block`. O retorno do webhook ocorrerá da seguinte forma:

### Webhook de Bloqueio no Investimento

O type será retornado como "created":

```
{
  "event": {
    "created": "2025-09-29T20:40:01.573927+00:00",
    "id": "5789476116758528",
    "log": {
      "block": {
        "amount": 130000,
        "created": "2025-09-29T20:26:45.534041+00:00",
        "id": "",
        "senderId": "organization-asset-block/billing/6235148253134848/2025-04-30",
        "source": "organization-asset-block/billing/6235148253134848/2025-04-30",
        "status": "active",
        "tags": [],
        "transactionId": null,
        "type": "contractual",
        "workspaceId": "organization-asset-block/billing/6235148253134848/2025-04-30"
      },
      "created": "2025-09-29T20:26:45.566164+00:00",
      "errors": [],
      "id": "5114942998970368",
      "type": "created"
    },
    "subscription": "credit-block",
    "workspaceId": "6235148253134848"
  }
}
```

### Webhook de Desbloqueio no Investimento

O type será retornado como "canceled":

```
{
  "event": {
    "created": "2025-09-29T20:42:07.147453+00:00",
    "id": "5647453963419648",
    "log": {
      "block": {
        "amount": 130000,
        "created": "2025-09-29T20:26:45.534041+00:00",
        "id": "",
        "senderId": "organization-asset-block/billing/6235148253134848/2025-04-30",
        "source": "organization-asset-block/billing/6235148253134848/2025-04-30",
        "status": "canceled",
        "tags": [],
        "transactionId": null,
        "type": "contractual",
        "workspaceId": "organization-asset-block/billing/6235148253134848/2025-04-30"
      },
      "created": "2025-09-29T20:42:06.244622+00:00",
      "errors": [],
      "id": "5768407551049728",
      "type": "canceled"
    },
    "subscription": "credit-block",
    "workspaceId": "6235148253134848"
  }
}
```

{% hint style="warning" %}
Sem a criação de uma subscription via API, não é possível receber esses eventos. Saiba como criar uma subscription: <https://starkbank.com/docs/api#webhook>
{% endhint %}

#### Nota Importante sobre o type do Bloqueio:

Embora o título do evento se refira a um "Bloqueio Judicial", o payload do webhook retornado pela API identificará este evento com o campo `"type": "contractual"`. Este é o valor esperado e correto. A subscrição `credit-block` é usada exclusivamente para eventos de bloqueio judicial, portanto, qualquer evento recebido nela com o tipo "contractual" deve ser tratado como uma ordem de bloqueio judicial.


---

# 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://starkbank.com/help/integracao-e-apis/webhooks-de-bloqueio-judicial-no-investimento-via-api.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.
