{
  "info": {
    "name": "RiotPix API (draft)",
    "description": "Local review preview, not production availability. New features are disabled by default. Uses the existing creator session and CSRF protection; no API keys or grants. Set credentials only in your local cookie jar/session. Upload the exact byte length declared in the ticket. PUBLIC_FREE publication waits for administrator approval. Never export real cookies, tokens or signed upload URLs.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:8080"
    },
    {
      "key": "csrfToken",
      "value": ""
    },
    {
      "key": "idempotencyKey",
      "value": "REPLACE-with-8-to-64-chars"
    },
    {
      "key": "videoId",
      "value": "0"
    },
    {
      "key": "uploadKey",
      "value": "REPLACE_WITH_KEY_FROM_UPLOAD_TICKET"
    },
    {
      "key": "uploadUrl",
      "value": "REPLACE_WITH_UPLOAD_URL_FROM_TICKET"
    },
    {
      "key": "creatorHandle",
      "value": "example-handle"
    }
  ],
  "item": [
    {
      "name": "Rentals",
      "item": [
        {
          "name": "Title lookup (source verified; live status unverified)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/lookup/title?name=The Matrix&year=1999",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "lookup",
                "title"
              ],
              "query": [
                {
                  "key": "name",
                  "value": "The Matrix"
                },
                {
                  "key": "year",
                  "value": "1999"
                }
              ]
            }
          }
        },
        {
          "name": "Rental prices (off by default)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/rental-prices?name=The Matrix&year=1999",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "rental-prices"
              ],
              "query": [
                {
                  "key": "name",
                  "value": "The Matrix"
                },
                {
                  "key": "year",
                  "value": "1999"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Creators",
      "item": [
        {
          "name": "List creators (off by default)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/creators?page=0&size=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creators"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "0"
                },
                {
                  "key": "size",
                  "value": "20"
                }
              ]
            }
          }
        },
        {
          "name": "Creator detail (off by default)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/creators/{{creatorHandle}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creators",
                "{{creatorHandle}}"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Creator videos (signed-in session, off by default)",
      "item": [
        {
          "name": "List my videos",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos"
              ]
            }
          }
        },
        {
          "name": "Create draft",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotencyKey}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Creature Feature intro\",\n  \"description\": \"Opening bit\",\n  \"rightsConfirmed\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos"
              ]
            }
          }
        },
        {
          "name": "Get my video",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}"
              ]
            }
          }
        },
        {
          "name": "Upload ticket",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"filename\": \"intro.mp4\",\n  \"sizeBytes\": 52428800\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}/upload-ticket",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}",
                "upload-ticket"
              ]
            }
          }
        },
        {
          "name": "PUT file to storage (uploadUrl from the ticket)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "video/mp4"
              }
            ],
            "body": {
              "mode": "file",
              "file": {
                "src": ""
              }
            },
            "url": {
              "raw": "{{uploadUrl}}"
            },
            "description": "Short-lived signed URL. Do not send RiotPix cookies or the CSRF header here."
          }
        },
        {
          "name": "Upload complete",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"key\": \"{{uploadKey}}\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}/upload-complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}",
                "upload-complete"
              ]
            }
          }
        },
        {
          "name": "Request PUBLIC_FREE publication (202 pending admin review)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}",
                "publish"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mode\": \"PUBLIC_FREE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Remove my video",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}/remove",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}",
                "remove"
              ]
            }
          }
        },
        {
          "name": "Unpublish or withdraw my video",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-CSRF-TOKEN",
                "value": "{{csrfToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/creator/videos/{{videoId}}/unpublish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "creator",
                "videos",
                "{{videoId}}",
                "unpublish"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "RiotPix TV",
      "item": [
        {
          "name": "Programme guide (off by default)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/v1/public/tv?offset=0&limit=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "public",
                "tv"
              ],
              "query": [
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "limit",
                  "value": "20"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Live Events directory (disabled preview)",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/public/events?page=0&size=20",
        "description": "Approved allowlisted free public events only. Disabled by default. No private/paid content or stream URLs."
      }
    },
    {
      "name": "Public creator video (after approval only)",
      "item": [
        {
          "name": "Watch page",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/c/{{creatorHandle}}/videos/{{videoId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "c",
                "{{creatorHandle}}",
                "videos",
                "{{videoId}}"
              ]
            }
          }
        },
        {
          "name": "Video range",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Range",
                "value": "bytes=0-1023"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/c/{{creatorHandle}}/videos/{{videoId}}/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "c",
                "{{creatorHandle}}",
                "videos",
                "{{videoId}}",
                "content"
              ]
            }
          }
        }
      ]
    }
  ]
}
