# Update/Overhaul Connected Account

## This helps you update any of the data required to operate a subaccount

<mark style="color:purple;">`PATCH`</mark> `https://api2.ourpass.co/v1/api/subaccounts/:subaccountId`

#### Path Parameters

| Name                                           | Type   | Description                                                   |
| ---------------------------------------------- | ------ | ------------------------------------------------------------- |
| subaccountId<mark style="color:red;">\*</mark> | String | This is the unique ID of the connected account to be updated. |

#### Headers

| Name                                     | Type   | Description                                                   |
| ---------------------------------------- | ------ | ------------------------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark> | String | Pass your api key in the request header to authorise the call |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": true,
    "message": "Business Subaccount updated"
}
```

{% endtab %}
{% endtabs %}

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

```
curl --location --request PATCH 'https://api2.ourpass.co/v1/api/subaccounts/1295' \
--data-raw '{
  "subAccountEmail": "dan@test.com.ng",
  "txCap": 1000,
  "txPercentage": 10,
  "userMobile": "Hello",
  "businessName": "Hello",
  "bankName": "test",
  "bankCode": "Hello",
  "accountNumber": "Hello",
  "accountName": "Hello",
  "lastName": "true",
  "firstName": "true"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```
var axios = require('axios');
var data = '{\n  "subAccountEmail": "dan@test.com.ng",\n  "txCap": 1000,\n  "txPercentage": 10,\n  "userMobile": "Hello",\n  "businessName": "Hello",\n  "bankName": "test",\n  "bankCode": "Hello",\n  "accountNumber": "Hello",\n  "accountName": "Hello",\n  "lastName": "true",\n  "firstName": "true"\n}';

var config = {
  method: 'patch',
  url: 'https://api2.ourpass.co/v1/api/subaccounts/1295',
  headers: { },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP" %}

```
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api2.ourpass.co/v1/api/subaccounts/1295');
$request->setMethod('PATCH');
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setBody('{\n  "subAccountEmail": "dan@test.com.ng",\n  "txCap": 1000,\n  "txPercentage": 10,\n  "userMobile": "Hello",\n  "businessName": "Hello",\n  "bankName": "test",\n  "bankCode": "Hello",\n  "accountNumber": "Hello",\n  "accountName": "Hello",\n  "lastName": "true",\n  "firstName": "true"\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Ruby" %}

```
require "uri"
require "net/http"

url = URI("https://api2.ourpass.co/v1/api/subaccounts/1295")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Patch.new(url)
request.body = "{\n  \"subAccountEmail\": \"dan@test.com.ng\",\n  \"txCap\": 1000,\n  \"txPercentage\": 10,\n  \"userMobile\": \"Hello\",\n  \"businessName\": \"Hello\",\n  \"bankName\": \"test\",\n  \"bankCode\": \"Hello\",\n  \"accountNumber\": \"Hello\",\n  \"accountName\": \"Hello\",\n  \"lastName\": \"true\",\n  \"firstName\": \"true\"\n}"

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://api2.ourpass.co/v1/api/subaccounts/1295"

payload = "{\n  \"subAccountEmail\": \"dan@test.com.ng\",\n  \"txCap\": 1000,\n  \"txPercentage\": 10,\n  \"userMobile\": \"Hello\",\n  \"businessName\": \"Hello\",\n  \"bankName\": \"test\",\n  \"bankCode\": \"Hello\",\n  \"accountNumber\": \"Hello\",\n  \"accountName\": \"Hello\",\n  \"lastName\": \"true\",\n  \"firstName\": \"true\"\n}"
headers = {}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)

```

{% 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.ourpass.co/connect/update-overhaul-connected-account.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.
