.. _publish-review-request:

======================
Publish Review Request
======================

:Path: ``api/json/reviewrequests/{review_request_id}/publish/``


URL Parameters
==============

+-------------------+---------+-------------------------------------+
| Parameter         | Type    | Description                         |
+===================+=========+=====================================+
| review_request_id | Integer | The ID of the review request.       |
+-------------------+---------+-------------------------------------+


HTTP POST
=========

Publishes a review request.

This will publish the current draft of review request. If the review request
is new and currently private, it will be made public.

Depending on server settings, this may trigger external notifications, such
as an e-mail to all reviewers.


Example Request
---------------

.. code-block:: none

    POST /api/json/reviewrequests/12321/close/publish/


Responses
---------

HTTP 200: Success
~~~~~~~~~~~~~~~~~

On success, no payload data beyond the ``stat`` field will be sent.


Example Response
^^^^^^^^^^^^^^^^

.. code-block:: javascript

    {
      stat: "ok"
    }


HTTP 400: Bad Request
~~~~~~~~~~~~~~~~~~~~~

Error 211: Nothing to Publish
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The review request doesn't have any draft associated with it.


HTTP 401: Unauthorized
~~~~~~~~~~~~~~~~~~~~~~

Error 103: Not Logged In
^^^^^^^^^^^^^^^^^^^^^^^^

The client making the request is not logged in to the server.

See :ref:`authenticating` for more information.


HTTP 403: Forbidden
~~~~~~~~~~~~~~~~~~~

The user the client is logged in as doesn't have permission to delete
the review request.


HTTP 404: Not Found
~~~~~~~~~~~~~~~~~~~

Error 100: Does Not Exist
^^^^^^^^^^^^^^^^^^^^^^^^^

The review request with the given ``review_request_id`` does not exist on the
server.


.. comment: vim: ft=rst et ts=3
