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

# Batch Provision

> Provisions multiple types of data (e.g., courses, exams, enrollments) in a single bulk operation for the specified install.

# Batch Provision Endpoint

The Batch Provision endpoint provides a powerful and efficient way to create multiple proctoring resources in a single API call. This streamlined approach allows Learning Management Systems (LMS) and assessment platforms to provision large volumes of data with SmarterProctoring while minimizing network overhead and simplifying integration workflows.

## Overview

With the Batch Provision endpoint, you can simultaneously provision and manage:

* **Courses**: Create course information including metadata, instructors, and configuration
* **Users**: Provision students, instructors, and administrators with appropriate roles and permissions
* **Exams**: Set up assessment details with specific proctoring requirements and settings

This endpoint is particularly valuable for initial system setup, semester transitions, or any scenario requiring bulk data synchronization between your platform and SmarterProctoring.

## Implementation Guidance

When implementing the Batch Provision endpoint, consider structuring your requests to group related resources together and include all necessary reference identifiers to establish proper relationships between entities.

## Response Features

In addition to confirmation of provisioned resources, the response includes:

* **SSO Links**: Secure Single Sign-On (SSO) links for users that can be used to provide direct access to the SmarterProctoring platform without requiring additional authentication steps

## Sample Request Payloads

<AccordionGroup>
  <Accordion title="Create Course and Exam">
    Create a course and exam if they do not already exist.

    ```json theme={null}
    {
    "course": {
        "ids": {
            "api": "sample"
        },
        "title": "Sample Course",
        "code": "sample"
    },
    "exam": {
        "ids": {
            "external": "exam-1"
        },
        "title": "Sample Exam",
        "description": "This is just a sample exam.",
        "type": "online",
        "practice": false,
        "limitedScope": false,
        "deliverySystem": "",
        "configuration": {
            "ids": {
                "api": "config-1"
            },
            "type": "primary",
            "url": "https://validurl.com",
            "access": {
                "open": "2025-02-16T17:00:00Z",
                "close": "2025-02-20T17:00:00Z"
            },
            "scheduling": {
                "open": "",
                "close": ""
            },
            "duration": 60,
            "password": "a8wlquoaois",
            "attempts": 1,
            "notes": {
                "student": "student notes",
                "proctor": "proctor notes"
            },
            "proctorTypes": {
                "TS6d6011935f4646848ea4f7a29b4f61a5": {
                    "options": {
                        "recordScreen": {},
                        "recordWebcam": {},
                        "recordAudio": {},
                        "forceFullScreen": {},
                        "onlyOneScreen": {},
                        "disableNewTabs": {},
                        "closeOpenTabs": {},
                        "disablePrinting": {},
                        "disableClipboard": {},
                        "disableRightClick": {},
                        "verifyId": {},
                        "roomScan": {}
                    }
                }
            },
            "permittedItems": {
                "bathroomBreak": {
                    "notes": "Porta-potty is out back."
                },
                "calculator": {
                    "notes": "TI-85"
                },
                "dictionary": {
                    "notes": "Only Nish dictionaries"
                },
                "earplugs": {
                    "notes": "Things will get loud!"
                },
                "formulaSheet": {
                    "notes": ""
                },
                "notes": {
                    "notes": "handwritten only, nothing in print"
                },
                "textbook": {
                    "notes": "Just the book \"Cultural Toolbox\" by Anton Treuer"
                },
                "websites": {
                    "notes": ""
                }
            }
        }
    }
    ```
  </Accordion>

  <Accordion title="Enroll Student Only">
    Enroll a student into an existing course, and ensure a signon link is returned so the user can access the system.

    ```json theme={null}
    {
        "course": {
            "ids": {
                "sid": "CU8b2d9c5ef3e8471ab6cf19509beac183"
            }
        },
        "user": {
            "ids": {
                "api": "john-doe-123"
            },
            "firstName": "John",
            "lastName": "Doe",
            "email": "john.doe@smarterservices.com",
            "currencyCode": "USD",
            "timeZone": "America/New_York"
        },
        "enrollment": {
            "role": "learner"
        },
        "signon": {
            "integrationSid": "IIf5a9128504e251fad9e4a38dc0813f74"
        }
    }
    ```
  </Accordion>
