Link Search Menu Expand Document

GET /api/organization/pads (index)

This endpoint is similar to GET /api/pads (index), except that it returns all the pads in your organization. To access this endpoint, your user must be an organization owner, or your organization must allow all pads to be visible to its users. This last setting is default on, but you can email us to disable this feature.

The endpoint also performs sorting and pagination identically to GET /api/pads (index).

curl \
  -H 'Authorization: Token token="<%= api_key %>"' \
  "https://coderpad.io/api/organization/pads?sort=updated_at,desc"

returns

{
  "status": "OK",
  "pads": [
    {
      "id": "PP7J474P",
      "title": "JavaScript Test",
      "owner_email": "kristin@coderpad.io",
      "language": "javascript",
      "participants": ["Kristin", "Guest 104"],
      "contents": "var _ = require('underscore');\n...",
      "private": false,
      "execution_enabled": true,
      "events": [
        {
          "message": "2018-02-13T02:06:32Z: Kristin joined the pad",
          "kind": "joined",
          "metadata": null,
          "user_name": "Kristin",
          "user_email": "kristin@coderpad.io",
          "created_at": "2018-02-13T02:06:32Z"
        },
        {
          "message": "2018-02-13T18:57:47Z: Kristin ran javascript code",
          "kind": "ran",
          "metadata": "javascript",
          "user_name": "Kristin",
          "user_email": "kristin@coderpad.io",
          "created_at": "2018-02-13T18:57:47Z"
        }
      ],
      "notes": "Brenda did a fantastic job talking through the prompt ...",
      "created_at": "2018-02-13T02:06:30Z",
      "updated_at": "2018-02-13T06:21:26Z",
      "ended_at": null,
      "url": "https://coderpad.io/PP7J474P",
      "playback": "https://coderpad.io/PP7J474P/playback",
      "history": "https://coderpadproject.firebaseio.com/PP7J474P/history.json"
    }
    // ... followed by a list of the rest of the pads in the organization
  ],
  "next_page": "https://coderpad.io/api/organization/pads?sort=updated_at,desc&page=2",
  "total": 512
}