Skip to content

List Locations

GET /v2/tms-api/locations

Retrieve a paginated list of locations in your organization.

API Reference

Country/State format (ISO)

  • country: ISO 3166-1 alpha-2 (e.g., US, CA, MX)
  • state: ISO 3166-2 subdivision code (e.g., US-IL, CA-ON, MX-CMX)

Request Examples

bash
# List all locations
curl -X GET "https://api.mentium.io/v2/tms-api/locations?page=1&page_size=50" \
  -H "X-API-Key: your_api_key_here"

# Filter by state
curl -X GET "https://api.mentium.io/v2/tms-api/locations?state=US-IL&page=1" \
  -H "X-API-Key: your_api_key_here"

# Search by name
curl -X GET "https://api.mentium.io/v2/tms-api/locations?name_contains=Chicago" \
  -H "X-API-Key: your_api_key_here"

# Sort by name
curl -X GET "https://api.mentium.io/v2/tms-api/locations?sort=name" \
  -H "X-API-Key: your_api_key_here"
python
import requests

# List all locations
response = requests.get(
    "https://api.mentium.io/v2/tms-api/locations",
    headers={"X-API-Key": "your_api_key_here"},
    params={"page": 1, "page_size": 50}
)
print(response.json())

# Filter by state
response = requests.get(
    "https://api.mentium.io/v2/tms-api/locations",
    headers={"X-API-Key": "your_api_key_here"},
    params={"state": "US-IL", "page": 1}
)
print(response.json())

Notes

  • Pagination: Results are paginated with a default page size of 50 (max 100)
  • Filtering: Multiple filters can be combined (e.g., ?state=US-IL&city=Chicago)
  • Sorting: Use - prefix for descending order (e.g., sort=-created_at)

Mentium TMS API Documentation