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

# Get business accounts

> Get information about your WhatsApp Business accounts, phone numbers, and available templates

## Description

This endpoint returns all information associated with your API Key: company data, phone numbers with their messaging quota, and approved templates with their variables.

## Authentication header

<ParamField header="X-API-Key" type="string" required>
  Your Mindo API Key. Format: `mindo_xxxxxxxxxxxxxxxxxxxxxxxx`
</ParamField>

## Response

<ResponseField name="companyName" type="string">
  Your company name.
</ResponseField>

<ResponseField name="apiKeyName" type="string">
  Name of the API Key used in the request.
</ResponseField>

<ResponseField name="phoneNumbers" type="array">
  WhatsApp phone numbers associated with your account.

  <Expandable title="phoneNumbers properties">
    <ResponseField name="id" type="integer">
      Internal phone number ID.
    </ResponseField>

    <ResponseField name="phoneNumberId" type="string">
      **Meta's WhatsApp phone number ID.** Use this value to send messages.
    </ResponseField>

    <ResponseField name="displayPhoneNumber" type="string">
      Formatted phone number for display.
    </ResponseField>

    <ResponseField name="verifiedName" type="string">
      Meta-verified name for this number.
    </ResponseField>

    <ResponseField name="businessName" type="string">
      Name of the WhatsApp Business account this number belongs to.
    </ResponseField>

    <ResponseField name="isPrimary" type="boolean">
      Whether this is the primary number of the account.
    </ResponseField>

    <ResponseField name="messagingLimitTier" type="string">
      Messaging limit tier assigned by Meta. See [tier table](#messaging-limit-tiers).
    </ResponseField>

    <ResponseField name="quota" type="object">
      Current messaging quota information.

      <Expandable title="quota properties">
        <ResponseField name="dailyLimit" type="integer">
          Daily limit of unique conversations.
        </ResponseField>

        <ResponseField name="uniqueNumbersSent24h" type="integer">
          Unique numbers contacted in the last 24 hours.
        </ResponseField>

        <ResponseField name="remaining" type="integer">
          Remaining available conversations.
        </ResponseField>

        <ResponseField name="usagePercentage" type="float">
          Limit usage percentage (0-100).
        </ResponseField>

        <ResponseField name="canSend" type="boolean">
          Whether the number can send messages right now.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="templates" type="array">
      Approved templates available for sending on this number.

      <Expandable title="templates properties">
        <ResponseField name="name" type="string">
          Template name. Use this value to send messages.
        </ResponseField>

        <ResponseField name="language" type="string">
          Template language (`es`, `en`, etc.).
        </ResponseField>

        <ResponseField name="category" type="string">
          Template category (`MARKETING`, `UTILITY`, etc.).
        </ResponseField>

        <ResponseField name="variables" type="array">
          Dynamic template variables.

          <Expandable title="variables properties">
            <ResponseField name="name" type="string">
              Variable name.
            </ResponseField>

            <ResponseField name="type" type="string">
              Data type. See [variable types](#variable-types).
            </ResponseField>

            <ResponseField name="position" type="integer">
              Variable position within the component.
            </ResponseField>

            <ResponseField name="isRequired" type="boolean">
              Whether the variable is required.
            </ResponseField>

            <ResponseField name="component" type="string">
              Component where the variable appears (`HEADER`, `BODY`, `FOOTER`, `BUTTON`).
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="buttons" type="array">
          Template buttons (empty array if the template has no buttons).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.mindosoftware.com/api/v1/business-accounts/ \
    -H "X-API-Key: mindo_xxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.mindosoftware.com/api/v1/business-accounts/",
      headers={"X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx"}
  )

  data = response.json()
  print(data)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.mindosoftware.com/api/v1/business-accounts/",
    {
      headers: { "X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx" }
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "companyName": "Mi Empresa SRL",
    "apiKeyName": "Production API Key",
    "phoneNumbers": [
      {
        "id": 123,
        "phoneNumberId": "813497231850626",
        "displayPhoneNumber": "+54 9 223 675-0780",
        "verifiedName": "Mi Empresa",
        "businessName": "Mi Empresa SRL",
        "isPrimary": true,
        "messagingLimitTier": "TIER_1000",
        "quota": {
          "dailyLimit": 1000,
          "uniqueNumbersSent24h": 45,
          "remaining": 955,
          "usagePercentage": 4.5,
          "canSend": true
        },
        "templates": [
          {
            "name": "welcome_message",
            "language": "es",
            "category": "MARKETING",
            "variables": [
              {
                "name": "customer_name",
                "type": "TEXT",
                "position": 1,
                "isRequired": true,
                "component": "BODY"
              }
            ],
            "buttons": []
          },
          {
            "name": "order_confirmation",
            "language": "es",
            "category": "UTILITY",
            "variables": [
              {
                "name": "order_id",
                "type": "TEXT",
                "position": 1,
                "isRequired": true,
                "component": "BODY"
              },
              {
                "name": "total_amount",
                "type": "CURRENCY",
                "position": 2,
                "isRequired": true,
                "component": "BODY"
              },
              {
                "name": "delivery_date",
                "type": "DATE_TIME",
                "position": 3,
                "isRequired": true,
                "component": "BODY"
              }
            ],
            "buttons": []
          }
        ]
      }
    ]
  }
  ```

  ```json 401 - API Key not sent theme={null}
  {
    "error": "Este endpoint requiere autenticacion con API Key (header X-API-Key)"
  }
  ```

  ```json 401 - Expired API Key theme={null}
  {
    "error": "API Key expirada"
  }
  ```

  ```json 403 - No access theme={null}
  {
    "error": "API Key no tiene acceso a este recurso"
  }
  ```
</ResponseExample>

## Messaging limit tiers

Messaging tiers are assigned by Meta and determine how many unique conversations you can initiate per day.

| Tier             | Daily limit           | Recommended speed        | Estimated time (1000 msgs) |
| ---------------- | --------------------- | ------------------------ | -------------------------- |
| `TIER_50`        | 50 conversations      | 1.2s between messages    | 20 minutes                 |
| `TIER_250`       | 250 conversations     | 0.24s between messages   | 4 minutes                  |
| `TIER_1000`      | 1,000 conversations   | 0.06s between messages   | 1 minute                   |
| `TIER_10000`     | 10,000 conversations  | 0.006s between messages  | 6 seconds                  |
| `TIER_100000`    | 100,000 conversations | 0.0006s between messages | \< 1 second                |
| `TIER_UNLIMITED` | No limit              | No delay                 | Instant                    |

<Note>
  The tier increases automatically based on usage and number quality.
</Note>

## Variable types

Template variables can be of the following types:

| Type        | Description          | Example                    |
| ----------- | -------------------- | -------------------------- |
| `TEXT`      | Plain text           | `"Juan Perez"`             |
| `CURRENCY`  | Amount with currency | `"$1,250.00"`              |
| `DATE_TIME` | Date and/or time     | `"November 25"`, `"18:30"` |
| `IMAGE`     | Image URL            | `"https://..."`            |
| `VIDEO`     | Video URL            | `"https://..."`            |
| `DOCUMENT`  | Document URL         | `"https://..."`            |

## Use cases

<AccordionGroup>
  <Accordion title="Get phone_number_id to send messages">
    The `phoneNumberId` field is the Meta ID you need to send messages through the API.

    ```javascript theme={null}
    const data = await getBusinessAccounts();

    // Get the first WhatsApp number
    const firstPhone = data.phoneNumbers[0];
    const phoneNumberId = firstPhone.phoneNumberId;

    console.log('Phone Number ID:', phoneNumberId);
    // Output: "813497231850626"

    // Use this ID to send messages
    await sendTemplate({
      phone_number_id: phoneNumberId,
      template_name: 'welcome_message',
      recipient_phone: '+5491112345678',
      variables: { customer_name: 'Juan' }
    });
    ```
  </Accordion>

  <Accordion title="Check available quota before sending">
    Before sending messages, verify that the number has available quota.

    ```javascript theme={null}
    const data = await getBusinessAccounts();
    const phone = data.phoneNumbers[0];

    if (!phone.quota.canSend) {
      console.error('Cannot send: limit reached');
      console.log(`Used: ${phone.quota.uniqueNumbersSent24h}/${phone.quota.dailyLimit}`);
      return;
    }

    if (phone.quota.usagePercentage > 80) {
      console.warn('Alert: Usage at ' + phone.quota.usagePercentage + '%');
    }

    console.log('Available quota:', phone.quota.remaining);
    ```
  </Accordion>

  <Accordion title="List templates with their variables">
    Get the list of available templates and their variables to build sends.

    ```javascript theme={null}
    const data = await getBusinessAccounts();
    const phone = data.phoneNumbers[0];

    console.log('Available templates:');
    phone.templates.forEach(template => {
      console.log(`\n${template.name} (${template.language})`);
      console.log(`  Category: ${template.category}`);
      console.log(`  Variables:`);

      template.variables.forEach(variable => {
        const required = variable.isRequired ? '(required)' : '(optional)';
        console.log(`  - ${variable.name} [${variable.type}] ${required}`);
      });
    });
    ```
  </Accordion>

  <Accordion title="Build payload dynamically from template variables">
    Use variable information to build the send payload automatically.

    ```javascript theme={null}
    const data = await getBusinessAccounts();
    const template = data.phoneNumbers[0].templates
      .find(t => t.name === 'order_confirmation');

    // Build variables automatically
    const variables = {};
    template.variables.forEach(variable => {
      switch (variable.type) {
        case 'TEXT':
          variables[variable.name] = 'Text value';
          break;
        case 'CURRENCY':
          variables[variable.name] = '$1,250.00';
          break;
        case 'DATE_TIME':
          variables[variable.name] = new Date().toLocaleDateString('en-US');
          break;
      }
    });

    console.log('Built variables:', variables);
    // Output: { order_id: 'Text value', total_amount: '$1,250.00', delivery_date: '11/16/2025' }
    ```
  </Accordion>

  <Accordion title="Select number by quota availability">
    If you have multiple numbers, automatically select the one with the most available quota.

    ```javascript theme={null}
    const data = await getBusinessAccounts();
    const phones = data.phoneNumbers;

    // Sort by remaining quota (highest first)
    const sortedPhones = phones.sort((a, b) => b.quota.remaining - a.quota.remaining);

    // Select the one with the most available quota
    const bestPhone = sortedPhones.find(phone => phone.quota.canSend);

    if (!bestPhone) {
      console.error('No numbers have available quota');
      return;
    }

    console.log(`Using number: ${bestPhone.displayPhoneNumber}`);
    console.log(`  Remaining quota: ${bestPhone.quota.remaining}`);
    console.log(`  Phone Number ID: ${bestPhone.phoneNumberId}`);
    ```
  </Accordion>
</AccordionGroup>
