Skip to content

Getting Started

Go from zero to a live mock API in under five minutes.

1. Create an account

Sign up for a free Testfly account at app.testfly.com. No credit card required. You will receive a confirmation email to verify your address before proceeding.

Once verified, log in to the Testfly portal. You will land on the dashboard, which shows your workspaces, API request counts, and quick actions.


2. Create a workspace

From the dashboard, click New Workspace. Give it a name (for example, "Petstore" or "E-Commerce API") and a URL slug. The slug becomes your mock API's subdomain:

https://petstore.mock.testfly.com

You can configure the number of rows to generate per resource table. Choose the volume that fits your use case:

  • 10 rows — Quick prototyping and demos
  • 100 rows (default) — General development and manual testing
  • 1,000 rows — Integration testing, pagination, filtering
  • 10,000 rows — Performance and load testing (Pro plan max)

You can also set a seed value for reproducible data — same seed, same spec, same data every time.


3. Upload your OpenAPI spec

In the workspace detail page, click Upload Spec. Paste your OpenAPI spec (YAML or JSON) or upload a file. Testfly supports OpenAPI 2.0, 3.0, and 3.1.

Testfly parses your spec and:

  • Discovers all schemas and maps them to resources
  • Detects foreign key relationships between resources
  • Maps paths and operations to CRUD routes
  • Generates realistic, relationally-consistent fake data
  • Provisions an isolated database for your workspace

The entire process takes seconds. You can also upload specs via the API:

curl -X POST https://api.testfly.com/api/workspaces/{wid}/specs \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "versionLabel": "v1.0",
    "rawSpec": "openapi: 3.1.0\ninfo:\n  title: Petstore\n..."
  }'

4. Hit your mock API

Your mock API is now live at your workspace's subdomain. Try fetching a list of resources:

curl https://petstore.mock.testfly.com/pets

{
  "data": [
    { "id": "a1b2c3", "name": "Luna", "species": "cat", "owner_id": "u_7f8e" },
    { "id": "d4e5f6", "name": "Max", "species": "dog", "owner_id": "u_3a1b" }
  ],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "totalCount": 100,
    "totalPages": 5
  }
}

Notice that owner_id values reference real user records. You can verify this:

curl https://petstore.mock.testfly.com/users/u_7f8e

{ "id": "u_7f8e", "name": "Sarah Chen", "email": "sarah.chen@example.com" }

5. Try CRUD operations

Your mock API supports full CRUD. Create a new record:

curl -X POST https://petstore.mock.testfly.com/pets \
  -H "Content-Type: application/json" \
  -d '{ "name": "Bella", "species": "dog", "owner_id": "u_7f8e" }'

# 201 Created
{ "id": "g7h8i9", "name": "Bella", "species": "dog", "owner_id": "u_7f8e" }

The record persists. Update it, fetch it, or delete it:

# Update
curl -X PUT .../pets/g7h8i9 -d '{ "name": "Bella Mae" }'

# Fetch
curl .../pets/g7h8i9
{ "id": "g7h8i9", "name": "Bella Mae", "species": "dog" }

# Delete
curl -X DELETE .../pets/g7h8i9
# 204 No Content

Use query parameters for pagination, filtering, and sorting:

# Page 2, 10 items per page
curl .../pets?page=2&pageSize=10

# Filter by species
curl .../pets?species=cat

# Sort by name descending
curl .../pets?sortBy=name&sortDesc=true

6. Next steps

You have a fully functional mock API. Here are some things to explore next:

  • Configure simulated latency and error rates in workspace settings to test edge cases
  • Set a seed value for deterministic data generation across test runs
  • Use the Platform API to create workspaces programmatically in your CI pipeline
  • Upload a new spec version to regenerate data while keeping the same workspace
  • Explore the Workspaces guide for advanced configuration

Ready to get started?

Create your free account and upload your first spec in minutes.