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

# Create Script

> Creates a new script for processing



## OpenAPI

````yaml POST /script
openapi: 3.1.0
info:
  title: Nitro Script API Documentation
  description: >-
    This is the API documentation for the Nitro Script API Service, which
    provides endpoints for processing and managing medical prescriptions. All
    endpoints require authentication using an API key.
  version: 1.0.0
servers:
  - description: Production Environment
    url: https://nitro-script-api.nitrorx.ai
  - description: Development Environment
    url: https://dev-nitro-script-api.nitrorx.ai
security:
  - bearerAuth: []
tags:
  - name: script
    description: Everything about Nitro Script
  - name: health
    description: Everything about Nitro Script Health
  - name: entity
    description: Everything about Entity
paths:
  /script:
    post:
      tags:
        - script
      summary: Create script
      description: Creates a new script for processing
      operationId: createScript
      requestBody:
        description: >-
          Script data that needs to be processed. Run this endpoint in Postman
          if you are testing this endpoint. rx_document upload file does not
          work here due to a bug with uploading files from mintlify.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                reference_id:
                  type: string
                  description: >-
                    Your internal reference id for this script. The webhook to
                    push the script results back to your system will use this
                    `reference_id` which will help you associate the script
                    results with the correct script. Pass `0` if you do not have
                    a reference id for this script or you do not want trigger
                    the webhook.
                rx_document:
                  type: string
                  format: binary
                  description: >-
                    Prescription document file. Following file formats are
                    supported: 
                     - PDF (single or multiple pages) 
                     - PNG 
                     - JPG/JPEG 
                     - TIFF (single or multiple pages). 
                     
                     Maximum file size is 5MB.
                check_signatures:
                  type: boolean
                  default: true
                  description: |-
                    Optional flag to check for signatures authenticity. 
                      - If `true`, the script will be checked for signatures authenticity. 
                     - If `false`, the script will not be checked for signatures authenticity. 

                     Pass `false` if there are no doctor signatures on the script.
                  enum:
                    - true
                    - false
                entity_code:
                  type: string
                  description: >-
                    Entity code for the script. This is used to identify the
                    entity that the script belongs to. This is required for
                    scripts that needs entity specific processing. If you do not
                    have an entity code, please do not pass this parameter.
              required:
                - reference_id
                - rx_document
            encoding:
              rx_document:
                contentType: application/pdf,image/png,image/jpeg,image/tiff
        required: true
      responses:
        '200':
          description: Script submitted successfully response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewScriptResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayloadTooLarge'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    NewScriptResponse:
      type: object
      properties:
        message:
          type: string
          example: Script request submitted successfully
        data:
          type: object
          properties:
            script_id:
              type: integer
              example: 1
              description: Generated Script ID by the system
            reference_id:
              type: string
              example: '0'
              description: Your internal reference id for this script
    BadRequest:
      type: object
      properties:
        message:
          type: string
          example: A bad request error
          description: message will be a description of the error
        data:
          type: object
          nullable: true
          example: null
          description: data will be null
    Unauthorized:
      type: object
      properties:
        message:
          type: string
          example: Unauthorized
          description: Message will be a description of the error
        data:
          type: object
          nullable: true
          example: null
          description: Data will be null
    PayloadTooLarge:
      type: object
      properties:
        message:
          type: string
          example: Payload too large
          description: message will be a description of the error
    InternalError:
      type: object
      properties:
        message:
          type: string
          example: An internal server error occurred
          description: message will be a description of the error
        data:
          type: object
          nullable: true
          example: null
          description: data will be null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: API Key for authentication

````