> 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.

# Create a control account

POST https://sandbox.api.thepennyinc.com/accounts/control/
Content-Type: application/json

Create a new control account under a capital account.

Required permissions: `account:create`.

Reference: https://docs.thepennyinc.com/api-reference/penny-banking/accounts/control/create

## 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

### 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.

### Body (application/json)

This endpoint expects a CreateControlAccountRequest.

- `source_capital_account_id` (string, required) — Unique identifier of the capital account to which this control account is linked. This account will act as the funds source for the control account.
- `parent_control_account_id` (string, optional) — Optional parent Control Account. When set, the new account is created within that account's hierarchy; when omitted, it is created directly under the source Capital Account.
- `alias` (string, optional, nullable) — Optional human-readable label for the account.
- `description` (string, optional, nullable) — Optional description of the account's intended use.
- `spend_control_id` (string, optional) — Optional spend control to attach at creation.
- `active` (boolean, optional, default: true) — Whether the account is created in an active state.

## Response

### 201

The newly created control account.

- `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`
- `capital_account_id` (string, required) — The capital account from which this control account draws funds.
- `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: control) — 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.

## 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 source capital account, spend control, or parent control 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.

## Examples

**Request**

```json
{
  "source_capital_account_id": "account_01a083e2-82ed-720b-b737-11cf8b97978e"
}
```

**Response**

```json
{
  "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",
  "capital_account_id": "account_019372e3-b8dc-7de2-80b6-b8dcde20b6c9",
  "alias": "operations-account",
  "description": "Primary operating account for day-to-day spend.",
  "type": "control",
  "parent_account_id": "account_019372e3-b8dc-7de2-80b6-b8dcde20b6c9",
  "spend_control_id": "spend_control_019379d9-a170-796b-867a-a17096b67a21"
}
```

**SDK Code**

```python
import requests

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

payload = { "source_capital_account_id": "account_01a083e2-82ed-720b-b737-11cf8b97978e" }
headers = {
    "X-Penny-As-Business": "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://sandbox.api.thepennyinc.com/accounts/control/';
const options = {
  method: 'POST',
  headers: {
    'X-Penny-As-Business': 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"source_capital_account_id":"account_01a083e2-82ed-720b-b737-11cf8b97978e"}'
};

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

	payload := strings.NewReader("{\n  \"source_capital_account_id\": \"account_01a083e2-82ed-720b-b737-11cf8b97978e\"\n}")

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

	req.Header.Add("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71")
	req.Header.Add("Authorization", "Bearer <token>")
	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://sandbox.api.thepennyinc.com/accounts/control/")

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

request = Net::HTTP::Post.new(url)
request["X-Penny-As-Business"] = 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"source_capital_account_id\": \"account_01a083e2-82ed-720b-b737-11cf8b97978e\"\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://sandbox.api.thepennyinc.com/accounts/control/")
  .header("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"source_capital_account_id\": \"account_01a083e2-82ed-720b-b737-11cf8b97978e\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.api.thepennyinc.com/accounts/control/', [
  'body' => '{
  "source_capital_account_id": "account_01a083e2-82ed-720b-b737-11cf8b97978e"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    '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/control/");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"source_capital_account_id\": \"account_01a083e2-82ed-720b-b737-11cf8b97978e\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Penny-As-Business": "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["source_capital_account_id": "account_01a083e2-82ed-720b-b737-11cf8b97978e"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.api.thepennyinc.com/accounts/control/")! 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()
```