# Attach

At any time, a connection between the **APP** and the **HAS** infrastructure may be interrupted. It is then important that the **APP** can reconnect and know if a request that it sent to the **HAS** has already been processed by a **PKSA** or is still pending.

Fortunately, the **HAS** protocol has a feature to resume such interaction.

When an **APP** wants to resume a broken session, it can ask the **HAS** to reconnect its socket with the request identifier previously received. To do so, the **APP** sends the following message:

### attach\_req

```
{
    cmd: "attach_req", 
    uuid: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`uuid`** {string} the  request identifier
  {% endtab %}
  {% endtabs %}

If the request has not expired, the **HAS** server will confirm the reconnection with the following message:

### attach\_ack

```
{
    cmd: "attach_ack", 
    uuid: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`uuid`** {string} the  request identifier
  {% endtab %}
  {% endtabs %}

If the request has expired, or if the response it received from the **PKSA** has expired, the **HAS** server will inform the **APP** that it is no longer handling the request with the following message:

### attach\_nack

```
{
    cmd: "attach_nack", 
    uuid: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`uuid`** {string} the  request identifier
  {% endtab %}
  {% endtabs %}


---

# 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.hiveauth.com/developer-documentation/has-for-applications/attach.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.
