{
    "info": {
        "name": "Publicasta Publishing v2",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
        "description": "Do not run the whole collection automatically. Create draft, upload page-bound media, save/verify batches, then explicitly submit expected languages. Set a fresh operation_key for NEW writes; keep the same key and body for retries. Publishing starts the configured moderation lifecycle."
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{api_key}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://publicasta.com"
        },
        {
            "key": "api_key",
            "value": ""
        },
        {
            "key": "channel_slug",
            "value": "demo_channel"
        },
        {
            "key": "article_slug",
            "value": "example_article"
        },
        {
            "key": "article_language",
            "value": "en"
        },
        {
            "key": "operation_key",
            "value": "replace-for-new-operation"
        },
        {
            "key": "image_path",
            "value": ""
        }
    ],
    "item": [
        {
            "name": "List channels",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels"
            }
        },
        {
            "name": "List article summaries",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages"
            }
        },
        {
            "name": "Create a draft",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:2"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"slug\": \"{{article_slug}}\",\n    \"default_language\": \"en\",\n    \"translations\": [\n        {\n            \"language\": \"en\",\n            \"title\": \"Example article\",\n            \"excerpt\": \"A separate summary.\",\n            \"content_markdown\": \"Introduction.\\n\\n## Section\\n\\nArticle text.\"\n        }\n    ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Read article status and progress",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}"
            }
        },
        {
            "name": "List translation metadata",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/translations"
            }
        },
        {
            "name": "Save a draft batch",
            "request": {
                "method": "PUT",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:5"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/translations",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"translations\": [\n        {\n            \"language\": \"en\",\n            \"title\": \"Example article\",\n            \"excerpt\": \"A separate summary.\",\n            \"content_markdown\": \"Introduction.\\n\\n## Section\\n\\nArticle text.\"\n        }\n    ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Read one translation",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/translations/{{article_language}}"
            }
        },
        {
            "name": "Save one draft translation",
            "request": {
                "method": "PUT",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:7"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/translations/{{article_language}}",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"language\": \"en\",\n    \"title\": \"Example article\",\n    \"excerpt\": \"A separate summary.\",\n    \"content_markdown\": \"Introduction.\\n\\n## Section\\n\\nArticle text.\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Submit the complete article for review",
            "request": {
                "method": "PATCH",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:8"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/status",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"status\": \"published\",\n    \"expected_languages\": [\n        \"en\"\n    ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Pause or resume bulk review",
            "request": {
                "method": "PATCH",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:9"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/review",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"paused\": true\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Update article settings",
            "request": {
                "method": "PATCH",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:10"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/pages/{{article_slug}}/settings",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"toc_enabled\": true\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Upload page-bound article media",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{operation_key}}:11"
                    }
                ],
                "url": "{{base_url}}/api/v2/channels/{{channel_slug}}/media",
                "body": {
                    "mode": "formdata",
                    "formdata": [
                        {
                            "key": "image",
                            "type": "file",
                            "src": "{{image_path}}"
                        },
                        {
                            "key": "page_slug",
                            "type": "text",
                            "value": "{{article_slug}}"
                        }
                    ]
                }
            }
        }
    ]
}