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

# Company Entities API

> Retrieve company entities for a specific its identifier

## Authentication

All requests require an API key in the request headers.

**Headers:**

```
Authorization: Api-Key YOUR_API_KEY
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.pazy.io/v1.0/company/entities \
    -H "Authorization: Api-Key YOUR_API_KEY"
  ```

  ```javascript JavaScript (Fetch API) theme={null}
  const response = await fetch("https://api.pazy.io/v1.0/company/entities", {
    method: "GET",
    headers: {
      Authorization: "Api-Key YOUR_API_KEY",
    },
  });

  const result = await response.json();
  ```

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

  url = "https://api.pazy.io/v1.0/company/entities"
  headers = {
      "Authorization": "Api-Key YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  result = response.json()
  ```
</CodeGroup>

## Success Response

**HTTP Status:** `200 OK`

**Response Fields:**

| Field                             | Type    | Description                                          |
| --------------------------------- | ------- | ---------------------------------------------------- |
| `ok`                              | boolean | Indicates whether the request was successful         |
| `data.entities[].orgIdentifierId` | string  | Unique identifier for the organization entity        |
| `data.entities[].entityType`      | string  | Type of the entity identifier e.g. `GSTIN`, `PAN`    |
| `data.entities[].entityValue`     | string  | Value of the entity identifier e.g. the GSTIN number |
| `data.entities[].businessName`    | string  | Name of the business associated with the entity      |
| `data.entities[].state`           | string  | Indian state where the entity is registered          |
| `data.context.count`              | number  | Total number of entities                             |
| `data.context.accountingPlatform` | string  | Accounting platform integrated e.g. `TALLY`, `ZOHO`  |

### Response Example

```json theme={null}
{
    "ok": true,
    "data": {
        "entities": [
            {
                "orgIdentifierId": "<orgIdentifierId>",
                "entityType": "GSTIN",
                "entityValue": "27ABCDE1234F1Z5",
                "businessName": "Acme Corp",
                "state": "Maharashtra"
            },
            {
                "orgIdentifierId": "<orgIdentifierId>",
                "entityType": "GSTIN",
                "entityValue": "29ABCDE1234F1Z5",
                "businessName": "Acme Trading",
                "state": "Karnataka"
            }
        ],
        "context": {
            "count": 2,
            "accountingPlatform": "TALLY"
        }
    }
}
```

## Error Responses

### Org Not Found

**HTTP Status:** `404 Not Found`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "ORGANIZATION_NOT_FOUND",
    "message": "Org not found"
  }
}
```

### Access Denied

**HTTP Status:** `403 Forbidden`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: Only admin can view this details"
  }
}
```

### Authentication Errors

**HTTP Status:** `401 Unauthorized`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
```

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}
```

### Permission Errors

**HTTP Status:** `403 Forbidden`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}
```

## Best Practices

### Access Control

* You can view only if you are 'admin'.
