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

# Archive Prompt

> Archive a prompt you no longer need. Archived prompts are soft-deleted (we set an `archived_at` timestamp) so you can still access them for historical data.

**Safety First:**
- Can't archive a prompt that's currently active. You must activate a different version first.
- Historical data is preserved—old conversations continue to reference archived prompts so your message history stays intact.
- Archived prompts remain accessible for reporting and analysis.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi delete /prompts/{id}
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /prompts/{id}:
    delete:
      tags:
        - Prompts
      summary: Archive Prompt
      description: >-
        Archive a prompt you no longer need. Archived prompts are soft-deleted
        (we set an `archived_at` timestamp) so you can still access them for
        historical data.


        **Safety First:**

        - Can't archive a prompt that's currently active. You must activate a
        different version first.

        - Historical data is preserved—old conversations continue to reference
        archived prompts so your message history stays intact.

        - Archived prompts remain accessible for reporting and analysis.
      parameters:
        - schema:
            type: string
            format: uuid
            description: The prompt ID to archive
          required: true
          description: The prompt ID to archive
          name: id
          in: path
      responses:
        '200':
          description: Prompt archived successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletePromptResponse'
              example:
                promptId: 123e4567-e89b-12d3-a456-426614174000
                archivedAt: '2025-10-03T15:30:00Z'
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for DeletePrompt operations.
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for DeletePrompt operations.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Greenflash from 'greenflash';


            const client = new Greenflash({
              apiKey: process.env['GREENFLASH_API_KEY'], // This is the default and can be omitted
            });


            const deletePromptResponse = await
            client.prompts.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(deletePromptResponse.archivedAt);
        - lang: Python
          source: |-
            import os
            from greenflash import Greenflash

            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )
            delete_prompt_response = client.prompts.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(delete_prompt_response.archived_at)
components:
  schemas:
    DeletePromptResponse:
      type: object
      properties:
        promptId:
          type: string
          format: uuid
          description: The archived prompt ID.
        externalPromptId:
          type: string
          description: The external prompt ID.
        archivedAt:
          type: string
          description: ISO 8601 timestamp when archived.
      required:
        - promptId
        - archivedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````