> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Mock Data

> Update the mock data for a template. Sets the input payload, recipient, tenant, actor, and batching configuration used for previews and testing.



## OpenAPI

````yaml PATCH /v2/{workspace}/template/{template_slug}/mock_data/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v2/{workspace}/template/{template_slug}/mock_data/:
    patch:
      summary: Update Mock Data
      description: >-
        Update the mock data for a template. Sets the input payload, recipient,
        tenant, actor, and batching configuration used for previews and testing.
      operationId: update-mock-data-v2
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
        - in: path
          name: template_slug
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                payload:
                  type: object
                  description: Input payload data with sample variable values.
                tenant_id:
                  type: string
                  description: Tenant ID for preview.
                  example: default
                is_batch:
                  type: boolean
                  description: Whether to simulate batched/digest data.
                  default: false
                batch_count:
                  type: integer
                  description: >-
                    Number of batched events to simulate (only relevant when
                    `is_batch` is true).
                  example: 2
                recipient_sub_type:
                  type: string
                  enum:
                    - user
                    - object
                  description: Type of recipient.
                  example: user
                recipient_distinct_id:
                  type: string
                  description: >-
                    Distinct ID of the test recipient (when `recipient_sub_type`
                    is `user`).
                  example: user-123
                recipient_object:
                  type: object
                  description: Object identifier (when `recipient_sub_type` is `object`).
                  properties:
                    object_type:
                      type: string
                    id:
                      type: string
                actor_sub_type:
                  type: string
                  enum:
                    - user
                    - object
                  description: Type of actor.
                actor_distinct_id:
                  type: string
                  description: Distinct ID of the actor user.
                actor_object:
                  type: object
                  description: Object identifier for actor.
                  properties:
                    object_type:
                      type: string
                    id:
                      type: string
      responses:
        '200':
          description: >-
            Mock data updated successfully. Returns the same structure as Get
            Mock Data — both `data` (raw config) and `transformed_data`
            (resolved values).
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  payload:
                    user:
                      name: Pat Morgan
                    event:
                      status: shipped
                  tenant_id: default
                  is_batch: false
                  batch_count: 2
                  recipient_sub_type: user
                  recipient_object: null
                  recipient_distinct_id: user_12345
                  actor_sub_type: user
                  actor_object: null
                  actor_distinct_id: actor_67890
                transformed_data:
                  user:
                    name: Pat Morgan
                  event:
                    status: shipped
                  $batch_key: evaluated batch_key
                  $batched_events:
                    - user:
                        name: Pat Morgan
                      event:
                        status: shipped
                    - user:
                        name: Pat Morgan
                      event:
                        status: shipped
                  $batched_events_count: 2
                  $brand:
                    brand_id: default
                    brand_name: My Company
                    logo: https://cdn.example.com/logo.png
                    primary_color: '#2E70E8'
                    secondary_color: '#63A3F7'
                    tertiary_color: '#FFFFFF'
                    embedded_preference_url: https://preferences.example.com/embed
                    hosted_preference_domain: preferences.example.com
                    blocked_channels: null
                    social_links:
                      website: https://www.example.com
                      linkedin: https://linkedin.com/company/example
                    properties: {}
                    timezone: null
                  $user:
                    name: Jamie Rivera
                    email: jamie.rivera@example.com
                    distinct_id: user_12345
                  $recipient:
                    name: Jamie Rivera
                    email: jamie.rivera@example.com
                    distinct_id: user_12345
                  $actor:
                    name: Taylor Chen
                    email: taylor.chen@example.com
                    distinct_id: actor_67890
                  $embedded_preference_url: https://preferences.example.com/embed
                  $hosted_preference_url: https://preferences.example.com/?key=xxxxxxxxxxxxxxx
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - ServiceTokenAuth: []
      servers:
        - url: https://management-api.suprsend.com
      x-codeSamples:
        - lang: cURL
          label: Update Mock Data
          source: >
            curl -X PATCH
            "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/"
            \
              --header 'Authorization: ServiceToken <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "payload": {"order_id": "ORD-1234", "amount": "$99.99"},
                "tenant_id": "default",
                "is_batch": false,
                "recipient_sub_type": "user",
                "recipient_distinct_id": "user-123"
              }'
components:
  responses:
    AuthenticationError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            error_code: authentication_failed
            type: AuthenticationFailed
            message: Invalid service token.
            detail: Invalid service token.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            error_code: not_found
            type: NotFound
            message: workspace 'demo' not found
            detail: workspace 'demo' not found
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code
        error_code:
          type: string
          description: Specific error code identifier
        type:
          type: string
          description: Error type classification
        message:
          type: string
          description: Human-readable error message
        detail:
          type: string
          description: Additional error details
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.
    ServiceTokenAuth:
      type: apiKey
      in: header
      name: ServiceToken <token>
      description: >-
        You can get Service Token from [SuprSend dashboard -> Account Settings
        -> Service
        Tokens](https://app.suprsend.com/en/account-settings/service-tokens)
        section.

````