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

# Create API Key Connection

POST https://integrations/accounts/connect/nmi
Content-Type: multipart/form-data

Validates credentials and creates a ConnectedAccount for a non-OAuth platform.

The credential fields vary per platform — use GET /accounts/connect/{platform} to discover required fields.

Returns 409 Conflict if an active connection already exists for this tenant+platform.
Returns 422 if credentials fail validation against the platform API.

Reference: https://docs.itspropel.com/propel-biz/16-integrations/api-key-connections/create-api-key-connection

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /integrations/accounts/connect/nmi:
    post:
      operationId: create-api-key-connection
      summary: Create API Key Connection
      description: >-
        Validates credentials and creates a ConnectedAccount for a non-OAuth
        platform.


        The credential fields vary per platform — use GET
        /accounts/connect/{platform} to discover required fields.


        Returns 409 Conflict if an active connection already exists for this
        tenant+platform.

        Returns 422 if credentials fail validation against the platform API.
      tags:
        - subpackage_16Integrations.subpackage_16Integrations/apiKeyConnections
      parameters:
        - name: '{{tenant_key_name}}'
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/16 Integrations_API Key
                  Connections_Create API Key Connection_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                external_account_id:
                  type: string
                  description: >-
                    Optional: External merchant/account ID from the platform -
                    max 255 chars - "merchant_123"
                credentials[api_key]:
                  type: string
                  description: >-
                    Required (NMI): API key for authentication - string -
                    "sk_test_abc123"
                credentials[public_key]:
                  type: string
                  description: >-
                    Optional (NMI): Public key for frontend card tokenization -
                    string - "pk_test_xyz789"
                credentials[environment]:
                  type: string
                  description: >-
                    Required (NMI): Environment to connect to -
                    sandbox|production - "sandbox"
                credentials[webhook_signing_key]:
                  type: string
                  description: >-
                    Optional (NMI): Webhook signing key for signature
                    verification - string
              required:
                - external_account_id
                - credentials[api_key]
                - credentials[public_key]
                - credentials[environment]
                - credentials[webhook_signing_key]
servers:
  - url: https:/
components:
  schemas:
    16 Integrations_API Key Connections_Create API Key Connection_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: >-
        16 Integrations_API Key Connections_Create API Key
        Connection_Response_200

```

## SDK Code Examples

```python
import requests

url = "https://https/integrations/accounts/connect/nmi"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_account_id\"\r\n\r\nmerchant_987654321\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[api_key]\"\r\n\r\nsk_test_4eC39HqLyjWDarjtT1zdp7dc\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[public_key]\"\r\n\r\npk_test_TYooMQauvdEDq54NiTphI7jx\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[environment]\"\r\n\r\nsandbox\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[webhook_signing_key]\"\r\n\r\nwhsec_1234567890abcdef\r\n-----011000010111000001101001--\r\n"
headers = {
    "{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

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

print(response.json())
```

```javascript
const url = 'https://https/integrations/accounts/connect/nmi';
const form = new FormData();
form.append('external_account_id', 'merchant_987654321');
form.append('credentials[api_key]', 'sk_test_4eC39HqLyjWDarjtT1zdp7dc');
form.append('credentials[public_key]', 'pk_test_TYooMQauvdEDq54NiTphI7jx');
form.append('credentials[environment]', 'sandbox');
form.append('credentials[webhook_signing_key]', 'whsec_1234567890abcdef');

const options = {
  method: 'POST',
  headers: {'{{tenant_key_name}}': '{{tenant_key_value1}}|{{tenant_key_value2}}'}
};

options.body = form;

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://https/integrations/accounts/connect/nmi"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_account_id\"\r\n\r\nmerchant_987654321\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[api_key]\"\r\n\r\nsk_test_4eC39HqLyjWDarjtT1zdp7dc\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[public_key]\"\r\n\r\npk_test_TYooMQauvdEDq54NiTphI7jx\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[environment]\"\r\n\r\nsandbox\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[webhook_signing_key]\"\r\n\r\nwhsec_1234567890abcdef\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")

	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://https/integrations/accounts/connect/nmi")

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

request = Net::HTTP::Post.new(url)
request["{{tenant_key_name}}"] = '{{tenant_key_value1}}|{{tenant_key_value2}}'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_account_id\"\r\n\r\nmerchant_987654321\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[api_key]\"\r\n\r\nsk_test_4eC39HqLyjWDarjtT1zdp7dc\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[public_key]\"\r\n\r\npk_test_TYooMQauvdEDq54NiTphI7jx\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[environment]\"\r\n\r\nsandbox\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[webhook_signing_key]\"\r\n\r\nwhsec_1234567890abcdef\r\n-----011000010111000001101001--\r\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://https/integrations/accounts/connect/nmi")
  .header("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_account_id\"\r\n\r\nmerchant_987654321\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[api_key]\"\r\n\r\nsk_test_4eC39HqLyjWDarjtT1zdp7dc\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[public_key]\"\r\n\r\npk_test_TYooMQauvdEDq54NiTphI7jx\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[environment]\"\r\n\r\nsandbox\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[webhook_signing_key]\"\r\n\r\nwhsec_1234567890abcdef\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/integrations/accounts/connect/nmi', [
  'multipart' => [
    [
        'name' => 'external_account_id',
        'contents' => 'merchant_987654321'
    ],
    [
        'name' => 'credentials[api_key]',
        'contents' => 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    ],
    [
        'name' => 'credentials[public_key]',
        'contents' => 'pk_test_TYooMQauvdEDq54NiTphI7jx'
    ],
    [
        'name' => 'credentials[environment]',
        'contents' => 'sandbox'
    ],
    [
        'name' => 'credentials[webhook_signing_key]',
        'contents' => 'whsec_1234567890abcdef'
    ]
  ]
  'headers' => [
    '{{tenant_key_name}}' => '{{tenant_key_value1}}|{{tenant_key_value2}}',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://https/integrations/accounts/connect/nmi");
var request = new RestRequest(Method.POST);
request.AddHeader("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_account_id\"\r\n\r\nmerchant_987654321\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[api_key]\"\r\n\r\nsk_test_4eC39HqLyjWDarjtT1zdp7dc\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[public_key]\"\r\n\r\npk_test_TYooMQauvdEDq54NiTphI7jx\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[environment]\"\r\n\r\nsandbox\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credentials[webhook_signing_key]\"\r\n\r\nwhsec_1234567890abcdef\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}"]
let parameters = [
  [
    "name": "external_account_id",
    "value": "merchant_987654321"
  ],
  [
    "name": "credentials[api_key]",
    "value": "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
  ],
  [
    "name": "credentials[public_key]",
    "value": "pk_test_TYooMQauvdEDq54NiTphI7jx"
  ],
  [
    "name": "credentials[environment]",
    "value": "sandbox"
  ],
  [
    "name": "credentials[webhook_signing_key]",
    "value": "whsec_1234567890abcdef"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/integrations/accounts/connect/nmi")! 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()
```