Add a code playground


Configure code playgrounds for the organization.

Changes: New in Zulip 4.0 (feature level 49). A parameter encoding bug was fixed in Zulip 4.0 (feature level 57).

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Add a realm playground for Python
request = {
    "name": "Python playground",
    "pygments_language": "Python",
    "url_prefix": "",
result = client.call_endpoint(url="/realm/playgrounds", method="POST", request=request)

curl -sSX POST \
    --data-urlencode 'name=Python playground' \
    --data-urlencode pygments_language=Python \
    --data-urlencode url_prefix=


name string required

Example: "Python playground"

The user-visible display name of the playground which can be used to pick the target playground, especially when multiple playground options exist for that programming language.

pygments_language string required

Example: "Python"

The name of the Pygments language lexer for that programming language.

url_prefix string required

Example: ""

The url prefix for the playground.


Return values

  • id: integer

    The numeric ID assigned to this playground.

Example response(s)

A typical successful JSON response may look like:

    "id": 1,
    "msg": "",
    "result": "success"