LogoLogo
Release notesDocs homeFabricateTonic.ai
  • Tonic Fabricate User Guide
  • Fabricate workflow
  • Tutorial videos
  • Fabricate account
    • Getting started with Fabricate
    • Fabricate license plans
    • Managing your Fabricate account and profile
    • Managing users in your account
  • Databases
    • Supported database types
    • Creating and managing databases
  • Backing up and restoring the database definition
  • Configuring database variables
  • Exporting data from a database
  • Tables and columns
    • Managing database tables
      • Configuring table settings
      • Adding a table to a database
      • Removing a table from a database
      • Attaching static data to a table
      • Regenerating table data
  • Managing table columns
    • Adding and removing columns
    • Configuring a column
    • Generator reference
      • Calculated or related values
      • Unstructured data
      • Data type and specific values
      • Names and other identifying information
      • Telephone numbers and email addresses
      • Geographic locations
      • Air travel
      • Natural science
      • Networks and files
      • Banking and finance
      • Dates and times
      • Vehicles
      • Companies and products
      • Healthcare and health insurance
      • Languages
      • Movies
      • Education
    • Fabricate custom SQLite functions
  • Views
    • Creating and managing views
    • Views reference
  • Workspaces
    • About workspaces
  • Creating and managing workspaces
  • Database mock API
    • About mock APIs
    • Defining a mock API
    • Creating and querying database snapshots
  • Mock API reference
  • Fabricate API and CLI
    • Managing Fabricate API keys
    • Daily limits on generated data
    • Using the Fabricate API
      • Authentication for the API
      • Data model
      • Managing databases from the API
      • Generating data from the API
    • Using the Fabricate CLI
      • Setting up CLI access
      • Using the CLI to load data
  • Self-hosted Fabricate
    • Fabricate architecture
    • Setting up the Fabricate components
    • Limiting login attempts
    • Starting a Fabricate instance
    • Upgrading a Fabricate instance
Powered by GitBook
On this page
  • Populating the mock API definition directly
  • Using Fabricate AI to generate the mock API definition
  • Tracking the change history for the mock API definition
  • Displaying the change history
  • Reverting to a previous version
Export as PDF
  1. Database mock API

Defining a mock API

Last updated 20 days ago

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.

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.

  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.

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.

Default view of the API tab for a database
Compose with API panel with calls generated by AI based on descriptions
Change history for a mock API definition