Autocomplete API Integration Guide
This guide walks through how to integrate with Middesk’s Business Identities Autocomplete API, which returns real-time, structured autocomplete suggestions based on partial business names.
You’ll find:
- High-level design and security requirements
- Step-by-step integration instructions
- Rate limits and performance expectations
- Full API Reference
Example End-to-End Flow
-
A user types a partial business name in your application (e.g.,
"dunder"). -
Your frontend sends a request to Middesk's
POST /v1/identities/autocompleteendpoint using a Publishable API key. -
Middesk returns a list of structured business identity suggestions:
- Names
- Addresses
- People
- Entity type
-
Your frontend renders the results in the user's UI.
-
Once a user selects the correct business, send a Smart Populate request or a Business Enrichment Order request to Middesk, to retrieve additional business attributes that can be used to pre-populate fields for the user and streamline the onboarding flow.
- Smart Populate is a synchronous API, while a Business Enrichment Order is asynchronous, and offers higher coverage for certain business attributes.
Security Requirements
To ensure the integrity and appropriate use of this API:
- Publishable API key authentication: Each request must include a Middesk Publishable API key via the
Authorization: Bearerheader. - KYC enforcement: You should perform KYC checks prior to querying Middesk when possible.
- Abuse prevention: You are responsible for preventing automated abuse or excessive velocity and volume (e.g., bots, scraping).
Integration Instructions
Step 1: Locate Your Publishable API Key
A Publishable API is needed to authenticate requests:
- Publishable API keys are available in the Middesk Dashboard
- Use the "Publishable Test API Key" for sandbox testing
- Use the "Publishable Live API Key" for production
- Include the Publishable API key in the
Authorizationheader using Bearer authorization:
Authorization: Bearer <API_KEY>
Refer to Middesk’s Getting Started Guide for more detail.
Step 2: Make an Autocomplete Request
curl -X POST "https://api.middesk.com/v1/identities/autocomplete" \
-H "Authorization: Bearer <PUBLISHABLE API KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Dunder Mif",
"entity_type": "CORPORATION",
"addresses": [
{
"address_line1": "1725 Slough Avenue",
"city": "Scranton",
"state": "PA",
"postal_code": "18501"
}
]
}'
A successful request returns a 200 OK with a list of business identity suggestions in the response body. Refer to the API Reference below for more detail.
Latency Benchmarks
| Metric | Target |
|---|---|
| p95 latency | < 300ms |
| p99 latency | < 650ms |
Performance is monitored and alerts are triggered if p95 latency exceeds 300ms over sustained periods.
API Reference
Method: POST
URL: https://api.middesk.com/v1/identities/autocomplete
Headers: Include the API key in the Authorization header using Bearer authorization
Request body:
| Parameter | Description | Required |
|---|---|---|
| name | Partial or full business name. Minimum of 3 characters required. | Yes |
| addresses | List of addresses (described below) associated to the business. | No |
| entity_type | Entity type of business. | No |
Address body
| Parameter | Description | Required |
|---|---|---|
| address_line1 | First line of address | No |
| state | State | No |
| city | City | No |
| postal_code | Postal code | No |
Example Request
curl -X POST "https://api.middesk.com/v1/identities/autocomplete" \
-H "Authorization: Bearer <PUBLISHABLE API KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Dunder Mif",
"entity_type": "CORPORATION",
"addresses": [
{
"address_line1": "1725 Slough Avenue",
"city": "Scranton",
"state": "PA",
"postal_code": "18501"
}
]
}'
Response Statuses:
| Code | Description |
|---|---|
| 200 | Success |
| 401 | Unauthorized |
| 422 | Invalid parameters |
| 429 | Rate limit exceeded |
Example Responses
{
"data": [
{
"names": [
{ "name": "Dunder Mifflin", "type": "legal" },
{ "name": "Dunder Mifflinfinity", "type": "dba" }
],
"addresses": [
{
"full_address": "1725 Slough Avenue, Suite 200, Scranton, PA 18505",
"labels": ["office"]
}
],
"people": [
{ "name": "David Wallace" },
{ "name": "Robert Kazamakis" },
{ "name": "Jolene Bennett" }
],
"entity_type": "COPRPORATION"
}
]
}
{
"error": "Unauthorized",
"message": "Missing or invalid API key"
}
{
"error": "Invalid request",
"message": "Missing required query parameter: name"
}
{
"error": "Rate limit exceeded",
"message": "Too many requests in a short period of time"
}
Response Schema
| Field | Type | Description |
|---|---|---|
data | BusinessIdentity[] | Array of business identities. |
BusinessIdentity
| Field | Type | Description |
|---|---|---|
names | Name[] | Array of name records for the business. Up to 3 results returned. |
addresses | Address[] | Array of known addresses for the business. Up to 3 results returned. |
people | Person[] | Array of associated people. Up to 3 results returned. |
entity_type | string| null | The legal structure of the entity. Possible values: LLC, CORPORATION, NON_PROFIT, PARTNERSHIP , and TRUST |
Name
| Field | Type | Description |
|---|---|---|
name | string | A name associated with the business. |
type | string | The name type. Possible values: dba or legal |
Address
| Field | Type | Description |
|---|---|---|
full_address | string | Full normalized address. |
address_line1 | string | null | |
address_line2 | string | null | |
city | string | null | |
state | string | null | |
postal_code | string | null | |
labels | string[] | The labels applied to the address. Possible values: billing, mailing, office, officer, primary, registered_agent, and shipping |
Person
| Field | Type | Description |
|---|---|---|
name | string | Full name of associated person. |
titles | string[] | List of titles associated with person. |
Updated about 18 hours ago