# post\_\_unregister

`POST /unregister`

*Unregister Bridge Node*

Remove a bridge node from the Flashback platform using cryptographic signature verification for authentication.

This endpoint allows bridge nodes to unregister themselves from the platform without requiring traditional authentication. It uses RSA signature verification to ensure the request comes from an authorized organization key.

**Key Features:**

* Cryptographic signature verification using RSA keys
* Removes node from the platform registry
* Cleans up node-key associations
* Minimal required fields for unregistration
* Version information capture for compatibility monitoring

**Authentication:**

* No traditional authentication required
* Uses RSA signature verification for security
* Signature must be generated using a valid organization private key
* Timestamp validation prevents replay attacks

**Validation:**

* IP address is required for node identification
* Signature must be cryptographically valid
* Timestamp must be recent to prevent replay attacks
* Node must exist in the registry

#### TypeScript Client Library

```typescript
public nodeUnregister = async (data: RegisterRequest): Promise<RegisterResponse> => {
  return this.makeRequest<RegisterResponse>('unregister', 'POST', data);
};
```

#### Code Samples

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

```shell
# You can also use wget
curl -X POST https://backend.flashback.tech/unregister \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "ip": "192.168.1.100",
    "timestamp": "2024-01-15T10:30:00.000Z",
    "signature": "base64-encoded-signature",
    "id_org": "org-123e4567-e89b-12d3-a456-426614174000"
  }'
```

{% endtab %}

{% tab title="HTTP" %}

```http
POST https://backend.flashback.tech/unregister HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: application/json

{
  "ip": "192.168.1.100",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "signature": "base64-encoded-signature",
  "id_org": "org-123e4567-e89b-12d3-a456-426614174000"
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const inputBody = {
  "ip": "192.168.1.100",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "signature": "base64-encoded-signature",
  "id_org": "org-123e4567-e89b-12d3-a456-426614174000"
};

const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://backend.flashback.tech/unregister',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

body = {
  'ip' => '192.168.1.100',
  'timestamp' => '2024-01-15T10:30:00.000Z',
  'signature' => 'base64-encoded-signature',
  'id_org' => 'org-123e4567-e89b-12d3-a456-426614174000'
}

result = RestClient.post 'https://backend.flashback.tech/unregister',
  body.to_json, headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

body = {
  'ip': '192.168.1.100',
  'timestamp': '2024-01-15T10:30:00.000Z',
  'signature': 'base64-encoded-signature',
  'id_org': 'org-123e4567-e89b-12d3-a456-426614174000'
}

r = requests.post('https://backend.flashback.tech/unregister', 
                  headers=headers, 
                  data=json.dumps(body))

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
);

$body = array(
    'ip' => '192.168.1.100',
    'timestamp' => '2024-01-15T10:30:00.000Z',
    'signature' => 'base64-encoded-signature',
    'id_org' => 'org-123e4567-e89b-12d3-a456-426614174000'
);

$client = new \GuzzleHttp\Client();

try {
    $response = $client->request('POST','https://backend.flashback.tech/unregister', array(
        'headers' => $headers,
        'json' => $body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
```

{% endtab %}

{% tab title="Java" %}

```java
URL obj = new URL("https://backend.flashback.tech/unregister");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");

String jsonInputString = "{\"ip\":\"192.168.1.100\",\"timestamp\":\"2024-01-15T10:30:00.000Z\",\"signature\":\"base64-encoded-signature\",\"id_org\":\"org-123e4567-e89b-12d3-a456-426614174000\"}";

con.setDoOutput(true);
try(OutputStream os = con.getOutputStream()) {
    byte[] input = jsonInputString.getBytes("utf-8");
    os.write(input, 0, input.length);
}

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "bytes"
       "net/http"
       "encoding/json"
)

func main() {
    body := map[string]interface{}{
        "ip": "192.168.1.100",
        "timestamp": "2024-01-15T10:30:00.000Z",
        "signature": "base64-encoded-signature",
        "id_org": "org-123e4567-e89b-12d3-a456-426614174000",
    }

    jsonData, _ := json.Marshal(body)

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer(jsonData)
    req, err := http.NewRequest("POST", "https://backend.flashback.tech/unregister", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

> Body parameter

```json
{
  "ip": "192.168.1.100",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "signature": "base64-encoded-signature",
  "id_org": "org-123e4567-e89b-12d3-a456-426614174000"
}
```

#### Parameters <a href="#post__unregister-parameters" id="post__unregister-parameters"></a>

| Name        | In   | Type   | Required | Description                                  |
| ----------- | ---- | ------ | -------- | -------------------------------------------- |
| body        | body | object | true     | Node unregistration data                     |
| » ip        | body | string | true     | Node IP address (used as unique identifier)  |
| » timestamp | body | string | true     | Request timestamp for signature verification |
| » signature | body | string | true     | RSA signature of the request data            |
| » id\_org   | body | string | false    | Organization ID (optional)                   |

> Example responses

> 200 Response

```json
{
  "success": true,
  "message": "Unregistration successful"
}
```

> 400 Response

```json
{
  "success": false,
  "message": "Missing required fields"
}
```

> 404 Response

```json
{
  "success": false,
  "message": "Node not found"
}
```

#### Responses <a href="#post__unregister-responses" id="post__unregister-responses"></a>

| Status | Meaning                                                                    | Description                           | Schema |
| ------ | -------------------------------------------------------------------------- | ------------------------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                    | Node unregistered successfully        | Inline |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)           | Validation error or invalid signature | Inline |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)             | Node not found in registry            | Inline |
| 500    | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Unregistration failed                 | Inline |

#### Response Schema <a href="#post__unregister-responseschema" id="post__unregister-responseschema"></a>

Status Code **200**

| Name      | Type    | Required | Restrictions | Description              |
| --------- | ------- | -------- | ------------ | ------------------------ |
| » success | boolean | false    | none         | Operation success status |
| » message | string  | false    | none         | Success message          |

Status Code **400**

| Name      | Type    | Required | Restrictions | Description                                   |
| --------- | ------- | -------- | ------------ | --------------------------------------------- |
| » success | boolean | false    | none         | Operation success status                      |
| » message | string  | false    | none         | Error message describing the validation issue |

Status Code **404**

| Name      | Type    | Required | Restrictions | Description                             |
| --------- | ------- | -------- | ------------ | --------------------------------------- |
| » success | boolean | false    | none         | Operation success status                |
| » message | string  | false    | none         | Error message indicating node not found |

Status Code **500**

| Name      | Type    | Required | Restrictions | Description                                 |
| --------- | ------- | -------- | ------------ | ------------------------------------------- |
| » success | boolean | false    | none         | Operation success status                    |
| » message | string  | false    | none         | Error message describing the internal error |

This operation does not require authentication as it uses cryptographic signature verification for security.


---

# 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.flashback.tech/support-reference/platform-api-reference/storage-apis/node-registration/post__unregister.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.
