System APIs

1. Backup

This API is used to backup the filter state. The result will be a zip file that can be later used by the Restore API. The zip file will contain the following:

  • Blacklist

    • Dictionary Entries

    • Filter Entries

    • Phrase Entries

    • Username Schemes

  • Whitelist

    • Allow Entries

    • Disallowed Phrases

    • Advanced Disallowed Phrases

  • URL Whitelist Entries

The following configuration is not contained in the backup and as such will also not be modified during the restore. In the future we may add additional configuration to the backup, if you have a requirement for one or more of the following send us a note at sales@cleanspeak.com and let us know about your use case.

  • Moderation Configuration

    • Applications

    • Content Actions

    • User Actions

    • User Action Reasons

    • Automated User Actions

    • Webhooks

    • Email Templates

  • Other Configuration

    • Global Configuration

    • API Keys

    • Moderators

    • BBCodes

  • Verification

    • Match Cases

    • Non-Match Cases

  • User Generated Content

1.1. Request

URI (3.x, deprecated in 4.0.0)

GET /system/backup

URI (4.x)

GET /api/system/backup

In the following cURL example a backup is requested and saved to a file named backup.zip. Note this example has omitted the required Authorization header, see Authentication.

curl -XGET https://example-cleanspeak-api.cleanspeak.io/system/backup -o backup.zip

1.2. Response

Note that a successful response will not contain JSON but instead the response will have a Content-Type of application/octet-stream.

Table 1. Response Codes
Code Description

200

The request was successful.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@cleanspeak.com for assistance.

500

There was an internal error. A stack trace is provided and logged in the CleanSpeak log files. The response will be empty.

2. Restore

This API is used to restore the filter state from a backup. The request takes a binary zip file as input.

It is recommended that if you intend to use the backup and restore APIs in a production environment that you test the process to ensure the results are as you intend. The state of your filter will be overwritten by the contents of the backup and the action can not be reversed.

2.1. Request

URI (3.x, deprecated in 4.0.0)

POST /system/restore

URI (4.x)

POST /api/system/restore

The following cURL example assumes a file named backup.zip exists in the current directory. Note this example has omitted the required Authorization header, see Authentication.

curl -XPOST -H 'Content-Type: application/octet-stream' https://example-cleanspeak-api.cleanspeak.io/system/restore --data-binary @backup.zip

2.2. Response

Table 2. Response Codes
Code Description

200

The request was successful. The response will be empty.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@cleanspeak.com for assistance.

500

There was an internal error. A stack trace is provided and logged in the CleanSpeak log files. The response will be empty.