> 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 an application

POST https://sandbox.api.thepennyinc.com/access/applications/
Content-Type: application/json

Create and provision a machine application for your business. The client secret is returned only in this response and is not stored by Penny.

Required permissions: `permission:create`.

Reference: https://docs.thepennyinc.com/api-reference/penny-banking/access/applications/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 CreateApplicationRequest.

- `name` (string, required) — A recognizable name for the service or integration.
- `description` (string, required) — What the application does and why it needs access to your Penny account.
- `role_ids` (list of string, optional) — Custom or preset role IDs to assign to the application. An application can hold at most ten roles.
- `permissions` (list of PermissionInput, optional) — Permissions granted directly to the application in addition to permissions inherited from roles. Every permission is scoped to your business; scope, sub-type, and resource-ID restrictions are not client-configurable.
- `active` (boolean, optional, default: true) — Whether the application can request access tokens immediately after creation.

## Response

### 201

The newly created application, including its one-time client secret.

- `application` (MachineApplication, required) — The newly created application.
- `credentials` (ApplicationCredentialsResponse, required) — The one-time credentials for the newly created application.

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

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

### PermissionInput

A permission to grant to a user or application in your business. Specify the resource and the action to allow.

- `resource` (enum, required) — The resource type this permission applies to.
  - Allowed values: `business`, `sub_business`, `business_entity`, `business_defaults`, `user`, `role`, `permission`, `application`, `verification`, `account`, `ledger`, `transaction`, `card`, `cardholder`, `card_product`, `bin`, `spend_control`, `simulation`, `fee`, `program`, `task`, `notification_endpoint`, `notification_event`, `notification_decision_exchange`, `*`
- `action` (enum, required) — The action permitted on the resource.
  - Allowed values: `read`, `list`, `create`, `update`, `delete`, `execute`, `act_as`, `reveal`, `*`

### MachineApplication

A machine application that authenticates with Penny using OAuth2 client credentials. The client secret is returned separately, once when the application is created and again each time its credentials are rotated.

- `application_id` (string, required) — Penny's unique identifier for this application.
- `version` (integer, required) — A number that increases each time this application's details change. Use it to confirm you are looking at the latest information.
- `version_time` (datetime, required) — The date and time this application's details were last changed.
- `name` (string, required) — A human-readable name for this application.
- `description` (string, required) — A human-readable description of what this application does.
- `status` (enum, required) — This application's current lifecycle status: 'active', 'deactivated' (cannot authenticate), 'suspended' (restricted, typically pending review), or 'deleted'.
  - Allowed values: `active`, `deactivated`, `suspended`, `deleted`
- `active` (boolean, required) — Whether this application is currently active.
- `deleted` (boolean, required) — Whether this application has been removed.
- `business_id` (string, required) — The business this application belongs to.
- `roles` (list of RolePointerResponse, optional, nullable) — The roles assigned to this application, if any.
- `type` (enum, optional, default: machine) — The type of an application.
  - Allowed values: `machine`
- `permissions` (list of PermissionResponse, optional, nullable) — Permissions granted directly to this application, in addition to any granted through its roles.
- `client_id` (string, optional, nullable) — The OAuth2 client ID this application uses to authenticate with Penny. Absent while the application is being provisioned or after it has been deprovisioned.

### ApplicationCredentialsResponse

An application credential pair returned only when issued or rotated.

- `client_id` (string, required) — The client ID for the application.
- `client_secret` (string, required) — The new client secret. It is returned once and cannot be retrieved from Penny later.

### RolePointerResponse

A reference to a role assigned to a user or application.

- `role_id` (string, required) — The assigned role's ID: `role_…` for custom roles, `global_role_…` for preset roles.
- `role_type` (enum, required) — Whether this is a custom role owned by your business (`business`) or a preset role Penny provides for every business (`global`).
  - Allowed values: `business`, `global`

### PermissionResponse

A permission specifying the resource and action a user or application can access.

- `resource` (enum, required) — The resource type this permission applies to.
  - Allowed values: `business`, `sub_business`, `business_entity`, `business_defaults`, `user`, `role`, `permission`, `application`, `verification`, `account`, `ledger`, `transaction`, `card`, `cardholder`, `card_product`, `bin`, `spend_control`, `simulation`, `fee`, `program`, `task`, `notification_endpoint`, `notification_event`, `notification_decision_exchange`, `*`
- `action` (enum, required) — The action permitted on the resource.
  - Allowed values: `read`, `list`, `create`, `update`, `delete`, `execute`, `act_as`, `reveal`, `*`

## Examples

**Request**

```json
{
  "name": "Daily reporting export",
  "description": "Exports settled transactions to the finance data warehouse."
}
```

**Response**

```json
{
  "application": {
    "application_id": "application_01937c93-1d95-76f4-8400-1d956f44007c",
    "version": 1,
    "version_time": "2024-01-15T10:30:00Z",
    "name": "Nightly Settlement Job",
    "description": "Reconciles settlement batches with the processor each night.",
    "status": "active",
    "active": true,
    "deleted": false,
    "business_id": "business_01937b95-484e-75af-8c68-484e5afc68d3",
    "roles": [
      {
        "role_id": "role_019372e1-5661-79e1-83cf-56619e13cfc9",
        "role_type": "business"
      }
    ],
    "type": "machine",
    "permissions": [
      {
        "resource": "account",
        "action": "read"
      }
    ],
    "client_id": "cli_9f3a2b8e1c9d0012ab34cd"
  },
  "credentials": {
    "client_id": "string",
    "client_secret": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://sandbox.api.thepennyinc.com/access/applications/"

payload = {
    "name": "Daily reporting export",
    "description": "Exports settled transactions to the finance data warehouse."
}
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/access/applications/';
const options = {
  method: 'POST',
  headers: {
    'X-Penny-As-Business': 'business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Daily reporting export","description":"Exports settled transactions to the finance data warehouse."}'
};

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/access/applications/"

	payload := strings.NewReader("{\n  \"name\": \"Daily reporting export\",\n  \"description\": \"Exports settled transactions to the finance data warehouse.\"\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/access/applications/")

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  \"name\": \"Daily reporting export\",\n  \"description\": \"Exports settled transactions to the finance data warehouse.\"\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/access/applications/")
  .header("X-Penny-As-Business", "business_01a083e2-82ed-7a5c-9d1e-3b6f0c2a4d71")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Daily reporting export\",\n  \"description\": \"Exports settled transactions to the finance data warehouse.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.api.thepennyinc.com/access/applications/', [
  'body' => '{
  "name": "Daily reporting export",
  "description": "Exports settled transactions to the finance data warehouse."
}',
  '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/access/applications/");
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  \"name\": \"Daily reporting export\",\n  \"description\": \"Exports settled transactions to the finance data warehouse.\"\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 = [
  "name": "Daily reporting export",
  "description": "Exports settled transactions to the finance data warehouse."
] as [String : Any]

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

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