Defining a mock API

For a database, you define the mock API on the database API tab.

By default, the API tab contains a commented-out example mock API definition.

Default view of the API tab for a database

Populating the mock API definition directly

One option is to enter the mock API definition directly in the definition field.

For information on the API syntax, go to Mock API reference.

After you populate the definition, to save it, click Save.

Using Fabricate AI to generate the mock API definition

To use the Fabricate AI to generate the mock API definition:

  1. Click Compose with AI.

  2. On the Compose with API panel, provide a description of the calls to include in the mock API, then click Generate.

  3. To add the generated results to the mock API, click Add to API.

Compose with API panel with calls generated by AI based on descriptions
  1. On the API tab, to save the new definition content, click Save.

Tracking the change history for the mock API definition

Every time to save the mock API definition, Fabricate adds an entry to the definition history.

You can view the changes for each saved version, and revert to a previous version.

Displaying the change history

On the API tab, to display the change history, click History.

The History panel lists the versions in reverse chronological order, with the current version at the top.

When you click a version, Fabricate shows the differences from the previous version, including new and removed content.

Change history for a mock API definition

Reverting to a previous version

To revert the mock API definition to a previous version:

  1. In the version list, click the version to revert to.

  2. Click Revert to This Version.

Last updated