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

# Delete a capital account

DELETE https://sandbox.api.thepennyinc.com/accounts/capital/{account_id}

Delete a capital account. The account is queued for deletion and removed shortly after.

Required permissions: `account:delete`.

Reference: https://docs.thepennyinc.com/api-reference/penny-banking/accounts/capital/delete

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://sandbox.api.thepennyinc.com` (Sandbox — safe for testing, no real money movement., default)
- `https://live.api.thepennyinc.com` (Live — real businesses, real money movement.)

## Request

### Path parameters

- `account_id` (string, required) — The ID of the Capital Account.

### Headers

- `X-Penny-As-Business` (string, optional, nullable) — Act on behalf of another business that has granted you access. Requires the `business:act_as` permission.

## Response

### 202

The capital account, now queued for deletion.

- `item` (CapitalAccount, required) — The item linked to the response.
- `task` (Task, required) — The task linked to the response.

## Errors

### 400 Bad Request Error

The request was malformed: a required field is missing or a value has the wrong type or format.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 401 Unauthorized Error

Authentication failed.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 403 Forbidden Error

The caller does not have permission to perform this action.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 404 Not Found Error

The capital account was not found.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 422 Unprocessable Entity Error

The request was well-formed but could not be processed because it breaks a business rule.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 429 Too Many Requests Error

Too many requests; retry after the Retry-After header.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

### 500 Internal Server Error

An unexpected error occurred.

- `type` (string, required) — The name of the exception that was raised.
- `message` (string, required) — A human-readable description of the error.
- `details` (map from string to any, optional, nullable) — Structured context about the error, if any.
- `trace_id` (string, optional, nullable) — Identifier for correlating this error with server-side logs.
- `errors` (list of map from string to any, optional, nullable) — Sub-errors that contributed to this failure, if any.

## Types

### CapitalAccount

- `account_id` (string, required) — Unique identifier for the account.
- `version` (integer, required) — The current version of the account record.
- `version_time` (datetime, required) — ISO-8601 timestamp of the most recent account update.
- `program_id` (string, required) — The identifier of the program associated with this account.
- `business_id` (string, required) — The identifier of the business associated with this account.
- `business_entity_id` (string, required) — The identifier of the business entity associated with this account.
- `status` (enum, required) — The current operational status of the account.
  - Allowed values: `active`, `deactivated`, `suspended`, `deleting`, `deleted`
- `active` (boolean, required) — Whether the account is currently active and available for use.
- `currency` (enum, required) — ISO-4217 currency code for the account.
  - Allowed values: `USD`
- `root` (boolean, required) — Whether this is the root capital account for the business.
- `available_balance` (string, required) — The balance currently available for transactions, as a decimal string.
- `total_balance` (string, required) — The total balance including reserved funds, as a decimal string.
- `alias` (string, optional, nullable) — An optional label for the account.
- `description` (string, optional, nullable) — An optional description of the account's purpose.
- `type` (enum, optional, default: capital) — Account types exposed to client-facing API responses.
  - Allowed values: `capital`, `control`, `linked`
- `parent_account_id` (string, optional, nullable) — The identifier of the parent account if this account is part of a hierarchy.
- `spend_control_id` (string, optional, nullable) — The identifier of the spend control applied to this account.
- `auto_top_up` (AutoTopUpResponse, optional, nullable) — Automatic top-up configuration, if enabled.
- `low_balance_notification` (LowBalanceNotificationResponse, optional, nullable) — Low-balance notification configuration, if enabled.

### Task

The progress of a background task started by your business, such as a bulk operation.

- `task_id` (string, required) — Penny's unique identifier for this task.
- `version` (integer, required) — A number that increases each time this task's details change. Use it to confirm you are looking at the latest information.
- `version_time` (datetime, required) — The date and time this task's details were last changed.
- `business_id` (string, required) — The business this task was run for.
- `status` (enum, required) — This task's current status: 'received', 'scheduled', 'pending', 'pending_subtasks', 'running', 'failed', 'completed', or 'cancelled'.
  - Allowed values: `received`, `scheduled`, `pending`, `pending_subtasks`, `running`, `failed`, `completed`, `cancelled`
