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

# Create an action on an object

POST https://api.middesk.com/v1/actions
Content-Type: application/json

Reference: https://docs.middesk.com/api-reference/business-verification/actions/create-action

## Authentication

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

## Request

### Body (application/json)

This endpoint expects an object.

- `object_type` (enum, required) — Type of object to perform the action on
  - Allowed values: `businesses`, `watchlist_result`
- `object_id` (string, required) — ID of the object to perform the action on
- `type` (enum, required) — The type of action to perform
  - Allowed values: `add_sources`, `add_attributes`, `verify_tin`, `decision`, `dismissal`
- `payload` (map from string to any, required) — Action-specific parameters (varies by action type)
- `note` (string, optional) — Optional text note describing the reason for the action
- `thread_id` (string, optional) — Optional operator thread ID used to resolve an action actor
- `run_id` (string, optional) — Optional operator run ID used to resolve an action actor

## Response

### 201

action created - verify TIN

- `id` (string, required)
- `type` (enum, required) — The action type that was performed
  - Allowed values: `add_sources`, `add_attributes`, `update_address_risk`, `verify_tin`, `decision`, `dismissal`
- `object_type` (enum, required) — The type of object the action was performed on
  - Allowed values: `Business`, `Watchlist::Result`
- `object_id` (string, required) — The ID of the object the action was performed on
- `created_at` (datetime, required)
- `effects` (list of ActionEffect, required) — List of effects describing what changed
- `actors` (list of ActionActor, required) — List of actors describing who initiated the action
- `note` (string, optional, nullable) — Optional text note describing the reason for the action
- `metadata` (map from string to any, optional) — Additional metadata associated with the action

## Errors

### 400 Create Action Request Bad Request Error

invalid action type

- `errors` (list of ErrorResponseErrorsItem, required)

### 404 Create Action Request Not Found Error

object not found

- `errors` (list of ErrorResponseErrorsItem, required)

### 422 Create Action Request Unprocessable Entity Error

invalid payload

- `errors` (list of ErrorResponseErrorsItem, required)

## Types

### ActionEffect

- `operation` (enum, required) — The type of change that was made
  - Allowed values: `created`, `updated`, `linked`
- `diff` (map from string to any, required, nullable) — Before/after values for each changed field
- `target` (ActionEffectTarget, required, nullable)

### ActionActor

- `actor_type` (enum, required) — The type of actor
  - Allowed values: `account`, `user`, `run`
- `data` (map from string to any, optional) — Actor details (varies by actor type)

### ErrorResponseErrorsItem

- `message` (string, required)
- `parameter` (string, optional) — Request parameter associated with the error, when applicable

### ActionEffectTarget

- `object` (string, required) — The type of the affected resource
- `id` (string, required) — The ID of the affected resource

## Examples

### Add external data sources to a business

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "created",
      "diff": null,
      "target": {
        "object": "faa_airmen_certificate",
        "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    },
    {
      "actor_type": "run",
      "data": {
        "agent": "address_verification",
        "id": "66666666-7777-8888-9999-000000000000",
        "status": "running",
        "thread_id": "11111111-2222-3333-4444-555555555555"
      }
    }
  ],
  "note": "Adding government verification source",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Add external data sources to a business
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "add_sources",
    "payload": { "sources": [
            {
                "addresses": [{ "full_address": "123 Main St, San Francisco, CA 94102" }],
                "people": [
                    {
                        "name": "Kyle Mack",
                        "titles": ["Registered Agent"]
                    }
                ],
                "source_name": "FAA Airmen Registry",
                "source_type": "faa_airmen_certificate",
                "tier": "government",
                "url": "https://faa.gov/pilots/records"
            }
        ] },
    "note": "Adding government verification source",
    "thread_id": "11111111-2222-3333-4444-555555555555",
    "run_id": "66666666-7777-8888-9999-000000000000"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add external data sources to a business
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"add_sources","payload":{"sources":[{"addresses":[{"full_address":"123 Main St, San Francisco, CA 94102"}],"people":[{"name":"Kyle Mack","titles":["Registered Agent"]}],"source_name":"FAA Airmen Registry","source_type":"faa_airmen_certificate","tier":"government","url":"https://faa.gov/pilots/records"}]},"note":"Adding government verification source","thread_id":"11111111-2222-3333-4444-555555555555","run_id":"66666666-7777-8888-9999-000000000000"}'
};

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

```go Add external data sources to a business
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")

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

	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 Add external data sources to a business
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}"

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

```java Add external data sources to a business
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")
  .asString();
