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

# Delete a script

> Delete a script by its id. Requires the WRITE_SCRIPTS scope.

Deletes the script by id. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml DELETE /scripts/{id}
openapi: 3.1.0
info:
  title: Salesive Apps API — Productivity
  version: 1.0.0
  description: >-
    Manage the store's productivity resources from an installed third-party app:
    tasks (with recurrence and per-occurrence responses), notes, custom
    storefront scripts/tracking, and storefront comment replies. Every endpoint
    authenticates with an installed-app access token (prefix `app_`) and
    requires a specific OAuth scope. The target store is bound to the token
    server-side from the installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /scripts/{id}:
    delete:
      tags:
        - Scripts
      summary: Delete a script
      description: >-
        Deletes a script by its id. Authenticate with `Authorization: Bearer
        app_<token>`. Returns 404 if the script does not exist or does not
        belong to the installation's store. Requires the `WRITE_SCRIPTS` scope
        and returns 403 if missing. The store is bound to the app token
        server-side from the installation — never send a shop id.
      operationId: deleteScript
      parameters:
        - $ref: '#/components/parameters/ScriptId'
      responses:
        '200':
          description: The script was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
              example:
                status: 200
                success: true
                message: Script deleted
                data: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ScriptId:
      name: id
      in: path
      required: true
      description: The script's id (Mongo ObjectId).
      schema:
        type: string
  schemas:
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    NotFound:
      description: >-
        The resource does not exist or does not belong to the installation's
        store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Resource not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````