© 2026 DevToolbox. All rights reserved.
About UsPrivacy PolicyTerms & Conditions

    Mock Data API Documentation

    This document provides instructions on how to use our AI-powered mock data generation API. Go back to the Mock API Playground to generate your endpoint.

    API Endpoints

    POST
    /mock-api/generate

    Generates random data from a JSON schema and returns a share link with a preview of the generated records.

    Request Parameters

    FieldTypeRequiredDescription
    jsonSchemaobjectYesThe schema definition. Keys are field names, values are generators.
    recordsintegerNoNumber of records to generate. Default: 1

    Request Example

    curl -X POST <YOUR_ENDPOINT_URL>/generate \
      -H "Content-Type: application/json" \
      -d '{
      "jsonSchema": {
        "id": "uuid",
        "firstName": "firstName",
        "lastName": "lastName",
        "email": "email",
        "phone": "phone",
        "company": "company",
        "price": "price",
        "createdAt": "date"
      },
      "records": 2
    }'

    200 Success Response

    {
      "apiUrl": "/mock-api/share/3d08bb76-0041-44dd-95bb-a19e9c173b29",
      "preview": [
        {
          "id": "24059a6d-4370-4ea3-95fa-c89c1c4a289b",
          "firstName": "Cody",
          "lastName": "Abernathy",
          "email": "[email protected]",
          "phone": "(335) 730-3808 x778",
          "company": "Koepp, Hagenes and Stroman",
          "price": "583.77",
          "createdAt": "2025-12-21T20:06:46.652Z"
        }
      ]
    }
    GET
    /mock-api/share/:shareId

    Retrieves the previously generated mock data using the share ID. This endpoint is ideal for embedding directly in your frontend application.

    URL Parameters

    FieldTypeRequiredDescription
    shareIdstringYesThe ID returned in apiUrl from POST /generate

    Request Example

    curl -X GET <YOUR_ENDPOINT_URL>/mock-api/share/d6e6e81c-59f4-4b4f-a464-68e253a85328

    200 Success Response

    {
      "status": "success",
      "data": [
        {
          "id": "24059a6d-4370-4ea3-95fa-c89c1c4a289b",
          "firstName": "Cody",
          "lastName": "Abernathy",
          "email": "[email protected]",
          "phone": "(335) 730-3808 x778",
          "company": "Koepp, Hagenes and Stroman",
          "price": "583.77",
          "createdAt": "2025-12-21T20:06:46.652Z"
        }
      ]
    }

    Error Responses

    400 Bad Request

    {
      "status": "error",
      "message": "Invalid schema format"
    }

    404 Not Found

    {
      "status": "error",
      "message": "Share ID not found"
    }

    Supported Schema Properties

    Use the following property keys in jsonSchema. Each key maps to a generator powered by faker.js.

    Identity / User

    PropertyTypeExampleNotes
    firstNamestringSouravRandom first name
    lastNamestringHalderRandom last name
    middleNamestringJamesRandom middle name
    fullNamestringJohn James DoeFull name (first + middle + last)
    genderstringMaleReturns "male" or "female"
    jobTitlestringSoftware EngineerRandom professional title
    jobTypestringFull-timeJob type (Full-time, Contract, etc.)
    biostringPassionate developer...Short biography text

    Address / Location

    PropertyTypeExampleNotes
    streetstring42 StreetStreet address
    secondaryAddressstringApt. 12BDXApartment, suite, etc.
    buildingNumberstring221BBuilding/house number
    citystringKolkataRandom city name
    statestringWest BengalFull state/region name
    stateAbbrstringWBAbbreviated state code
    countrystringIndiaRandom country
    countryCodestringINISO 2-letter country code
    zipstring700001Postal/ZIP code
    coordinatesobject{ lat: -57.67, lng: 153.38 }Lat/lng coordinates
    timezonestringAsia/KolkataIANA timezone string

    Commerce / Business

    PropertyTypeExampleNotes
    productstringShoesSimple product type
    productNamestringErgonomic Wooden ChairFull product name
    productDescriptionstringStylish chair with comfortMarketing description
    departmentstringElectronicsCommerce department
    pricestring199.99Random price
    currencystringUSDISO 4217 currency code
    companystringGlobex CorporationCompany name
    catchPhrasestringEmpowering next-gen solutionsCompany catch phrase

    Tech / Internet

    PropertyTypeExampleNotes
    emailstring[email protected]Valid-looking email
    usernamestringjohndoe92Random username
    passwordstringpassW0rd!Random password
    urlstringhttps://example.comRandom URL
    domainstringexample.orgDomain name
    ipstring192.168.1.10IPv4 address
    ipv6string2001:0db8:85a3...IPv6 address
    macstring00:1B:44:11:3A:B7MAC address

    Date & Time

    PropertyTypeExampleNotes
    datestring (ISO)2025-08-20T14:32:00.000ZRandom date-time
    pastDatestring (ISO)2021-05-14T09:22:00.000ZDate in the past
    futureDatestring (ISO)2026-03-02T18:45:00.000ZDate in the future
    recentDatestring (ISO)2025-08-18T07:12:00.000ZRecent past date
    birthdatestring (ISO)1993-04-25T00:00:00.000ZPlausible birthdate
    monthstringAugustMonth name
    weekdaystringWednesdayDay of the week

    Text / Content

    PropertyTypeExampleNotes
    wordstringinnovationSingle random word
    wordsstringcreative smart designMultiple random words
    sentencestringThe quick brown fox jumps.Single sentence
    paragraphstringLorem ipsum dolor sit amet...Single paragraph
    slugstringcreative-design-ideasURL-friendly slug

    System / Misc

    PropertyTypeExampleNotes
    uuidstring7c9e6679-7425-40de...UUID v4
    nanoidstringV1StGXR8_Z5jdHi6B-myTNanoID string
    fileNamestringdocument_report.pdfFile name with extension
    mimeTypestringapplication/jsonMIME type
    colorstringorchidColor name
    hexstring#ff6347Hex color code
    rgbstringrgb(255, 99, 71)RGB color string

    Media

    PropertyTypeExampleNotes
    imageUrlstring (URL)https://loremflickr.com/640/480Random image URL
    avatarstring (URL)https://avatars.github...Avatar image URL
    abstractImagestring (URL)https://loremflickr.com/.../abstractAbstract image URL

    Numbers & Boolean

    PropertyTypeExampleNotes
    numberinteger42Random integer (1-100)
    floatfloat57.34Random float (1-100, 2 decimals)
    booleanbooleantrueRandom true or false