```

```php Add external data sources to a business
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Add external data sources to a business
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add external data sources to a business
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": ["sources": [
      [
        "addresses": [["full_address": "123 Main St, San Francisco, CA 94102"]],
        "people": [
          [
            "name": "Kyle Mack",
            "titles": ["Registered Agent"]
          ]
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      ]
    ]],
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```

### Add addresses and people to a business

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_attributes",
  "payload": {
    "addresses": [
      {
        "full_address": "456 Oak Ave, Los Angeles, CA 90001"
      }
    ],
    "people": [
      {
        "name": "Kyle Mack",
        "titles": [
          "CEO"
        ]
      }
    ]
  },
  "note": "Adding verified address"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "created",
      "diff": null,
      "target": {
        "object": "faa_airmen_certificate",
        "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    },
    {
      "actor_type": "run",
      "data": {
        "agent": "address_verification",
        "id": "66666666-7777-8888-9999-000000000000",
        "status": "running",
        "thread_id": "11111111-2222-3333-4444-555555555555"
      }
    }
  ],
  "note": "Adding government verification source",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Add addresses and people to a business
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "add_attributes",
    "payload": {
        "addresses": [{ "full_address": "456 Oak Ave, Los Angeles, CA 90001" }],
        "people": [
            {
                "name": "Kyle Mack",
                "titles": ["CEO"]
            }
        ]
    },
    "note": "Adding verified address"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add addresses and people to a business
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"add_attributes","payload":{"addresses":[{"full_address":"456 Oak Ave, Los Angeles, CA 90001"}],"people":[{"name":"Kyle Mack","titles":["CEO"]}]},"note":"Adding verified address"}'
};

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

```go Add addresses and people to a business
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_attributes\",\n  \"payload\": {\n    \"addresses\": [\n      {\n        \"full_address\": \"456 Oak Ave, Los Angeles, CA 90001\"\n      }\n    ],\n    \"people\": [\n      {\n        \"name\": \"Kyle Mack\",\n        \"titles\": [\n          \"CEO\"\n        ]\n      }\n    ]\n  },\n  \"note\": \"Adding verified address\"\n}")

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

	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 Add addresses and people to a business
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_attributes\",\n  \"payload\": {\n    \"addresses\": [\n      {\n        \"full_address\": \"456 Oak Ave, Los Angeles, CA 90001\"\n      }\n    ],\n    \"people\": [\n      {\n        \"name\": \"Kyle Mack\",\n        \"titles\": [\n          \"CEO\"\n        ]\n      }\n    ]\n  },\n  \"note\": \"Adding verified address\"\n}"

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

```java Add addresses and people to a business
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_attributes\",\n  \"payload\": {\n    \"addresses\": [\n      {\n        \"full_address\": \"456 Oak Ave, Los Angeles, CA 90001\"\n      }\n    ],\n    \"people\": [\n      {\n        \"name\": \"Kyle Mack\",\n        \"titles\": [\n          \"CEO\"\n        ]\n      }\n    ]\n  },\n  \"note\": \"Adding verified address\"\n}")
  .asString();
```

```php Add addresses and people to a business
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_attributes",
  "payload": {
    "addresses": [
      {
        "full_address": "456 Oak Ave, Los Angeles, CA 90001"
      }
    ],
    "people": [
      {
        "name": "Kyle Mack",
        "titles": [
          "CEO"
        ]
      }
    ]
  },
  "note": "Adding verified address"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Add addresses and people to a business
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_attributes\",\n  \"payload\": {\n    \"addresses\": [\n      {\n        \"full_address\": \"456 Oak Ave, Los Angeles, CA 90001\"\n      }\n    ],\n    \"people\": [\n      {\n        \"name\": \"Kyle Mack\",\n        \"titles\": [\n          \"CEO\"\n        ]\n      }\n    ]\n  },\n  \"note\": \"Adding verified address\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add addresses and people to a business
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_attributes",
  "payload": [
    "addresses": [["full_address": "456 Oak Ave, Los Angeles, CA 90001"]],
    "people": [
      [
        "name": "Kyle Mack",
        "titles": ["CEO"]
      ]
    ]
  ],
  "note": "Adding verified address"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```

### Approve or reject a business

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "decision",
  "payload": {
    "status": "approved"
  },
  "note": "Approved after manual review"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "created",
      "diff": null,
      "target": {
        "object": "faa_airmen_certificate",
        "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    },
    {
      "actor_type": "run",
      "data": {
        "agent": "address_verification",
        "id": "66666666-7777-8888-9999-000000000000",
        "status": "running",
        "thread_id": "11111111-2222-3333-4444-555555555555"
      }
    }
  ],
  "note": "Adding government verification source",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Approve or reject a business
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "decision",
    "payload": { "status": "approved" },
    "note": "Approved after manual review"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approve or reject a business
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"decision","payload":{"status":"approved"},"note":"Approved after manual review"}'
};

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

