> For the complete documentation index, see [llms.txt](https://apidocs.zerionsoftware.com/doc/iformbuilder-v81/llms.txt)

# Update Profile Map View Settings

> PUT /mapbox/profiles/{profile_id}
> 
> Enables or disables map views for a profile and sets its monthly map-view threshold. Both fields are optional; an omitted field keeps its stored value.
> 
> While the server has a cap (`server_mapview_limit` 0 or more), `threshold` cannot be below 0, and map views can be enabled only with a threshold above 0. A request that raises the threshold or turns map views on must fit the cap: every other profile's threshold plus this one cannot exceed `server_mapview_limit`. Lowering the threshold or disabling map views is never refused by the cap.
> 
> The first time map views are enabled for a profile without a token, a Mapbox token is created for it. If that fails, nothing is saved, map views stay off, and the response is `502`.
> 
> ### Authorization
> 
> Internal API clients only, and SERVER users only, whatever the server's ZWS mode.



## Servers
- https://api.iformbuilder.com/exzact/api/v81/[servername]: https://api.iformbuilder.com/exzact/api/v81/[servername]


## Authentication methods
- Oauth2


## Parameters
### Headers

- **Authorization** (string)
  e.g. Bearer {access_token}


### Path parameters

- **profile_id** (integer)
  id of the profile



### Body: application/json (object)

- **enabled** (boolean)
  whether map views are enabled for the profile

- **threshold** (integer)
  the profile's monthly map-view threshold



## Responses
### 200
OK - the settings were saved. The body is the updated settings, in the same shape as `GET`.

#### Body: application/json (object)
- **profile_id** (integer)

- **enabled** (boolean)
  whether map views are enabled for the profile

- **threshold** (integer)
  the profile's monthly map-view threshold

- **has_token** (boolean)
  `true` when the profile has a Mapbox token

- **server_mapview_limit** (integer)
  the server-wide map-view cap; negative means no cap

- **allocated** (integer)
  the sum of every profile's threshold on the server

- **unallocated** (integer | null)
  `server_mapview_limit` minus `allocated`; `null` when the server has no cap


### 400
Bad Request - the body is not a JSON object, `enabled` is not a boolean, `threshold` is not an integer, or, while `server_mapview_limit` is 0 or more, `threshold` is below 0 or map views would be enabled with a threshold of 0.

### 401
Unauthorized - missing or invalid bearer token.

### 403
Forbidden - the client is not internal, or the user is not a SERVER user.

### 404
Not Found - the profile does not exist or has no company info.

### 409
Conflict - Mapbox is not enabled on this server, or the threshold does not fit in the server's unallocated map views.

### 502
Bad Gateway - map views were being enabled and Mapbox did not create a token for the profile. Nothing was saved.

### 503
Service Unavailable - map views were being enabled, the profile has no token yet, and the Mapbox user or key is not configured on this server. Nothing was saved.


[Powered by Bump.sh](https://bump.sh)