</AccordionGroup>

## Request Parameters

The Batch Provision endpoint accepts a JSON payload containing the following parameters:


## OpenAPI

````yaml POST /v2/installs/{installSid}/provision
openapi: 3.0.0
info:
  title: SmarterProctoring API
  version: 3.0.3
  description: API documentation for SmarterProctoring
servers:
  - url: https://api.smarterproctoring.com
security:
  - client: []
tags:
  - name: App Install
    description: App Install operations
    x-group: App Install
  - name: Course
    description: Course operations
    x-group: Course
  - name: Course Offering
    description: Course Offering operations
    x-group: Course Offering
  - name: Exam
    description: Exam operations
    x-group: Exam
  - name: Exam Configuration
    description: Exam Configuration operations
    x-group: Exam Configuration
  - name: Exam Events
    description: Exam Events operations
    x-group: Exam Events
  - name: Exam Session
    description: Exam Session operations
    x-group: Exam Session
  - name: Exam Session Annotation
    description: Exam Session Annotation operations
    x-group: Exam Session Annotation
  - name: Exam Session Event
    description: Exam Session Event operations
    x-group: Exam Session Event
  - name: Onboarding
    description: Onboarding operations
    x-group: Onboarding
  - name: Provision
    description: Provision operations
    x-group: Provision
  - name: Reports
    description: Reports operations
    x-group: Reports
  - name: Time Zones
    description: Time Zones operations
    x-group: Time Zones
  - name: User
    description: User operations
    x-group: User
paths:
  /v2/installs/{installSid}/provision:
    post:
      tags:
        - Provision
      summary: Bulk Provision Data
      description: >-
        Provisions multiple types of data (e.g., courses, exams, enrollments) in
        a single bulk operation for the specified install.
      operationId: postV2InstallsInstallsidProvision
      parameters:
        - name: installSid
          in: path
          schema:
            type: string
            description: Install Sid
            pattern: ^AI[a-f0-9]{32}$
          description: Install Sid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model40'
      responses:
        default:
          description: Successful
          content:
            application/json:
              schema:
                type: string
