Box Developer Documentation
 
    Latest version

    Assign storage policy

    post
    https://api.box.com/2.0
    /storage_policy_assignments

    This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

    Creates a storage policy assignment for an enterprise or user.

    Request

    bearer [ACCESS_TOKEN]
    application/json

    Request Body

    objectin body

    The user or enterprise to assign the storage policy to.

    stringin bodyrequired
    "9987987"

    The ID of the user or enterprise

    stringin bodyrequired
    "user"

    The type to assign the policy to.

    Value is one of user,enterprise

    objectin body

    The storage policy to assign to the user or enterprise

    stringin bodyrequired
    "1434325"

    The ID of the storage policy to assign.

    stringin bodyrequired
    "storage_policy"

    The type to assign.

    Value is always storage_policy

    Response

    Returns the new storage policy assignment created.

    application/jsonClient error

    An unexpected client error.

    post
    Assign storage policy
    You can now try out some of our APIs live, right here in the documentation.
    Log in

    Request Example

    cURL
    curl -i -X POST "https://api.box.com/2.0/storage_policy_assignments" \
         -H "authorization: Bearer <ACCESS_TOKEN>" \
         -H "content-type: application/json" \
         -d '{
           "storage_policy": {
             "type": "storage_policy",
             "id": "1434325"
           },
           "assigned_to": {
             "type": "user",
             "id": "9987987"
           }
         }'

    Response Example

    {
      "id": "ZW50ZXJwcmlzZV8xMjM0NTY3ODkw",
      "type": "storage_policy_assignment",
      "assigned_to": {
        "id": "11446498",
        "type": "file"
      },
      "storage_policy": {
        "id": "11446498",
        "type": "storage_policy"
      }
    }