{
  "opencollection": "1.0.0",
  "info": {
    "name": "Prisma Optimize API",
    "version": "1.0.0"
  },
  "request": {
    "auth": {
      "type": "apikey",
      "key": "Authorization",
      "value": "{{Authorization}}",
      "placement": "header"
    }
  },
  "items": [
    {
      "info": {
        "name": "Sessions",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Prisma List recording sessions",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions",
            "params": [
              {
                "name": "status",
                "value": "",
                "type": "query",
                "description": "Filter sessions by status"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "Maximum number of sessions to return"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "Number of sessions to skip for pagination"
              }
            ]
          },
          "docs": "Retrieves a list of all recording sessions for the current environment, including their status, duration, and query counts."
        },
        {
          "info": {
            "name": "Prisma Create a recording session",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://optimize.prisma-data.net/sessions",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Creates a new query recording session. The Optimize extension captures all Prisma Client queries executed during an active session and sends them to the Optimize service for analysis. Sessions are intended for use in local development environments only."
        },
        {
          "info": {
            "name": "Prisma Get a recording session",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              }
            ]
          },
          "docs": "Retrieves detailed information about a specific recording session including query statistics and analysis status."
        },
        {
          "info": {
            "name": "Prisma Stop a recording session",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              }
            ]
          },
          "docs": "Stops an active recording session and finalizes the captured query data for analysis. Once stopped, no new queries will be captured for this session."
        }
      ]
    },
    {
      "info": {
        "name": "Queries",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Prisma List queries from a session",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId/queries",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              },
              {
                "name": "orderBy",
                "value": "",
                "type": "query",
                "description": "Sort queries by the specified field"
              },
              {
                "name": "order",
                "value": "",
                "type": "query",
                "description": "Sort direction"
              }
            ]
          },
          "docs": "Retrieves all queries captured during a specific recording session. Queries include the operation type, execution time, affected model, and generated SQL."
        },
        {
          "info": {
            "name": "Prisma Get query details",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId/queries/:queryId",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              },
              {
                "name": "queryId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recorded query"
              }
            ]
          },
          "docs": "Retrieves detailed information about a specific recorded query including the full SQL, execution plan, and performance metrics."
        },
        {
          "info": {
            "name": "Prisma Ingest query execution data",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://optimize.prisma-data.net/ingest",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Receives query execution data from the Prisma Optimize extension running in development. This endpoint is called automatically by the extension and is not typically invoked directly."
        }
      ]
    },
    {
      "info": {
        "name": "Recommendations",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Prisma List optimization recommendations",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId/recommendations",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              },
              {
                "name": "severity",
                "value": "",
                "type": "query",
                "description": "Filter recommendations by severity level"
              }
            ]
          },
          "docs": "Retrieves AI-powered optimization recommendations for queries captured in the session. Recommendations include suggestions for adding indexes, restructuring queries, implementing caching strategies, and using Prisma features like select and include more efficiently."
        }
      ]
    },
    {
      "info": {
        "name": "Metrics",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Prisma Get session performance metrics",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://optimize.prisma-data.net/sessions/:sessionId/metrics",
            "params": [
              {
                "name": "sessionId",
                "value": "",
                "type": "path",
                "description": "Unique identifier of the recording session"
              }
            ]
          },
          "docs": "Retrieves aggregated performance metrics for all queries in a session including total execution time, average query duration, slowest queries, and query type distribution."
        }
      ]
    }
  ],
  "bundled": true
}