---
title: "This endpoint creates sample data for trial organizations as part of the Sample data Opt-In functionality."
method: POST
path: "/sample-data"
tags: ["Sample Data"]
---

# This endpoint creates sample data for trial organizations as part of the Sample data Opt-In functionality.

`POST /sample-data`

## Request

- Base URL: `https://console.jumpcloud.com/api/v2`
- URL: `https://console.jumpcloud.com/api/v2/sample-data`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/docs/sample-data/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint creates sample data for the organization based on the requested resource types.

Supported resource types:
- `users`: Creates 6 sample users (2 activated, 2 staged, 2 suspended) with varying attributes
- `usergroups`: Creates a dynamic user group that automatically includes users in the Sales department

Each resource type is processed independently. If one fails, others may still succeed.
The response includes detailed results showing what was created, skipped, or failed.

## Request body

- object
  - `resourceTypes` string[], required: Array of resource types to create. Each resource type is processed independently.

## Response `200`

OK

- object
  - `message` string: Response message describing the outcome.
  - `results` object: Detailed results of the sample data creation operation.
    - `created` object[]: List of successfully created resources.
      - `resourceType` string: The type of resource that was created.
      - `count` integer: Number of resources created.
    - `skipped` object[]: List of resources that were skipped (e.g., already exist).
      - `resourceType` string: The type of resource that was skipped.
      - `reason` string: Reason why the resource was skipped.
    - `failed` object[]: List of resources that failed to create.
      - `resourceType` string: The type of resource that failed.
      - `error` string: Error message describing the failure.

## Other responses

- `403`: Forbidden - Feature flag is disabled
- `422`: Unprocessable Entity - One or more resources failed to create

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/revisions/3f09fe63caaa?raw)
