> ## 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.

# Get Script

> Returns a single script



## OpenAPI

````yaml GET /script/{script_id}
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/{script_id}:
    get:
      tags:
        - script
      summary: Find script by id
      description: Returns a single script
      operationId: getScriptById
      parameters:
        - name: script_id
          in: path
          description: ID of script to return
          required: true
          schema:
            type: number
            example: 1234
      responses:
        '200':
          description: Script details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScriptResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    ScriptResponse:
      type: object
      properties:
        message:
          type: string
          example: Script details
          description: Message will be a description of the response
        data:
          type: object
          oneOf:
            - $ref: '#/components/schemas/ProcessedScript'
              title: Processed
            - $ref: '#/components/schemas/InProcessScript'
              title: In Process
            - $ref: '#/components/schemas/FailedScript'
              title: Failed
    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
    NotFound:
      type: object
      properties:
        message:
          type: string
          example: Not found
          description: message will be a description of the error
        data:
          type: object
          nullable: true
          example: null
          description: data will be null
    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
    ProcessedScript:
      type: object
      properties:
        script_id:
          type: integer
          example: 1
          description: Script ID of the script
        reference_id:
          type: string
          example: '1'
          description: Reference ID of the script
        date_created:
          type: string
          format: date-time
          example: '2025-02-09T01:55:47Z'
          description: Creation date of the script
        status:
          type: string
          enum:
            - processed
          example: processed
          description: Status of the script
        script_data:
          type: object
          properties:
            doctor_first_name:
              type:
                - string
                - 'null'
              example: John
              description: First name of the doctor
            doctor_middle_name:
              type:
                - string
                - 'null'
              example: null
              description: Middle name of the doctor
            doctor_last_name:
              type:
                - string
                - 'null'
              example: Doe
              description: Last name of the doctor
            npi:
              type:
                - string
                - 'null'
              example: '0123456789'
              description: 10 digit npi number of the doctor
            ndc:
              type:
                - string
                - 'null'
              example: '123456789012'
              description: 11 digit ndc number of the medication
            medications:
              type: array
              description: Medications on the script
              items:
                type: object
                properties:
                  medication_name:
                    type:
                      - string
                      - 'null'
                    example: Ubrelvy
                    description: Name of the medication
                  medication_strength:
                    type:
                      - string
                      - 'null'
                    example: 100 mg
                    description: Strength of the medication
                  medication_form:
                    type:
                      - string
                      - 'null'
                    example: Oral tablet
                    description: Form of the medication
                  quantity:
                    type:
                      - string
                      - 'null'
                    example: '27'
                    description: Quantity of the medication
                  sig:
                    type:
                      - string
                      - 'null'
                    example: >-
                      Take one tablet as needed for acute migraine. Maximum 1
                      tablet a day.
                    description: Sig of the medication
                  daw_code:
                    type:
                      - string
                      - 'null'
                    enum:
                      - DAW 0
                      - DAW 1
                      - 'null'
                    example: DAW 1
                    description: Dispense as written (DAW) code of the medication
                  refills:
                    type:
                      - string
                      - 'null'
                    example: '1'
                    description: Refills of the medication
                  potency_unit_code:
                    type:
                      - string
                      - 'null'
                    example: mg
                    description: Potency unit code of the medication
                  unit_total_strength:
                    type:
                      - string
                      - 'null'
                    example: 2 mg
                    description: Unit total strength of the medication
                  unit_total_volume:
                    type:
                      - string
                      - 'null'
                    example: 3 mL
                    description: Unit total volume of the medication
            allergies:
              type:
                - string
                - 'null'
              description: Allergies of the patient
              example: Penicillin, Aspirin
            written_date:
              type:
                - string
                - 'null'
              example: 2024/11/22
              description: Written date of the script
            authenticity:
              type: object
              properties:
                score:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 10
                  example: 10
                  description: >-
                    0-10 points, rounded to 2 decimal places. Scoring
                    components: medications (3 points), written date (0.5
                    points), doctor information (2-6 points depending on
                    validation), signature (0-4 points depending on validation),
                    NDC (0.5 points).
                interpretation:
                  type: string
                  enum:
                    - >-
                      Highly authentic - All critical elements present and
                      validated
                    - >-
                      Highly authentic - All critical elements present and
                      doctor validated
                    - >-
                      Probably authentic - Most critical elements present,
                      including valid signature
                    - >-
                      Probably authentic - Most critical elements present with
                      validated doctor information
                    - >-
                      Possibly authentic - Some critical elements missing or
                      invalid, verify signature carefully
                    - >-
                      Possibly authentic - Some critical elements present but
                      doctor validation incomplete
                    - >-
                      Low authenticity - Critical elements missing or invalid,
                      including possible signature issues
                    - >-
                      Low authenticity - Critical elements missing or invalid,
                      including doctor information
                  example: >-
                    Highly authentic - All critical elements present and doctor
                    validated
                  description: |-
                    When `validate_signatures=true` (max score = 10): 
                     - **Score >= 9:** Highly authentic - All critical elements present and validated 
                     - Score >= 7: Probably authentic - Most critical elements present, including valid signature 
                     - Score >= 5: Possibly authentic - Some critical elements missing or invalid, verify signature carefully 
                     - Score < 5: Low authenticity - Critical elements missing or invalid, including possible signature issues 
                     
                     When `validate_signatures=false` (max score = 10): 
                     - **Score >= 8**: Highly authentic - All critical elements present and doctor validated 
                     - Score >= 6: Probably authentic - Most critical elements present with validated doctor information 
                     - Score >= 4: Possibly authentic - Some critical elements present but doctor validation incomplete 
                     - Score < 4: Low authenticity - Critical elements missing or invalid, including doctor information
                details:
                  type: object
                  properties:
                    medications:
                      type: string
                      enum:
                        - No medications found
                        - X/Y medications complete
                      example: 1/1 medications complete
                      description: >-
                        When no medications are found you get `No medications
                        found`. 

                         When medications are found you get `X/Y medications complete`. 

                         `X` is the number of medications found and `Y` is the total number of medications on the script. 

                         A medication is considered valid if it has all three required fields: 
                        1. `medication_name` 

                        2. `medication_strength` 

                        3. `medication_form` 

                        4. `quantity` 

                        5. `sig`
                    written_date:
                      type: string
                      enum:
                        - Valid written date present
                        - Missing or invalid written date
                      example: Valid written date present
                      description: Authenticity of the written date
                    doctor:
                      type: string
                      enum:
                        - Doctor validated through NPI
                        - X/3 doctor fields present
                      example: Doctor validated through NPI
                      description: >-
                        When doctor is validated through NPI you get `Doctor
                        validated through NPI`. 

                         When doctor is not validated through NPI you get `X/3 doctor fields present`. 

                         `X` can be 0, 1, 2, or 3, representing how many of the following fields are present: doctor_first_name, doctor_last_name, npi. For example: 
                         - `0/3 doctor fields present` (no fields present) 
                         - `1/3 doctor fields present` (one field present) 
                         - `2/3 doctor fields present` (two fields present) 
                         - `3/3 doctor fields present` (all fields present but not validated through NPI)
                    signature:
                      type: string
                      enum:
                        - Valid signature present
                        - Invalid or missing signature
                        - Signature validation skipped
                      example: Signature validation skipped
                      description: >-
                        When `validate_signatures=true` passed during new script
                        request expect response to be one of the following: 
                         - `Valid signature present` 
                         - `Invalid or missing signature` 

                         When `validate_signatures=false` expect response to be `Signature validation skipped`
                    ndc:
                      type: string
                      enum:
                        - Valid NDC present
                        - Missing or invalid NDC
                      example: Valid NDC present
                      description: >-
                        NDC (National Drug Code) authenticity status. Returns
                        `Valid NDC present` when a valid NDC string is found, or
                        `Missing or invalid NDC` when NDC is missing or invalid.
        original_metadata:
          type: object
          properties:
            medications:
              type: array
              description: >-
                This is the metadata of medications that was extracted from the
                script before it was processed by Nitro Script.
              items:
                type: object
                properties:
                  medication:
                    type:
                      - string
                      - 'null'
                    example: Ubrelvy 100 mg oral tablet
                    description: Details of the medication
                  quantity:
                    type:
                      - string
                      - 'null'
                    example: '27'
                    description: Quantity of the medication
                  sig:
                    type:
                      - string
                      - 'null'
                    example: 1 tab as needed for acute migraine. Max 1 tab a day.
                    description: Sig of the medication
                  refills:
                    type:
                      - string
                      - 'null'
                    example: '1'
                    description: Refills of the medication
                  metadata:
                    type: object
                    description: >-
                      Metadata of the medication processed for entity specific
                      processing. This is only present if entity specific
                      processing is enabled. The docs for entity specific
                      processing will be provided internally.
    InProcessScript:
      type: object
      properties:
        script_id:
          type: integer
          example: 56
          description: Script ID of the script
        reference_id:
          type: string
          example: '123'
          description: Reference ID of the script
        date_created:
          type: string
          format: date-time
          example: '2025-02-09T01:55:47Z'
          description: Creation date of the script
        status:
          type: string
          enum:
            - requested
            - converted
            - text_extracted
          example: requested
          description: Status of the script
    FailedScript:
      type: object
      properties:
        script_id:
          type: integer
          example: 56
          description: Script ID of the script
        reference_id:
          type: string
          example: '123'
          description: Reference ID of the script
        date_created:
          type: string
          format: date-time
          example: '2025-02-09T01:55:47Z'
          description: Creation date of the script
        status:
          type: string
          enum:
            - failed
            - cancelled
          example: failed
          description: Status of the script
        fail_reason:
          type: string
          example: Failed to process script
          description: Reason for the failure
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: API Key for authentication

````