> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.useroot.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.useroot.com/_mcp/server.

# Update treasury account label

POST https://api.useroot.com/api/treasury/accounts/{account_id}/update-label
Content-Type: application/json

Reference: https://docs.useroot.com/api-reference/treasury-api/update-treasury-account-label

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/treasury/accounts/{account_id}/update-label:
    post:
      operationId: update-treasury-account-label
      summary: Update treasury account label
      tags:
        - treasuryApi
      parameters:
        - name: account_id
          in: path
          description: Main operating account ID.
          required: true
          schema:
            type: string
            format: uuid
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_TreasuryAccountSummaryResponse_'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTreasuryAccountLabelRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    UpdateTreasuryAccountLabelRequest:
      type: object
      properties:
        label:
          type: string
          description: Display label for the treasury account.
      required:
        - label
      description: Request body for POST /accounts/{account_id}/update-label.
      title: UpdateTreasuryAccountLabelRequest
    TreasuryAccountSummaryResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Main operating account ID.
        label:
          type: string
        currency_code:
          type: string
        last_four_digits:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - label
        - currency_code
        - created_at
        - updated_at
      description: High-level main treasury account metadata (TreasuryAccountSummary).
      title: TreasuryAccountSummaryResponse
    Response_TreasuryAccountSummaryResponse_:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TreasuryAccountSummaryResponse'
        warning:
          type:
            - string
            - 'null'
      required:
        - data
      title: Response_TreasuryAccountSummaryResponse_
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples



**Request**

```json
{
  "label": "Corporate Operating Account"
}
```

**Response**

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "label": "Corporate Operating Account",
    "currency_code": "USD",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-04-20T14:45:00Z",
    "last_four_digits": "1234"
  },
  "warning": "Label updated successfully"
}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/accounts/account_id/update-label"

payload = { "label": "Corporate Operating Account" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/accounts/account_id/update-label';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"label":"Corporate Operating Account"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/treasury/accounts/account_id/update-label"

	payload := strings.NewReader("{\n  \"label\": \"Corporate Operating Account\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/accounts/account_id/update-label")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"label\": \"Corporate Operating Account\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/treasury/accounts/account_id/update-label")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"label\": \"Corporate Operating Account\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/accounts/account_id/update-label', [
  'body' => '{
  "label": "Corporate Operating Account"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/accounts/account_id/update-label");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"label\": \"Corporate Operating Account\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["label": "Corporate Operating Account"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/treasury/accounts/account_id/update-label")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```