Using the Sandbox Environment

Middesk has a sandbox environment that can be accessed through the API or through the Dashboard.

Through the Dashboard

While logged in to the dashboard, you can access the Sandbox test environment by clicking on the Products icon on the top-right corner of the page, then toggling "View Sandbox". Once in Sandbox mode, the sample attributes described under the Example Sandbox Business Attributes table below can be used to create a Business with sample data.

Through the API

You are immediately provided Sandbox API keys when your account is created. Your Sandbox keys can be retrieved by logging into your Middesk account and visiting Developer Settings. Sandbox keys must be used with the Sandbox API url https://api-sandbox.middesk.com/v1/.

Sandbox API requests are free and while you may include real business data in the Create a Business request, the response will return fake data. You may also set up Webhooks in the Sandbox environment.

Example Sandbox Business Attributes

One major benefit of using the Sandbox environment is that you can walk through various example scenarios that you might encounter you Create a Business.

To do so, include one (or more) of the specified values in the table below in your Create a Business request. Middesk will then return a response according to that value. This will allow you to run specific scenarios and build out your integration workflow accordingly.

TypeValueDescription
NameUnregistered BusinessThe business has no Secretary of State filings. The Business returned will have no associated registrations.
NameSimilar Name BusinessThe business has a Secretary of State filing with a similar name to the submitted business name. The "name" review task indicates that a similar name was found to the submitted name.
NameCorporation, LLC, Partnership, Sole Proprietorship , Trust, Agent, and Non ProfitThe business will have a formation entity_type matching the type of the submitted business name. Corporation is the default if there's no entity type provided.
NameYoung BusinessThe business will have been formed 10 days ago. The formation date should be ten days before the current date.
Address123 Grand St., New York, NY 10013Unable to identify a match to the submitted Office Address. The submitted address is not found to match any address listed in Business records.
Address223 Grand St., New York, NY 10013Identified a similar address. The submitted address is similar to an address that has been found.
Address423 Grand St., New York, NY 10013Identified an approximate address. Identified an address within 0.2 miles of the submitted Office Address
AddressNew York, NYIdentified an incomplete address. Identified a partial match with a submitted address that is incomplete
Address - CMRAInclude "cmra" in address_line1 or full_address (i.e 991 cmra st., New York, NY 10013")

You may also combine this w/ Office Address -Verification values. For example, "423 Grand St. cmra" will trigger an Approximate Match + CMRA task
Identified a CMRA address. Submitted Office Address is zoned by USPS as a Commercial Mail Receiving Agency
Address - Registered AgentInclude "registered agent" in address_line1 or full_address (i.e 991 registered agent st., New York, NY 10013")

You may also combine this w/ Office Address -Verification values. For example, "423 Grand St. registered agent" will trigger an Approximate Match + Registered Agent task
Identified a Registered Agent address:
Submitted Office Address is actually the address of a Registered Agent, not the actual business
Address - DeliverabilityInclude "undeliverable" in address_line1 or full_address (i.e 991 st. undeliverable, New York, NY 10013"

You may also combine this w/ Office Address -Verification values. For example, "423 Grand St. undeliverable" will trigger an Approximate Match + Undeliverable task
Identified an Undeliverable address:
The USPS is unable to deliver mail to the submitted Office Address
SOS Filings - DomesticBusiness Name = "Domestic Missing"Missing Domestic Secretary of State Filing: The business has no domestic filing
SOS Filings - DomesticBusiness Name = "Domestic Inactive"Domestic Secretary of State Filing is Inactive: Inactive domestic filing found
SOS Filings - DomesticBusiness Name = "Domestic Unknown"Unable to detect status of Domestic Filing: No domestic filing status provided
SOS Filings - Partially InactiveBusiness Name = "Partial Inactive"At least one Secretary of state filing is inactive and another active: At least one filing is active. Another inactive.
PersonJ DoeUnable to identify a match to the submitted person. The person input will result in an unverified Person, meaning there's no match found to the Person's name on any Business record.
TIN110000099TIN Name mismatch. The submitted TIN was found to be associated with a different entity name.
TIN111222333TIN Name unknown and issued. The submitted TIN's status is unknown. The TIN's issued status will be issued.
TIN444555666TIN Name unknown and not issued This TIN will return unverified with the submitted name and will also be marked as unissued.
TINTIN = 222333444
Person = Jane Match
If SSN or SSN and EIN is added to the end of the Person name, then the returned tin_type will change accordingly
TIN Name matches the submitted person.
The submitted TIN is associated with the submitted person.
TINBusiness name ends with SSN or SSN and EINTIN type changed The submitted TIN will have a tin_type of whichever type is added to the submitted business name
TIN333444555IRS Unavailable. The IRS is unavailable at this time. TIN will be rerun once the IRS is available again.
BankruptcyA business name containing the word bankruptcyThe business will have a bankruptcy. The Business will have a bankruptcy attached.
WatchlistA Business name or Person name containing the phrase watchlist hit.The business or person will have a watchlist hit on them
Industry ClassificationAny websiteThe business' website will have an industry classification
Industry ClassificationA website containing the words highriskThe business' website will have an industry classification with a high risk result.
AnyAnyVerified. If none of the above inputs match, the Business will fallback to verifying all information. Given most inputs then, you can expect to receive a Review object with successful tasks.
NameAny business nameNo liens will be found. The liens search will return no records for this business.

Note: Liens is a premium feature. See this page for more information.
Name - liens foundAny business name containing the phrase liens found

By default, blanket liens will be found (see the collateral_type field). To produce collateral liens in the search results, add the phrase collateral lien to the business name.
Liens will be found. The liens search will return records for this business. Note that in order to get the full result of the liens search, you’ll have to use the Retrieve a Business endpoint.

Note: Liens is a premium feature. See this page for more information.
Any person with KYC fieldsAny person with KYC fieldsAll of the fields present on a sandbox Socure KYC Person request will be sent through to Socure's sandbox triggers. You can read about Socure's sandbox trigger values here (Socure account and login required).

Note: KYC is a premium feature. See this page for more information.
NameA business name containing the phrase short analyst reviewThis will simulate a standard case of a business being flagged for Middesk's Analyst-in-the-Loop flow by delaying the completion of the Identity order by 2 minutes. After 2 minutes the business will move from status: pending to status: in_review, results will be returned depending on the other trigger values provided, and a business.updated webhook will be sent if that is set up for your account.
NameA business name containing the phrase long analyst reviewThis will simulate a long-running case of a business being flagged for Middesk's Analyst-in-the-Loop flow by delaying the completion of the Identity order by 10 minutes. After 10 minutes the business will move from status: pending to status: in_review, results will be returned depending on the other trigger values provided, and a business.updated webhook will be sent if that is set up for your account.
NPI RecordsA business named "Healthcare Provider" This will return a business with NPI records returned. The submitted address will be linked to an NPI record.
FMCSA RegistrationsA business named "Trucking Business"This will return a business with FMCSA registrations. The submitted address will be linked to an FMCSA registration.
PersonA person with a provided first_name, last_name, and SSN, with the last name containing bankruptcyWhen people bankruptcies are ordered, the provided person will have a bankruptcy returned on them.
entity_typeCORPORATIONThis will cause the entity_type_match insight to return a failure
entity_typeLLCThis will cause the entity_type_match insight to return a success
adverse_mediaA business name containing "adverse media highrisk"This will result in a High Risk result for adverse media (identity/business_verification_verify and adverse_media must be ordered on the business)
adverse_mediaA business name containing "adverse media lowrisk"This will result in a Low Risk result for adverse media (identity/business_verification_verify and adverse_media must be ordered on the business)
adverse_mediaA business name containing "adverse media moderaterisk"This will result in a Moderate Risk result for adverse media (identity/ business_verification_verify and adverse_media must be ordered on the business)

Feel free to mix-and-match any of the values found on the table to create unique scenarios. For example, you can create a business with an approximate address match and unverified person using the inputs 223 Grand St., New York, NY 10013 and J Doe, respectively.

Now that you understand how to use the Sandbox environment, let's walk through an example Sandbox workflow.

1. Creating a Business in Sandbox

Creating a Business in the Sandbox environment works the same way that it would with your production keys.

Authentication to the API using API keys is generally performed via HTTP Basic Auth. Provide the API key as the basic auth username value. No password is required.

Bearer authentication is supported as well, in which case you can pass a header value as Authorization: Bearer mk_live_4eC39HqLyjWDarjtT1zdp7dc.

Note: This is the same request that you made back in the Introduction (Editing) section.

curl https://api-sandbox.middesk.com/v1/businesses \
    -u 'mk_test_779ad1d91ea0e22973e17482:' \
    --header 'accept: application/json' \
    -X POST \
    -d name=Middesk \
    -d website[url]=https://www.middesk.com \
    -d addresses[0][address_line1]=2180+Bryant+St \
    -d addresses[0][address_line2]=Unit+210 \
    -d addresses[0][city]=San+Francisco \
    -d addresses[0][state]=CA \
    -d addresses[0][postal_code]=94110 \

If you can recall from the Lifecycle of a Business section, once you Create a Business, Middesk will return the response below to you synchronously where the status of the Business is set to open. Simultaneously, Middesk will kick off the search process in the background for the Business you just created.

{
  "object": "business",
  "id": "64bce6b6-9773-41e5-9a6e-328e2a53dfcc",
  "name": "Middesk",
  "external_id": null,
  "created_at": "2019-09-03T21:17:16.954Z",
  "updated_at": "2019-09-03T21:17:16.954Z",
  "status": "open",
  "addresses": [
    {
      "object": "address",
      "address_line1": "2180 Bryant St",
      "address_line2": "Unit 210",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94110",
      "full_address": "2180 Bryant St, Unit 210, San Francisco, CA 94110",
      "deliverable": null,
      "deliverability_analysis": null,
      "sources": [],
      "created_at": "2019-09-03T21:17:16.978Z",
      "updated_at": "2019-09-03T21:17:16.978Z"
    }
  ],
  "domain": null,
  "summary": null,
  "tags": [],
  "tin": null,
  "formation": null,
  "website": {
    "object": "website",
    "id": "12e5bfdb-c776-4d04-b13f-7138bdafed71",
    "url": "https://www.middesk.com",
    "title": null,
    "description": null,
    "pages": [],
    "entities": [],
    "registration": {}
  },
  "watchlist": null,
  "names": [],
  "filings": [],
  "phone_numbers": [],
  "registrations": [],
  "reports": [
    {
      "object": "report",
      "id": "460df301-389c-405b-b474-7a88a42d020c",
      "created_at": "2019-09-03T21:17:17.012Z",
      "updated_at": "2019-09-03T21:17:17.012Z",
      "completed_at": null,
      "status": "pending",
      "package": "basic"
    }
  ],
  "tasks": []
}

Every Business object will have its own unique id that is generated by Middesk. You will use this id later to retrieve the same Business object when checking for updates.

2. Receiving responses

As Middesk conducts its investigation on the requested Business, it will progress the report through the statuses of the Lifecycle and will post any relevant events to your Webhook URL if you have one set up.

If you do not wish to set up a Webhook, you may poll for new updates by using the Retrieve a Business endpoint.

3. Retrieving a Business

After creating a Business, you can retrieve it using the Retrieve a Business endpoint at any time to ingest new updates if there are any.

To retrieve the same Business object that we created in Step 1: Creating a Business in Sandbox, include the id that you saved from Step 1: Creating a Business in Sandbox in the endpoint.

curl --request GET \
    --url "http://api-sandbox.middesk.com/v1/businesses/${BUSINESS_ID}" \
    -u "mk_test_779ad1d91ea0e22973e17482:"

A PDF of a Business can also be requested in Sandbox with the following command.

curl --request GET \
    --url "http://api-sandbox.middesk.com/v1/businesses/${BUSINESS_ID}/pdf" \
    -u "mk_test_779ad1d91ea0e22973e17482:"

4. Retrieving all Businesses

If you've created more than one Business, you can retrieve all of them simultaneously with the following request.

curl --request GET \
    --url "https://api-sandbox.middesk.com/v1/businesses" \
    -u "mk_test_779ad1d91ea0e22973e17482:"