```go Approve or reject a business
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"decision\",\n  \"payload\": {\n    \"status\": \"approved\"\n  },\n  \"note\": \"Approved after manual review\"\n}")

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

	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 Approve or reject a business
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"decision\",\n  \"payload\": {\n    \"status\": \"approved\"\n  },\n  \"note\": \"Approved after manual review\"\n}"

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

```java Approve or reject a business
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"decision\",\n  \"payload\": {\n    \"status\": \"approved\"\n  },\n  \"note\": \"Approved after manual review\"\n}")
  .asString();
```

```php Approve or reject a business
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "decision",
  "payload": {
    "status": "approved"
  },
  "note": "Approved after manual review"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve or reject a business
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"decision\",\n  \"payload\": {\n    \"status\": \"approved\"\n  },\n  \"note\": \"Approved after manual review\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve or reject a business
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "decision",
  "payload": ["status": "approved"],
  "note": "Approved after manual review"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```

### Verify a TIN via document

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "verify_tin",
  "payload": {
    "document_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
  }
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "created",
      "diff": null,
      "target": {
        "object": "faa_airmen_certificate",
        "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    },
    {
      "actor_type": "run",
      "data": {
        "agent": "address_verification",
        "id": "66666666-7777-8888-9999-000000000000",
        "status": "running",
        "thread_id": "11111111-2222-3333-4444-555555555555"
      }
    }
  ],
  "note": "Adding government verification source",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Verify a TIN via document
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "verify_tin",
    "payload": { "document_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab" }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Verify a TIN via document
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"verify_tin","payload":{"document_id":"a1b2c3d4-5678-90ab-cdef-1234567890ab"}}'
};

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

```go Verify a TIN via document
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"verify_tin\",\n  \"payload\": {\n    \"document_id\": \"a1b2c3d4-5678-90ab-cdef-1234567890ab\"\n  }\n}")

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

	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 Verify a TIN via document
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"verify_tin\",\n  \"payload\": {\n    \"document_id\": \"a1b2c3d4-5678-90ab-cdef-1234567890ab\"\n  }\n}"

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

```java Verify a TIN via document
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"verify_tin\",\n  \"payload\": {\n    \"document_id\": \"a1b2c3d4-5678-90ab-cdef-1234567890ab\"\n  }\n}")
  .asString();
```

```php Verify a TIN via document
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "verify_tin",
  "payload": {
    "document_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Verify a TIN via document
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"verify_tin\",\n  \"payload\": {\n    \"document_id\": \"a1b2c3d4-5678-90ab-cdef-1234567890ab\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Verify a TIN via document
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "verify_tin",
  "payload": ["document_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```

### Add sources

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "created",
      "diff": null,
      "target": {
        "object": "faa_airmen_certificate",
        "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    },
    {
      "actor_type": "run",
      "data": {
        "agent": "address_verification",
        "id": "66666666-7777-8888-9999-000000000000",
        "status": "running",
        "thread_id": "11111111-2222-3333-4444-555555555555"
      }
    }
  ],
  "note": "Adding government verification source",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Add sources
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "add_sources",
    "payload": { "sources": [
            {
                "addresses": [{ "full_address": "123 Main St, San Francisco, CA 94102" }],
                "people": [
                    {
                        "name": "Kyle Mack",
                        "titles": ["Registered Agent"]
                    }
                ],
                "source_name": "FAA Airmen Registry",
                "source_type": "faa_airmen_certificate",
                "tier": "government",
                "url": "https://faa.gov/pilots/records"
            }
        ] },
    "note": "Adding government verification source",
    "thread_id": "11111111-2222-3333-4444-555555555555",
    "run_id": "66666666-7777-8888-9999-000000000000"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add sources
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"add_sources","payload":{"sources":[{"addresses":[{"full_address":"123 Main St, San Francisco, CA 94102"}],"people":[{"name":"Kyle Mack","titles":["Registered Agent"]}],"source_name":"FAA Airmen Registry","source_type":"faa_airmen_certificate","tier":"government","url":"https://faa.gov/pilots/records"}]},"note":"Adding government verification source","thread_id":"11111111-2222-3333-4444-555555555555","run_id":"66666666-7777-8888-9999-000000000000"}'
};

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

