Upload MMDB File
Endpoint
PUT /apiops/settings/geolocation/mmdb
Authentication
Requires a Personal API Access Token with system admin access (sysAdmin or ADMIN authority).
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | multipart/form-data | Yes |
Path Parameters
None.
Form Data
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Yes | MMDB file (MaxMind GeoIP2 database file) |
| fileName | string | No | Display file name. When omitted, uses the uploaded file original name, or geolocation.mmdb as fallback |
Notes
filemust not be emptyfileNameis sent as a multipart form part (not a query parameter)- Uploading a new file replaces the existing MMDB in the setting record
- MMDB file format: MaxMind GeoIP2 database (
.mmdb)
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"responseTime": 1500,
"detailList": [
{
"envName": "production",
"success": true,
"detail": "Deployed successfully",
"responseTime": 450
}
]
}
}
Error Response (400 Bad Request)
{
"status": "FAILURE",
"resultMessage": "File can not be empty!"
}
or (non-admin user with valid token)
{
"status": "FAILURE",
"resultMessage": "Unauthorized! Only users with ADMIN role can access this resource!"
}
Error Response (401 Unauthorized)
Invalid or missing API token.
{
"status": "FAILURE",
"resultMessage": "User not found!"
}
cURL Example
Example 1: Upload MMDB File
curl -X PUT \
"https://demo.apinizer.com/apiops/settings/geolocation/mmdb" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@GeoLite2-City.mmdb" \
-F "fileName=GeoLite2-City.mmdb"
Example 2: Upload MMDB File without File Name
curl -X PUT \
"https://demo.apinizer.com/apiops/settings/geolocation/mmdb" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@GeoLite2-City.mmdb"
Permissions
User must have system admin (sysAdmin) or ADMIN authority. See Geolocation API.
Notes and Warnings
-
System admin only:
- Not a project-scoped endpoint
- Regular project permissions do not apply
-
MMDB file format:
- File must be in MaxMind GeoIP2 database format (
.mmdb) - Common files:
GeoLite2-City.mmdb,GeoLite2-Country.mmdb
- File must be in MaxMind GeoIP2 database format (
-
Automatic deployment:
- MMDB is deployed to Gateway environments after upload
- Deployment results are returned in
deploymentResult.detailList
-
File replacement:
- Uploading a new file overwrites the previous MMDB stored in the setting
Related Documentation
- Enable Geolocation - Enable geolocation functionality
- Disable Geolocation - Disable geolocation