# Connect a lender's API

Connects, or changes, the API a Lenders record takes submissions through, so the send door delivers to it by API instead of refusing it. Body `{provider?, endpoint?, apiKey?, brokerId?, portalCredentials?, enabled?}`: a field left out keeps what is stored, a credential sent as "" clears it. `provider` (smartbiz, bitty, pirs, spectra, lendr, ecg, credibly) is inferred from the lender's name, portal and endpoint when omitted on a new connection, and the endpoint from its API endpoint or portal cell; an endpoint is https or empty. Answers the connection as `get_definitions_key_rows_rowId_api-connection` does, never a credential. Needs the seat that may edit the lender.

Access class: `def:read`.

## Endpoint

`PUT /v1/definitions/{key}/rows/{rowId}/api-connection`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "apiKey": "string",
  "brokerId": "",
  "enabled": true,
  "endpoint": "string",
  "portalCredentials": "string",
  "provider": "string"
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "apiKeyConfigured": true,
    "apiKeyLast4": "string",
    "brokerIdConfigured": true,
    "enabled": true,
    "endpoint": "string",
    "lenderRowId": "",
    "portalCredentialsConfigured": true,
    "provider": "string",
    "updatedAt": "2026-01-01T00:00:00Z",
    "updatedByAccountId": ""
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