```go Add sources
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")

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

	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 Add sources
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Add sources
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add sources
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": ["sources": [
      [
        "addresses": [["full_address": "123 Main St, San Francisco, CA 94102"]],
        "people": [
          [
            "name": "Kyle Mack",
            "titles": ["Registered Agent"]
          ]
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      ]
    ]],
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```

### Decision

**Request**

```json
{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "decision",
  "object_type": "Business",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "created_at": "2026-01-15T12:00:00Z",
  "effects": [
    {
      "operation": "updated",
      "diff": {
        "status": {
          "from": "in_review",
          "to": "approved"
        }
      },
      "target": {
        "object": "business",
        "id": "b1c2d3e4-5678-90ab-cdef-1234567890ab"
      }
    }
  ],
  "actors": [
    {
      "actor_type": "account",
      "data": {
        "id": "d1e2f3a4-5678-90ab-cdef-1234567890ab",
        "name": "Example Account"
      }
    }
  ],
  "note": "Approved after manual review",
  "metadata": {
    "key": "value"
  }
}
```

**SDK Code**

```python Decision
import requests

url = "https://api.middesk.com/v1/actions"

payload = {
    "object_type": "businesses",
    "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
    "type": "add_sources",
    "payload": { "sources": [
            {
                "addresses": [{ "full_address": "123 Main St, San Francisco, CA 94102" }],
                "people": [
                    {
                        "name": "Kyle Mack",
                        "titles": ["Registered Agent"]
                    }
                ],
                "source_name": "FAA Airmen Registry",
                "source_type": "faa_airmen_certificate",
                "tier": "government",
                "url": "https://faa.gov/pilots/records"
            }
        ] },
    "note": "Adding government verification source",
    "thread_id": "11111111-2222-3333-4444-555555555555",
    "run_id": "66666666-7777-8888-9999-000000000000"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Decision
const url = 'https://api.middesk.com/v1/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"object_type":"businesses","object_id":"b1c2d3e4-5678-90ab-cdef-1234567890ab","type":"add_sources","payload":{"sources":[{"addresses":[{"full_address":"123 Main St, San Francisco, CA 94102"}],"people":[{"name":"Kyle Mack","titles":["Registered Agent"]}],"source_name":"FAA Airmen Registry","source_type":"faa_airmen_certificate","tier":"government","url":"https://faa.gov/pilots/records"}]},"note":"Adding government verification source","thread_id":"11111111-2222-3333-4444-555555555555","run_id":"66666666-7777-8888-9999-000000000000"}'
};

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

```go Decision
package main

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

func main() {

	url := "https://api.middesk.com/v1/actions"

	payload := strings.NewReader("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")

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

	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 Decision
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/actions")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/actions', [
  'body' => '{
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": {
    "sources": [
      {
        "addresses": [
          {
            "full_address": "123 Main St, San Francisco, CA 94102"
          }
        ],
        "people": [
          {
            "name": "Kyle Mack",
            "titles": [
              "Registered Agent"
            ]
          }
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      }
    ]
  },
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Decision
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"object_type\": \"businesses\",\n  \"object_id\": \"b1c2d3e4-5678-90ab-cdef-1234567890ab\",\n  \"type\": \"add_sources\",\n  \"payload\": {\n    \"sources\": [\n      {\n        \"addresses\": [\n          {\n            \"full_address\": \"123 Main St, San Francisco, CA 94102\"\n          }\n        ],\n        \"people\": [\n          {\n            \"name\": \"Kyle Mack\",\n            \"titles\": [\n              \"Registered Agent\"\n            ]\n          }\n        ],\n        \"source_name\": \"FAA Airmen Registry\",\n        \"source_type\": \"faa_airmen_certificate\",\n        \"tier\": \"government\",\n        \"url\": \"https://faa.gov/pilots/records\"\n      }\n    ]\n  },\n  \"note\": \"Adding government verification source\",\n  \"thread_id\": \"11111111-2222-3333-4444-555555555555\",\n  \"run_id\": \"66666666-7777-8888-9999-000000000000\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Decision
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "object_type": "businesses",
  "object_id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
  "type": "add_sources",
  "payload": ["sources": [
      [
        "addresses": [["full_address": "123 Main St, San Francisco, CA 94102"]],
        "people": [
          [
            "name": "Kyle Mack",
            "titles": ["Registered Agent"]
          ]
        ],
        "source_name": "FAA Airmen Registry",
        "source_type": "faa_airmen_certificate",
        "tier": "government",
        "url": "https://faa.gov/pilots/records"
      ]
    ]],
  "note": "Adding government verification source",
  "thread_id": "11111111-2222-3333-4444-555555555555",
  "run_id": "66666666-7777-8888-9999-000000000000"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/actions")! 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()
```