Bulk export of device phone numbers via Esper API for cellular audit
Android
When auditing cellular data plans across a managed fleet, the Esper Console does not provide a built-in bulk export of device phone numbers — but the Esper API does, using the v0 enterprise endpoint.
Why this happens
The standard v2 devices endpoint omits the phone number field by design. Phone number data is only available through the legacy v0 enterprise endpoint. The phone number itself is sourced from the device's Android system settings and must be provisioned by your carrier before it appears anywhere in Esper.
Before you begin
Confirm the following before making any API calls:
- Phone numbers are visible in the Esper Console for at least one device. Go to Devices & Groups → [Device Name] → Network and check the Phone Number field. If the field is blank in the Console, the API will also return nothing — the carrier must provision the number to the device first.
- You have your Esper tenant ID — the prefix in your Console URL (for example,
acmeinacme-api.esper.cloud). - You have your Enterprise UUID — found under Settings in the Esper Console.
- You have an API key with device-read permissions — found under Settings → API Key Management.
Steps
-
Call the v0 enterprise device endpoint. Send the following GET request to retrieve device records including phone number data:
ReplaceGET https://{tenant-id}-api.esper.cloud/api/v0/enterprise/{enterprise_id}/device/?limit=100{tenant-id}with your Esper tenant ID and{enterprise_id}with your Enterprise UUID. A limit of 100 records per page is recommended for reliability. Include your API key in the request header:Authorization: Bearer {your-api-key} -
Paginate through all results. If your fleet exceeds the limit value, the API response includes a
nextURL. Make a new GET request to that URL to retrieve the next page. Repeat this untilnextreturnsnull, which indicates you have retrieved all device records. -
Extract the phone number field from each device object. Parse the
phone_numberfield from each device object in the response payload. Format the extracted data as required for your audit (for example, export to CSV by mapping device serial number, device name, and phone number). - Cross-check a sample of results against the Esper Console. For at least one device, compare the phone number returned by the API against the value shown in Devices & Groups → [Device Name] → Network. This confirms your API key has the correct permissions and the endpoint is returning current data.
If this doesn't resolve it
If phone numbers are visible in the Esper Console but are not returned by the v0 API, or if you receive an authentication error, contact Esper Support and include the following:
- The device serial number of an affected device
- Your Enterprise UUID
- The full API response body, including any error message or empty field
- A screenshot of the phone number as shown in Devices & Groups → [Device Name] → Network
Improved title: Bulk export device phone numbers via API — v0 enterprise endpoint
Still need help?
If you're unable to export device phone numbers or encounter API errors during bulk export operations, please submit a support ticket and include your API endpoint, any error messages received, and the number of devices in your bulk export request.
Please sign in to leave a comment.
Comments
0 comments