- `source_reference` (TaskSourceReferenceResponse, optional, nullable) — The object that scheduled this task, if one is known.
- `scheduled_time` (datetime, optional, nullable) — When this task is scheduled to run.
- `start_time` (datetime, optional, nullable) — When this task started running.
- `finished_time` (datetime, optional, nullable) — When this task finished running.

### AutoTopUpResponse

- `source_account_id` (string, required) — The account from which funds are drawn during top-up.
- `source_account_type` (enum, required) — The type of account from which funds are drawn during top-up.
  - Allowed values: `capital`
- `threshold_amount` (string, required) — The balance amount below which an automatic top-up is triggered.
- `top_up_amount` (string, required) — The amount added to the account when a top-up is triggered.

### LowBalanceNotificationResponse

- `threshold_amount` (string, required) — The balance amount below which a low-balance notification is sent.

### TaskSourceReferenceResponse

The object that scheduled this task, such as a fee scheduling a follow-up assessment.

- `object_type` (enum, required) — The kind of object that scheduled this task.
  - Allowed values: `fee`, `program`, `business`, `card`
- `object_id` (string, required) — The unique identifier of the object that scheduled this task.

## Examples

**Response**

```json
{
  "item": {
    "account_id": "account_019372e3-b8dc-7de2-80b6-b8dcde20b6c9",
    "version": 1,
    "version_time": "2024-01-15T10:30:00Z",
    "program_id": "program_019377de-7f88-7f02-894f-7f88f0294fcb",
    "business_id": "business_01937b95-484e-75af-8c68-484e5afc68d3",
    "business_entity_id": "business_entity_01937c9d-3a1e-72b0-8881-3a1e2b088159",
    "status": "active",
    "active": true,
    "currency": "USD",
    "root": true,
    "available_balance": "1000.00",
    "total_balance": "1050.00",
    "alias": "operations-account",
    "description": "Primary operating account for day-to-day spend.",
    "type": "capital",
    "parent_account_id": "account_019372e3-b8dc-7de2-80b6-b8dcde20b6c9",
    "spend_control_id": "spend_control_019379d9-a170-796b-867a-a17096b67a21",
    "auto_top_up": {
      "source_account_id": "account_019372e3-b8dc-7de2-80b6-b8dcde20b6c9",
      "source_account_type": "capital",
      "threshold_amount": "500.00",
      "top_up_amount": "1000.00"
    },
    "low_balance_notification": {
      "threshold_amount": "200.00"
    }
  },
  "task": {
    "task_id": "task_0193749d-6d72-7481-83a4-6d724813a48a",
    "version": 1,
    "version_time": "2024-01-15T10:30:00Z",
    "business_id": "business_01937b95-484e-75af-8c68-484e5afc68d3",
    "status": "received",
    "source_reference": {
      "object_type": "fee",
      "object_id": "policy_01937df9-5eb9-784b-8aee-5eb984baee06"
    },
    "scheduled_time": "2024-01-15T10:30:00Z",
    "start_time": "2024-01-15T10:30:00Z",
    "finished_time": "2024-01-15T10:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://sandbox.api.thepennyinc.com/accounts/capital/account_id"

headers = {
    "X-Penny-As-Business": "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71",
    "Authorization": "Bearer <token>"
}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox.api.thepennyinc.com/accounts/capital/account_id';
const options = {
  method: 'DELETE',
  headers: {
    'X-Penny-As-Business': 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71',
    Authorization: 'Bearer <token>'
  }
};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.api.thepennyinc.com/accounts/capital/account_id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71")
	req.Header.Add("Authorization", "Bearer <token>")

	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://sandbox.api.thepennyinc.com/accounts/capital/account_id")

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

request = Net::HTTP::Delete.new(url)
request["X-Penny-As-Business"] = 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71'
request["Authorization"] = 'Bearer <token>'

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.delete("https://sandbox.api.thepennyinc.com/accounts/capital/account_id")
  .header("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://sandbox.api.thepennyinc.com/accounts/capital/account_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Penny-As-Business' => 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox.api.thepennyinc.com/accounts/capital/account_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Penny-As-Business": "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.api.thepennyinc.com/accounts/capital/account_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```