Box Developer Documentation
Latest version

Create terms of service

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

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 terms of service for a given enterprise and type of user.

Request

bearer [ACCESS_TOKEN]
application/json

Request Body

stringin bodyrequired
"enabled"

Whether this terms of service is active.

Value is one of enabled,disabled

stringin bodyrequired
"By collaborating on this file you are accepting..."

The terms of service text to display to users.

The text can be set to empty if the status is set to disabled.

stringin bodyoptional
"managed"

The type of user to set the terms of service for.

Value is one of external,managed

Response

application/jsonTerms of service

Returns a new task object.

application/jsonClient error

An unexpected client error.

post
Create terms of service
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versioning strategy.


cURL
curl -i -X POST "https://api.box.com/2.0/terms_of_services" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "status": "enabled",
       "text": "By collaborating on this file you are accepting..."
     }'
Node/TypeScript v10
await client.termsOfServices.createTermsOfService({
  status: 'disabled' as CreateTermsOfServiceRequestBodyStatusField,
  tosType: 'managed' as CreateTermsOfServiceRequestBodyTosTypeField,
  text: 'Test TOS',
} satisfies CreateTermsOfServiceRequestBody);
Python v10
client.terms_of_services.create_terms_of_service(
    CreateTermsOfServiceStatus.DISABLED,
    "Test TOS",
    tos_type=CreateTermsOfServiceTosType.MANAGED,
)
.NET v10
await client.TermsOfServices.CreateTermsOfServiceAsync(requestBody: new CreateTermsOfServiceRequestBody(status: CreateTermsOfServiceRequestBodyStatusField.Disabled, text: "Test TOS") { TosType = CreateTermsOfServiceRequestBodyTosTypeField.Managed });
Swift v10
try await client.termsOfServices.createTermsOfService(requestBody: CreateTermsOfServiceRequestBody(status: CreateTermsOfServiceRequestBodyStatusField.disabled, tosType: CreateTermsOfServiceRequestBodyTosTypeField.managed, text: "Test TOS"))
Java v10
client.getTermsOfServices().createTermsOfService(new CreateTermsOfServiceRequestBody.Builder(CreateTermsOfServiceRequestBodyStatusField.DISABLED, "Test TOS").tosType(CreateTermsOfServiceRequestBodyTosTypeField.MANAGED).build())
Java v4
BoxTermsOfService.Info newTOS = BoxTermsOfService.create(
    api,
    BoxTermsOfService.TermsOfServiceStatus.ENABLED,
    BoxTermsOfService.TermsOfServiceType.EXTERNAL,
    "Terms of Service..."
);
Python v3
from boxsdk.object.terms_of_service import TermsOfServiceType, TermsOfServiceStatus
terms_of_service = client.create_terms_of_service(TermsOfServiceStatus.ENABLED,TermsOfServiceType.MANAGED, 'Example Text')
print(f'Terms of Service status is {terms_of_service.status} and the message is {terms_of_service.text}')
.NET v5
var tosParams = new CreateTermsOfServicesAsync()
{
    Status = "enabled"
    TosType = "external",
    Text = "By using this service, you agree to ..."
};
BoxTermsOfService tos = await client.TermsOfServiceManager.CreateTermsOfServicesAsync(tosParams);
Node v3
client.termsOfService.create('managed', 'enabled', 'By using this service, you agree to ...')
	.then(tos => {
		/* tos -> {
			type: 'terms_of_service',
			id: '12345',
			status: 'enabled',
			enterprise: { type: 'enterprise', id: '55555' },
			tos_type: 'managed',
			text: 'By using this service, you agree to ...',
			created_at: '2018-04-19T13:55:09-07:00',
			modified_at: '2018-04-19T13:55:09-07:00' }
		*/
	});

Response Example

{
  "id": "11446498",
  "type": "terms_of_service",
  "created_at": "2012-12-12T10:53:43-08:00",
  "enterprise": {
    "id": "11446498",
    "type": "enterprise",
    "name": "Acme Inc."
  },
  "modified_at": "2012-12-12T10:53:43-08:00",
  "status": "enabled",
  "text": "By using this service, you agree to ...",
  "tos_type": "managed"
}