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

# Set Active Media Storage Location

> PUT /media_storage/active
> 
> Makes `location` the caller's profile's active media storage location, where new record media is written, together with its folder and structure.
> 
> | `location` | Needs | `destination_root` | Stored as |
> |---|---|---|---|
> | `2` Dropbox | a Dropbox connection | optional folder path | the path as sent |
> | `3` Box | a Box connection on a paid Box plan | optional folder path | the id of the last folder; missing folders are created |
> | `5` S3 | the server's media bucket | not sent | - |
> | `6` OneDrive | a OneDrive connection | optional folder path | the path as sent |
> | `7` SharePoint | a SharePoint connection and `site_id` | required document library name | the library name; the library is created on the site if missing, and `site_id` is stored on the connection |
> | `8` Google Drive | a Google Drive connection | optional folder path | the id of the last folder; missing folders are created |
> | `9` S3 (private) | the server's private media bucket | not sent | - |
> 
> `structure` is `0` (the default: root / profile id / form name / file) or `1` (root / file).
> 
> Every provider call is made before anything is stored, and the location, folder and structure are then written together, so a provider failure leaves the profile's media storage exactly as it was. Any location may be chosen by any account; there is no plan or account-type restriction beyond Box's own paid-plan requirement.
> 
> ### Authorization
> 
> Internal clients only, and a SERVER or COMPANY user.



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


## Authentication methods
- Oauth2


## Parameters
### Headers

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




### Body: application/json (object)

- **location** (integer)

- **destination_root** (string)
  the folder path (a document library name for SharePoint); not used for 5 and 9

- **structure** (integer)
  0 = root / profile id / form name / file, 1 = root / file

- **site_id** (string)
  SharePoint (7) only, required there; `root` or an `id` from `GET /media_storage/connections/7/sites`



## Responses
### 200
OK - the location is now the profile's active media storage location.

#### Body: application/json (object)
- **provider** (string)

- **location** (integer)
  the MEDIA_LOCATION code (2 Dropbox, 3 Box, 5 S3, 6 OneDrive, 7 SharePoint, 8 Google Drive, 9 private S3)

- **active** (boolean)
  always true

- **destination_root** (string)
  the stored root, when there is one; a folder path for OneDrive and Dropbox, a library name for SharePoint, a folder id for Box and Google Drive

- **account** (string)
  the provider account's display name, when known


### 400
Bad Request - `location` is not one of 2, 3, 5, 6, 7, 8, 9; `structure` is not 0 or 1; `destination_root` is not a string, is longer than 255 characters, holds a control character or a `.`/`..` segment, holds whitespace or any of `" * : < > ? \ |` for location 6, 7 or 8, is sent for location 5 or 9, or is missing or more than one library name for location 7; `site_id` is missing or not a site id for location 7, or sent for another location; or location 5 or 9 has no S3 bucket configured on this server.

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

### 403
Forbidden - the client is not an internal client, or the token belongs to a BASIC user.

### 409
Conflict - the profile has no connection for `location` (2, 3, 6, 7, 8); connect it first with `POST /media_storage/connections`. Also returned when the provider grant must be reconnected.

### 422
Unprocessable Entity - Box only; the Box account is not on a paid plan (its upload limit is under 1 GB).

### 502
Bad Gateway - the provider failed while the folder or library was being found or created. Nothing was changed.


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