Admin API: Data Buckets


This endpoint allows you to manage the data buckets without restarting the server.

 Get a data bucket value

To get the value of a data bucket, call the /mockoon-admin/data-buckets endpoint with the following parameters:

  • Method: GET
  • URL: /mockoon-admin/data-buckets/:nameOrId, where :nameOrId is the name or unique id of the data bucket.

Example request:

Copy
GET /mockoon-admin/data-buckets/myData

Example response:

Copy
{ "name": "myData", "id": "abcd", "value": { "property": "value" } }

The value of the data bucket is returned as a JSON object in the value property. This allows you to check if the data bucket was correctly parsed from the JSON string content initially provided.

 Reset the data buckets

To reset the data buckets to their initial state, call one of the following endpoints without payload:

  • POST /mockoon-admin/data-buckets/purge.
  • PURGE /mockoon-admin/data-buckets.