components:
  schemas:
    Model40:
      type: object
      properties:
        course:
          $ref: '#/components/schemas/ProvisionCourse'
        user:
          $ref: '#/components/schemas/ProvisionUser'
        enrollment:
          description: >-
            Enrollment object is optional but can only exist if `user` is
            provided.
          anyOf:
            - b39eb15c-6a8b-451f-a35e-2ed24c7310fb
        exam:
          $ref: '#/components/schemas/ProvisionExam'
        signon:
          $ref: '#/components/schemas/ProvisionSignon'
      required:
        - course
    ProvisionCourse:
      type: object
      description: Course data
      properties:
        ids:
          $ref: '#/components/schemas/ids'
        title:
          description: Required if `sid` is NOT provided.
          required:
            - title
          anyOf:
            - type: string
            - type: string
        code:
          description: Required if `sid` is NOT provided.
          anyOf:
            - type: string
              nullable: true
            - type: string
              nullable: true
      required:
        - ids
    ProvisionUser:
      type: object
      properties:
        ids:
          $ref: '#/components/schemas/Model35'
        firstName:
          description: Required if `sid` is NOT provided.
          required:
            - firstName
          anyOf:
            - type: string
            - type: string
        lastName:
          description: Required if `sid` is NOT provided.
          required:
            - lastName
          anyOf:
            - type: string
            - type: string
        email:
          description: Must be a valid email. Required if `sid` is NOT provided.
          required:
            - email
          anyOf:
            - type: string
              x-format:
                email: true
            - type: string
              x-format:
                email: true
        currencyCode:
          type: string
          description: >-
            Currency code for the user, if not passed, will default to the
            currency set on the account.
          nullable: true
        timeZone:
          type: string
          description: >-
            Time zone of the user, if not passed, will default to the timezone
            set on the account.
          nullable: true
      required:
        - ids
    ProvisionExam:
      type: object
      description: >-
        Exam schema ensuring required and optional fields meet validation
        criteria.
      properties:
        ids:
          $ref: '#/components/schemas/Model36'
        title:
          description: Title is required if ids.sid is not provided.
          required:
            - title
          anyOf:
            - type: string
            - type: string
        description:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/type'
        practice:
          type: boolean
          default: false
        limitedScope:
          type: boolean
          default: false
        deliverySystem:
          type: string
          description: Must be validated against available systems.
          nullable: true
        configuration:
          $ref: '#/components/schemas/Model39'
      required:
        - ids
    ProvisionSignon:
      type: object
      description: >-
        Optional signon object.. If provided, integrationSid must be present.
        This will return the signon information to redirect the user to.
      properties:
        integrationSid:
          type: string
          description: >-
            Required if signon is provided. Must start with "II" and be a
            32-character alphanumeric string.
          pattern: ^II[a-fA-F0-9]{32}$
      required:
        - integrationSid
    ids:
      type: object
      description: Contains course identifiers; only one ID type is allowed.
      properties:
        sid:
          type: string
          pattern: ^CU[a-z0-9]{32}$
        api:
          type: string
        lms:
          type: string
        external:
          type: string
    Model35:
      type: object
      description: Contains user identifiers; only one ID type is allowed.
      properties:
        sid:
          type: string
          pattern: ^US[a-z0-9]{32}$
        api:
          type: string
        lms:
          type: string
        external:
          type: string
    Model36:
      type: object
      description: Exam IDs must contain either "sid" (EX+32 chars) or "external" (string).
      properties:
        sid:
          type: string
          pattern: ^EX[a-z0-9]{32}$
        external:
          type: string
    type:
      type: string
      default: online
      enum:
        - online
        - written
    Model39:
      type: object
      description: Configuration for the exam. Optional unless IDs are required.
      properties:
        ids:
          type: string
        type:
          $ref: '#/components/schemas/Model37'
        url:
          type: string
        access:
          $ref: '#/components/schemas/access'
        scheduling:
          $ref: '#/components/schemas/scheduling'
        duration:
          type: integer
          description: Duration in minutes.
          x-constraint:
            sign: positive
        password:
          type: string
        attempts:
          type: integer
          default: 1
          x-constraint:
            sign: positive
        notes:
          $ref: '#/components/schemas/notes'
        proctorTypes:
          $ref: '#/components/schemas/Model38'
        permittedItems:
          $ref: '#/components/schemas/permittedItems'
      required:
        - url
        - access
        - duration
        - password
        - proctorTypes
    Model37:
      type: string
      default: primary
      enum:
        - primary
        - accommodation
    access:
      type: object
      description: Defines access times for the exam.
      properties:
        open:
          type: string
          x-format:
            isoDate: true
        close:
          type: string
          x-format:
            isoDate: true
      required:
        - open
        - close
    scheduling:
      type: object
      description: Defines optional scheduling times.
      properties:
        open:
          type: string
          x-format:
            isoDate: true
        close:
          type: string
          x-format:
            isoDate: true
    notes:
      type: object
      properties:
        student:
          type: string
        proctor:
          type: string
    Model38:
      type: object
      description: >-
        Proctoring options. TS+32 character ID keys. Options are optional but
        required for virtual settings.
    permittedItems:
      type: object
      description: Optional permitted items with notes.
  securitySchemes:
    client:
      type: apiKey
      name: token
      in: header

````