> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dncscrub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Legal Entity

> Create a new legal entity for your account

Create a new legal entity for your account. Legal entities represent the business identities under which your phone numbers are registered and are used for carrier registration and compliance purposes.

## Request

### Headers

<ParamField header="loginId" type="string" required>
  Your API Key (LoginId from your DNCScrub account)
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Request Body

<ParamField body="LegalName" type="string" required>
  The registered legal name of the business entity
</ParamField>

<ParamField body="IsDefault" type="boolean">
  Set to `true` to make this the default legal entity for the account
</ParamField>

<ParamField body="EIN" type="string">
  Employer Identification Number (EIN), digits without a dash (e.g., "987654321")
</ParamField>

<ParamField body="StreetAddress" type="string">
  Street address of the legal entity
</ParamField>

<ParamField body="City" type="string">
  City of the legal entity's address
</ParamField>

<ParamField body="State" type="string">
  State or province code (e.g., "NY", "CA")
</ParamField>

<ParamField body="Zip" type="string">
  ZIP or postal code
</ParamField>

<ParamField body="CountryCode" type="string">
  Two-letter country code (e.g., "US")
</ParamField>

<ParamField body="IndustryId" type="string">
  Industry identifier code. See the table below for valid values.
</ParamField>

| ID | Industry                  |
| -- | ------------------------- |
| 1  | Education                 |
| 2  | Transportation            |
| 3  | Retail                    |
| 4  | Delivery/Shipping         |
| 5  | Government                |
| 6  | Health Care               |
| 7  | Financial                 |
| 8  | Public Service            |
| 9  | Real Estate               |
| 10 | Legal                     |
| 11 | Restaurant/Food Services  |
| 12 | Automotive                |
| 13 | Religious                 |
| 14 | Veterinary Services       |
| 15 | Trade Contractors         |
| 16 | Personal Services         |
| 17 | Business Services         |
| 18 | Hospitality/Entertainment |
| 19 | Insurance                 |
| 20 | Manufacturing             |
| 21 | Other Business            |
| 22 | Telecommunications        |
| 23 | Technology                |
| 24 | Non-Profit                |
| 25 | Travel                    |
| 26 | Utilities                 |
| 27 | Prison                    |

<ParamField body="PrimaryPhoneNumber" type="string">
  Primary contact phone number for the legal entity
</ParamField>

<ParamField body="PrimaryContactName" type="string">
  Name of the primary contact person
</ParamField>

<ParamField body="PrimaryContactEmail" type="string">
  Email address of the primary contact
</ParamField>

<ParamField body="PrimaryContactPhoneNumber" type="string">
  Phone number of the primary contact person
</ParamField>

<ParamField body="EmployeeCount" type="integer">
  Number of employees at the company
</ParamField>

<ParamField body="CallsPerMonth" type="integer">
  Estimated number of outbound calls per month
</ParamField>

<ParamField body="DunsNumber" type="string">
  Dun & Bradstreet DUNS number
</ParamField>

<ParamField body="Url" type="string" required>
  Company website URL
</ParamField>

<ParamField body="Dba" type="string">
  "Doing Business As" name, if different from legal name
</ParamField>

<ParamField body="LicenceNumber" type="string">
  Business license number
</ParamField>

<ParamField body="CallPurposeDescription" type="string">
  Description of the purpose of outbound calls
</ParamField>

<ParamField body="PotentialNegativeReaction" type="string">
  Description of potential negative reaction
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST \
    'https://dataapi.dncscrub.com/v1.5/legalentity/Create' \
    --header 'loginId: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "IsDefault": false,
      "LegalName": "Test New Company LLC",
      "EIN": "123456789",
      "StreetAddress": "123 Main Street",
      "City": "Austin",
      "State": "TX",
      "Zip": "78701",
      "CountryCode": "US",
      "IndustryId": "7",
      "PrimaryContactName": "John Doe",
      "PrimaryContactEmail": "john.doe@testcompany.com",
      "PrimaryContactPhoneNumber": "5125551234",
      "PrimaryPhoneNumber": "5125550000",
      "CallsPerMonth": 10000,
      "EmployeeCount": 50,
      "DunsNumber": "123456789",
      "Url": "https://www.testcompany.com",
      "Dba": "Test Co",
      "LicenceNumber": "LIC-12345",
      "CallPurposeDescription": "Customer service follow-up calls",
      "PotentialNegativeReaction": "Low"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://dataapi.dncscrub.com/v1.5/legalentity/Create',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'loginId': 'YOUR_API_KEY'
      },
      body: JSON.stringify({
        LegalName: 'Test New Company LLC',
        IsDefault: false,
        EIN: '123456789',
        StreetAddress: '123 Main Street',
        City: 'Austin',
        State: 'TX',
        Zip: '78701',
        CountryCode: 'US',
        IndustryId: '7',
        PrimaryPhoneNumber: '5125550000',
        PrimaryContactName: 'John Doe',
        PrimaryContactEmail: 'john.doe@testcompany.com',
        PrimaryContactPhoneNumber: '5125551234',
        EmployeeCount: 50,
        CallsPerMonth: 10000,
        DunsNumber: '123456789',
        Url: 'https://www.testcompany.com',
        Dba: 'Test Co',
        LicenceNumber: 'LIC-12345',
        CallPurposeDescription: 'Customer service follow-up calls',
        PotentialNegativeReaction: 'Low'
      })
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```csharp C# theme={null}
  using (var client = new HttpClient())
  {
      client.DefaultRequestHeaders.Add("loginId", "YOUR_API_KEY");

      var requestData = new
      {
          LegalName = "Test New Company LLC",
          IsDefault = false,
          EIN = "123456789",
          StreetAddress = "123 Main Street",
          City = "Austin",
          State = "TX",
          Zip = "78701",
          CountryCode = "US",
          IndustryId = "7",
          PrimaryPhoneNumber = "5125550000",
          PrimaryContactName = "John Doe",
          PrimaryContactEmail = "john.doe@testcompany.com",
          PrimaryContactPhoneNumber = "5125551234",
          EmployeeCount = 50,
          CallsPerMonth = 10000,
          DunsNumber = "123456789",
          Url = "https://www.testcompany.com",
          Dba = "Test Co",
          LicenceNumber = "LIC-12345",
          CallPurposeDescription = "Customer service follow-up calls",
          PotentialNegativeReaction = "Low"
      };

      var content = new StringContent(
          JsonSerializer.Serialize(requestData),
          Encoding.UTF8,
          "application/json"
      );

      var response = await client.PostAsync(
          "https://dataapi.dncscrub.com/v1.5/legalentity/Create",
          content
      );

      var result = await response.Content.ReadAsStringAsync();
      Console.WriteLine(result);
  }
  ```
</CodeGroup>

<ResponseExample>
  ```json Response theme={null}
  {
    "LegalEntityId": 68257,
    "AcctId": "YOUR_ACCOUNT_ID"
  }
  ```
</ResponseExample>

## Response Fields

<ResponseField name="LegalEntityId" type="integer">
  The unique identifier assigned to the newly created legal entity
</ResponseField>

<ResponseField name="AcctId" type="string">
  The account ID the legal entity belongs to
</ResponseField>

## Error Responses

| Status                    | Description                                                          |
| ------------------------- | -------------------------------------------------------------------- |
| 400 Bad Request           | Missing required fields (e.g., `LegalName`) or request body is empty |
| 401 Unauthorized          | Invalid or missing API key                                           |
| 409 Conflict              | A legal entity with the same `LegalName` already exists              |
| 500 Internal Server Error | Server error during processing                                       |
