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

# Monitor business names

> Learn how to handle changes to business names.

Monitor for changes to a business's name to ensure your records stay accurate as a business rebrands, files a new DBA, or changes legal entity name. Middesk discovers name changes from Secretary of State filings and other authoritative sources, so the events you receive reflect changes in the business's underlying registration data — not just informal usage.

To handle changes to a business's name, subscribe to the `name.created` and `name.deleted` [events](../monitor-activity/events) in your webhook endpoint:

* `name.created` — a new name variant was discovered (for example, a newly filed DBA or a renamed entity).
* `name.deleted` — a previously known name is no longer associated with the business.

**`Ruby`**

```ruby title="Ruby"
require 'json'

# Sinatra
post '/my/monitoring_webhook/url' do
  payload = request.body.read
  event = JSON.parse(payload)

  case event.type
  when 'name.created'
    name_event = event['data']['object']
    business_id = name_event['business_id']
    puts 'Business name changed!
  else
    # Unexpected event type
    status 400
    return
  end

  status 200
end
```

**`Python`**

```python title="Python"
from flask import Flask, request, jsonify

app = Flask(__name__)

# Flask
@app.route('/my/monitoring_webhook/url', methods=['POST'])
def monitoring_webhook():
    payload = request.data
    event = request.get_json()

    if event['type'] == 'name.created':
        name_event = event['data']['object']
        business_id = name_event['business_id']
        print('Business name changed!')
    else:
        # Unexpected event type
        return '', 400

    return '', 200

if __name__ == '__main__':
    app.run(debug=True)
```

**`JavaScript`**

```javascript title="JavaScript"
const express = require('express');
const app = express();

app.use(express.json()); // Middleware to parse JSON request bodies

// Express route
app.post('/my/monitoring_webhook/url', (req, res) => {
    const event = req.body;

    if (event.type === 'name.created') {
        const nameEvent = event.data.object;
        const businessId = nameEvent.business_id;
        console.log('Business name changed!');
    } else {
        // Unexpected event type
        return res.sendStatus(400);
    }

    res.sendStatus(200);
});

// Start the Express server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
    console.log(`Server is running on port ${PORT}`);
});
```

### Use the event payload

Depending on your use case, you can use the name event directly (like storing the new name for review in your application) or use the event as a trigger to reevaluate the approval status of the business using the full business payload.

**`name.created.json`**

```json title="name.created.json"
{
  "object": "name",
  "id": "8d876707-651d-46ab-94e2-3f9062b4c0dd",
  "name": "A new state",
  "submitted": false,
  "type": null,
  "business_id": "2f30n1b4-c508-4792-9354-e59b5a9e1adf",
  "sources": [
    {
      "id": "c6f763df-494d-4446-b328-9a27484b24db",
      "type": "registration",
      "metadata": {
        "state": "MO",
        "status": "inactive",
        "file_number": "X00781734",
        "jurisdiction": "DOMESTIC"
      }
    }
  ]
}
```

### Use business review tasks

Reevaluate the business's review tasks by requesting the full business payload using the [GET /businesses endpoint](/api-reference/business-verification/businesses/retrieve-a-business).

For example, use the [Name Review Task](/reference/business-review-tasks#name-review-task-outcomes) to evaluate whether the name still matches to the submitted business name.

**`Ruby`**

```ruby title="Ruby"
require 'net/http'
require 'net/https'
require 'json'

def send_request
	business_id = "<business_id>"
  uri = URI("https://api.middesk.com/v1/businesses/#{business_id}")

  # Create client
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER

  # Create Request
  req =  Net::HTTP::Get.new(uri)
  # Add headers
  req.add_field "Accept", "application/json"
  # Add headers
  req.add_field "Authorization", "Basic <api_key>"

  # Fetch Request
  res = http.request(req)

	response = JSON.parse(res.body)
	name_task = response['review']['tasks'].find { |task| task['category'] == 'name' }

	if name_task['status'] == 'success'
		puts 'Name match'
	else
    puts 'Name match failure'
	end
rescue StandardError => e
  puts "HTTP Request failed (#{e.message})"
end
```

**`Python`**

```python title="Python"
import requests
from requests.auth import HTTPBasicAuth

def send_request():
    business_id = "<business_id>"
    url = f"https://api.middesk.com/v1/businesses/{business_id}"

    headers = {
        "Accept": "application/json",
        "Authorization": "Basic <api_key>"
    }

    try:
        # Make the request
        response = requests.get(url, headers=headers, auth=HTTPBasicAuth('<api_key>', ''))

        # Parse the response JSON
        response_data = response.json()
        name_task = next((task for task in response_data['review']['tasks'] if task['category'] == 'name'), None)

        if name_task and name_task['status'] == 'success':
            print('Name match')
        else:
            print('Name match failure')

    except requests.exceptions.RequestException as e:
        print(f"HTTP Request failed ({e})")

send_request()
```

**`JavaScript`**

```javascript title="JavaScript"
async function sendRequest() {
  const businessId = "<business_id>";
  const url = `https://api.middesk.com/v1/businesses/${businessId}`;

  const headers = {
    "Accept": "application/json",
    "Authorization": "Basic <api_key>"
  };

  try {
    // Make the request using fetch
    const response = await fetch(url, { headers });

    // Check if the request was successful
    if (!response.ok) {
      throw new Error(`HTTP error! Status: ${response.status}`);
    }

    const responseData = await response.json();
    const nameTask = responseData.review.tasks.find(task => task.category === 'name');

    if (nameTask && nameTask.status === 'success') {
      console.log('Name match');
    } else {
      console.log('Name match failure');
    }
  } catch (error) {
    console.error(`HTTP Request failed: ${error.message}`);
  }
}

sendRequest();
```

> **Get a demo**
>
> Contact your account manager or [contact sales](https://www.middesk.com/contact-sales) to inquire about access.