Stoplight Elements

App · Utilities · 8 actions

Work with API documentation built on Stoplight Elements, Stoplight's open-source toolkit for interactive API docs. Read any public Stoplight project the way Elements Dev Portal does: its versions, every page in its sidebar, one article, API, endpoint or model in full, and a search of everything it says. Save an API's OpenAPI document as a file, and call its hosted mock server to see what the API would answer. Build standalone pages with Elements - an API reference from any OpenAPI document, or a whole developer portal from a Stoplight project - to host anywhere. No account or API key required.

Actions

ActionWhat it does
Call a mock serverSend a request to an endpoint's hosted mock server - Stoplight's Prism, answering from the API's own docs - and get back what the API would answer: the status, headers and body, before the API itself exists or without touching it.
Create a developer portal pageBuild a standalone web page that renders a whole public Stoplight project with Elements Dev Portal - its articles and guides, every API, endpoint and model, the version picker, Try It and the hosted mock servers - ready to upload to any static host or embed in a site.
Create an API reference pageBuild a standalone web page that renders an OpenAPI document as Stoplight Elements' interactive API reference - a sidebar of endpoints and models, request samples and a Try It console - ready to upload to any static host, attach to an email or publish from a later step.
Get a pageRead one page of a public Stoplight project's docs, as Elements Dev Portal shows it: an article's Markdown; an API's version, servers and security; an endpoint's method and path, parameters, request body and every response with its schema and examples; or a model's JSON Schema.
Get a Stoplight projectLook up a public Stoplight project - the thing Elements Dev Portal renders - by its ID, its workspace and name, or the address of its docs, and get back its name, its workspace, the address of its hosted docs, its ID for the steps after, and every version of its docs with the default one marked.
List a project's pagesList the pages of a public Stoplight project's docs - its articles, APIs, endpoints, webhooks and models - in the order its sidebar shows them, with the divider and folders each is filed under, the API it belongs to, each endpoint's method, and its address in the docs.
Save an API's document as a fileSave an API's OpenAPI document - or a model's JSON Schema - from a public Stoplight project as a file, the way the docs' Export button does: bundled, with every reference to another file copied in so it stands alone, or the original file as it is.
Search a project's docsSearch everything a public Stoplight project's docs say - titles, summaries and text - the way Elements Dev Portal's search box does, and get back the matching pages with the passage that matched and each page's address.

Call a mock server

Send a request to an endpoint's hosted mock server - Stoplight's Prism, answering from the API's own docs - and get back what the API would answer: the status, headers and body, before the API itself exists or without touching it. Fills in whatever the step leaves out from the endpoint's examples, and a stand-in credential where one is needed, which the result lists. Ask for a documented status code, a named example or freshly generated data, as Try It's mocking menu does. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
EndpointendpointtextRequired
The endpoint's page: its slug, such as 'b3A6Mzg5NDM1-list-todos', its ID, or its address in the docs. List them with 'List a project's pages' and Kind of page set to Endpoint.
Branchbranchtext
Optional. The version of the docs to read, by its branch's slug, such as 'v2'. The project's default branch when blank.
Path parameterspath_paramsobject
Optional. Values for the parameters in the endpoint's path, by name, such as todoId. Each one left out is given the docs' example.
Query valuesqueryobject
Optional. Values to add to the end of the address, by name. A required one left out is given the docs' example.
Headersheadersobject
Optional. Headers to send, by name - a credential of your own, for one. Any value will do for a mock.
Bodybodyobject
Optional. The request body, as field names and values. The docs' example of it when left out, or a small one its schema accepts.
Answer with statusresponse_codetext
Optional. The documented response to answer with, by its status code, such as 404. The endpoint's lowest success code by default, as the mock server picks.
Exampleexampletext
Optional. The documented example to answer with, by its name, such as 'List of Todos'. Chain it from 'example_names' in 'Get a page'.
Generate datadynamictrue/false
Optional. Answer with fresh random data that fits the schema, rather than the docs' examples. A named example still wins.Default: false.

Outputs

bodyobject
The answer's body: its JSON, parsed - an object or a list - or its text.
content_typetext
The answer's media type.
credentials_addedlist
The stand-in credentials sent because the endpoint needs one and the step set none. Empty otherwise.
endpointtext
The slug of the endpoint's page.
headersobject
The answer's headers, with names in lower case.
methodtext
The HTTP method the request was sent with.
mock_server_urltext
The mock server's address.
oktrue/false
True for a 2xx answer.
pathtext
The path it was sent to, with its parameters filled in.
prefertext
The Prefer header sent to choose the answer, e.g. 'code=404'. Null when none was.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
request_bodyobject
The body that was sent. Null when none was.
statusnumber
The status code the mock answered with.
titletext
The endpoint's title.
urltext
The full address it was sent to.
violationslist
What the mock found wrong with the request or its own answer, measured against the docs, when it answered anyway.
Example output
{
  "body": {
    "completed": true,
    "completed_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "id": 0,
    "name": "string",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "content_type": "application/json",
  "credentials_added": [],
  "endpoint": "b3A6Mzg5NDM4-get-todo",
  "headers": {
    "content-type": "application/json"
  },
  "method": "GET",
  "mock_server_url": "https://stoplight.io/mocks/elements-examples/studio-demo/389434",
  "ok": true,
  "path": "/todos/1",
  "prefer": null,
  "project_id": "cHJqOjYwNjYx",
  "request_body": null,
  "status": 200,
  "title": "Get Todo",
  "url": "https://stoplight.io/mocks/elements-examples/studio-demo/389434/todos/1",
  "violations": []
}

Create a developer portal page

Build a standalone web page that renders a whole public Stoplight project with Elements Dev Portal - its articles and guides, every API, endpoint and model, the version picker, Try It and the hosted mock servers - ready to upload to any static host or embed in a site. The page reads the project live from Stoplight each time it is opened, so it stays current. Stoplight lets anyone use the Dev Portal while developing on their own machine; serving it from a live site needs the project's workspace on a paid Stoplight plan. No account or API key required to build it.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
Page titletitletext
Optional. The title in the browser tab. The project's name by default.
Collapse the contentscollapse_table_of_contentstrue/false
Optional. Start with the sidebar's folders closed, for a project with many pages.Default: false.
Hide Try Ithide_try_ittrue/false
Optional. Leave out the Try It console that sends requests from the docs, for docs that should only be read.Default: false.
Hide mockinghide_mockingtrue/false
Optional. Leave out the mock servers and every mention of them.Default: false.
Hide the Export buttonhide_exporttrue/false
Optional. Leave out the button that downloads the API's document.Default: false.
Hide server addresseshide_server_infotrue/false
Optional. Leave out the list of servers the API is called on.Default: false.
Hide securityhide_security_infotrue/false
Optional. Leave out how the API is authenticated.Default: false.
Try It CORS proxytry_it_cors_proxytext
Optional. The address of a CORS proxy to send Try It requests through, for APIs that do not let a browser call them from another site. It is put in front of each request's address.
Return asoutputtext
An HTML file, the default, or the page's HTML as text in the result.One of: file (An HTML file), text (Text in the result). Default: file.
File namefilenametext
Optional. The name to save the file under. Made from the page title by default, e.g. 'to-dos.html'.

Outputs

attributesobject
The options written on the web component, by the attribute name Elements reads, e.g. {'router': 'hash', 'hideTryIt': 'true'}. A document written into the page is left out.
content_typetext
The saved file's media type.
docs_urltext
The address of the same project's docs on Stoplight.
document_reftext
The saved file's reference, to attach it to an email, upload it or store it in a later step. Null when nothing was saved.
documentslist
The saved file, as a one-item list.
download_urltext
Where Lodol serves the saved file.
filenametext
The name the file was saved under.
htmltext
The page's HTML, when it was asked for as text. Null when it was saved as a file.
outputtext
How the page came back: 'file' or 'text'.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
project_nametext
The project's name.
size_bytesnumber
The page's size in bytes.
titletext
The page's title.
Example output
{
  "attributes": {
    "projectId": "cHJqOjYwNjYx",
    "router": "hash"
  },
  "content_type": "text/html",
  "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo",
  "document_ref": "doc_stoplight_elements_studio_demo_html",
  "documents": [
    {
      "content_type": "text/html",
      "document_ref": "doc_stoplight_elements_studio_demo_html",
      "filename": "studio-demo.html",
      "size_bytes": 696,
      "url": "/actions/core/serve-document/doc_stoplight_elements_studio_demo_html?teamId=65f0c0ffee0000000000c0de"
    }
  ],
  "download_url": "/actions/core/serve-document/doc_stoplight_elements_studio_demo_html?teamId=65f0c0ffee0000000000c0de",
  "filename": "studio-demo.html",
  "html": null,
  "output": "file",
  "project_id": "cHJqOjYwNjYx",
  "project_name": "Studio Demo",
  "size_bytes": 696,
  "title": "Studio Demo"
}

Create an API reference page

Build a standalone web page that renders an OpenAPI document as Stoplight Elements' interactive API reference - a sidebar of endpoints and models, request samples and a Try It console - ready to upload to any static host, attach to an email or publish from a later step. Pick the layout, a title and a logo, and which parts to leave out. A document given by address is loaded fresh each time the page is opened; one given as a file or text is written into the page. Nothing is sent anywhere to build it. No account or API key required.

Inputs

API documentdocumenttextRequired
The OpenAPI 3 or Swagger 2.0 document, in JSON or YAML: upload the file, paste its text, use a file or document from an earlier step, or give its public address, which browsers must be allowed to fetch (GitHub's raw addresses are).
Page titletitletext
Optional. The title in the browser tab. The API's own title for a document given as a file or text, otherwise 'API Reference'.
Layoutlayouttext
Sidebar, the default, with the contents on the left; Responsive, which folds the sidebar away on small screens; or Stacked, one column, for a page with a sidebar of its own.One of: sidebar, responsive, stacked. Default: sidebar.
Logologotext
Optional. The address of a square image to show beside the API's title, above the contents.
Hide Try Ithide_try_ittrue/false
Optional. Leave out the Try It console that sends requests from the docs, for docs that should only be read.Default: false.
Hide the Try It panelhide_try_it_paneltrue/false
Optional. Leave out the Try It panel but keep the request samples.Default: false.
Hide request sampleshide_samplestrue/false
Optional. Leave out the code samples for each request.Default: false.
Hide modelshide_schemastrue/false
Optional. Leave the models out of the sidebar.Default: false.
Hide internalhide_internaltrue/false
Optional. Leave out the endpoints and models the document marks x-internal.Default: false.
Hide the Export buttonhide_exporttrue/false
Optional. Leave out the button that downloads the API's document.Default: false.
Hide server addresseshide_server_infotrue/false
Optional. Leave out the list of servers the API is called on.Default: false.
Hide securityhide_security_infotrue/false
Optional. Leave out how the API is authenticated.Default: false.
Try It CORS proxytry_it_cors_proxytext
Optional. The address of a CORS proxy to send Try It requests through, for APIs that do not let a browser call them from another site. It is put in front of each request's address.
Return asoutputtext
An HTML file, the default, or the page's HTML as text in the result.One of: file (An HTML file), text (Text in the result). Default: file.
File namefilenametext
Optional. The name to save the file under. Made from the page title by default, e.g. 'to-dos.html'.

Outputs

attributesobject
The options written on the web component, by the attribute name Elements reads, e.g. {'router': 'hash', 'hideTryIt': 'true'}. A document written into the page is left out.
content_typetext
The saved file's media type.
document_reftext
The saved file's reference, to attach it to an email, upload it or store it in a later step. Null when nothing was saved.
document_urltext
The address the page loads the document from. Null when the document is written into the page.
documentslist
The saved file, as a one-item list.
download_urltext
Where Lodol serves the saved file.
embeddedtrue/false
True when the document is written into the page, so the page works on its own.
filenametext
The name the file was saved under.
htmltext
The page's HTML, when it was asked for as text. Null when it was saved as a file.
layouttext
Its layout: 'sidebar', 'responsive' or 'stacked'.
outputtext
How the page came back: 'file' or 'text'.
size_bytesnumber
The page's size in bytes.
titletext
The page's title.
Example output
{
  "attributes": {
    "hideTryIt": "true",
    "layout": "sidebar",
    "router": "hash"
  },
  "content_type": "text/html",
  "document_ref": "doc_stoplight_elements_to_dos_html",
  "document_url": null,
  "documents": [
    {
      "content_type": "text/html",
      "document_ref": "doc_stoplight_elements_to_dos_html",
      "filename": "to-dos.html",
      "size_bytes": 13673,
      "url": "/actions/core/serve-document/doc_stoplight_elements_to_dos_html?teamId=65f0c0ffee0000000000c0de"
    }
  ],
  "download_url": "/actions/core/serve-document/doc_stoplight_elements_to_dos_html?teamId=65f0c0ffee0000000000c0de",
  "embedded": true,
  "filename": "to-dos.html",
  "html": null,
  "layout": "sidebar",
  "output": "file",
  "size_bytes": 13673,
  "title": "To-dos"
}

Get a page

Read one page of a public Stoplight project's docs, as Elements Dev Portal shows it: an article's Markdown; an API's version, servers and security; an endpoint's method and path, parameters, request body and every response with its schema and examples; or a model's JSON Schema. Comes with the pages it links to, its mock server's address and its Export links. Name it by its slug, its ID or its address in the docs. The detail to hand an AI step writing a client, a test or a summary. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
PagepagetextRequired
The page: its slug, such as 'b3A6Mzg5NDM2-create-todo', its ID, or its address in the docs. Chain it from 'page_slugs' in 'List a project's pages'.
Branchbranchtext
Optional. The version of the docs to read, by its branch's slug, such as 'v2'. The project's default branch when blank.

Outputs

branchtext
The branch it was read from.
dataobject
The page's content exactly as Stoplight stores it: an API, endpoint or model in the form Elements renders. Null for an article, whose text is in 'markdown'.
descriptiontext
An API's, endpoint's or model's description, often Markdown. Null for an article.
docs_urltext
Where the project's hosted docs show it.
export_bundled_urltext
Where it downloads the same file with its references to other files bundled in.
export_urltext
Where the Export button downloads an API's or a model's file as it is. Null for other pages.
idtext
The page's ID, the start of its slug.
markdowntext
An article's text, in Markdown. Null for other pages.
methodtext
An endpoint's or webhook's HTTP method, e.g. 'POST'. Null for other pages.
mock_server_urltext
The address of the API's hosted mock server, for an API or an endpoint. Null when it has none.
parameterslist
An endpoint's path, query, header and cookie parameters.
pathtext
An endpoint's path, with its parameters in braces, or a webhook's name. Null for other pages.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
relatedlist
The pages it links to, such as the API an endpoint belongs to and the models it uses.
request_bodyobject
What an endpoint takes in its body. Null when it takes nothing.
responseslist
Every response an endpoint documents, in order.
schemaobject
A model's JSON Schema. Null for other pages.
securitylist
The names of the ways it is authenticated, e.g. 'API Key'. Empty when it needs no credentials.
serverslist
The addresses an API or endpoint is called on.
slugtext
The page's slug: its ID and its title, as the docs' address ends - chain it into 'Get a page'.
summarytext
Its summary, on one line or a few.
titletext
The page's title, as the sidebar shows it.
typetext
What kind of page it is: 'article', 'http_service' (an API), 'http_operation' (an endpoint), 'http_webhook' or 'model'.
type_labeltext
The kind of page as the docs call it: 'Article', 'API', 'Endpoint', 'Webhook' or 'Model'.
uritext
The file it comes from in the project, and where in it, e.g. '/reference/todos.yaml/paths/~1todos/post'.
versiontext
An API's version. Null for other pages.
Example output
{
  "branch": "master",
  "data": {
    "description": "This creates a Todo object\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
    "extensions": {},
    "id": "3fb12610e1ab0",
    "iid": "post-todos",
    "method": "post",
    "path": "/todos",
    "request": {
      "body": {
        "contents": [
          {
            "encodings": [],
            "examples": [],
            "id": "770b4257ecc56",
            "mediaType": "application/json",
            "schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "description": "I'm a model's description.",
              "properties": {
                "completed": {
                  "default": false,
                  "description": "Boolean indicating if the task has been completed or not",
                  "type": "boolean"
                },
                "completed_at": {
                  "description": "Time when the task was completed",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                },
                "created_at": {
                  "description": "Time when the task was created",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                },
                "id": {
                  "description": "ID of the task",
                  "maximum": 9999,
                  "minimum": 0,
                  "readOnly": true,
                  "type": "number"
                },
                "name": {
                  "description": "Name of the task",
                  "maxLength": 100,
                  "minLength": 1,
                  "type": "string"
                },
                "updated_at": {
                  "description": "Time when the task was updated",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "completed_at",
                "created_at",
                "updated_at"
              ],
              "title": "Todo",
              "type": "object",
              "x-examples": {},
              "x-stoplight": {
                "id": "246e949b07b91"
              }
            }
          }
        ],
        "description": "Name of the Todo",
        "id": "53501f245b1c7"
      },
      "cookie": [],
      "headers": [
        {
          "description": "application/json",
          "examples": [],
          "explicitProperties": [
            "name",
            "in",
            "required",
            "schema",
            "description"
          ],
          "id": "a17bd1f8180e1",
          "name": "Content-Type",
          "required": true,
          "schema": {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "default": "application/json",
            "type": "string",
            "x-stoplight": {
              "id": "0f3e124740ff1"
            }
          },
          "style": "simple"
        }
      ],
      "path": [],
      "query": []
    },
    "responses": [
      {
        "code": "201",
        "contents": [
          {
            "encodings": [],
            "examples": [
              {
                "id": "d1da513e845f2",
                "key": "Example Todo",
                "value": {
                  "completed": true,
                  "completed_at": "2019-08-24T14:15:22Z",
                  "created_at": "2019-08-24T14:15:22Z",
                  "id": 0,
                  "name": "string",
                  "updated_at": "2019-08-24T14:15:22Z"
                }
              }
            ],
            "id": "739ee9894633b",
            "mediaType": "multipart/form-data",
            "schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "description": "I'm a model's description.",
              "properties": {
                "completed": {
                  "default": false,
                  "description": "Boolean indicating if the task has been completed or not",
                  "type": "boolean"
                },
                "completed_at": {
                  "description": "Time when the task was completed",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                },
                "created_at": {
                  "description": "Time when the task was created",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                },
                "id": {
                  "description": "ID of the task",
                  "maximum": 9999,
                  "minimum": 0,
                  "readOnly": true,
                  "type": "number"
                },
                "name": {
                  "description": "Name of the task",
                  "maxLength": 100,
                  "minLength": 1,
                  "type": "string"
                },
                "updated_at": {
                  "description": "Time when the task was updated",
                  "format": "date-time",
                  "readOnly": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "completed_at",
                "created_at",
                "updated_at"
              ],
              "title": "Todo",
              "type": "object",
              "x-examples": {},
              "x-stoplight": {
                "id": "246e949b07b91"
              }
            }
          }
        ],
        "description": "New Todo Created",
        "headers": [],
        "id": "b1bc2d941bf4d"
      },
      {
        "code": "403",
        "contents": [
          {
            "encodings": [],
            "examples": [],
            "id": "2ca41b032e737",
            "mediaType": "application/json",
            "schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "type": "object",
              "x-stoplight": {
                "id": "4d837350d9677"
              }
            }
          }
        ],
        "description": "Action not allowed",
        "headers": [],
        "id": "2b4baae352bdb"
      },
      {
        "code": "404",
        "contents": [
          {
            "encodings": [],
            "examples": [],
            "id": "e687356a30b3f",
            "mediaType": "application/json",
            "schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "description": "A standard error object.",
              "properties": {
                "error": {
                  "type": "string"
                },
                "status": {
                  "description": "A code.",
                  "type": "string"
                }
              },
              "required": [
                "status",
                "error"
              ],
              "title": "Error",
              "type": "object",
              "x-stoplight": {
                "id": "b4ff2c170dab2"
              },
              "x-tags": [
                "Common"
              ]
            }
          }
        ],
        "description": "Resource not found",
        "headers": [],
        "id": "e1ec81895f49e"
      }
    ],
    "security": [
      [
        {
          "description": "Just use `123`. It's super secure ;)",
          "extensions": {},
          "id": "de1755561948a",
          "in": "query",
          "key": "API Key",
          "name": "apikey",
          "type": "apiKey"
        }
      ]
    ],
    "securityDeclarationType": "declared",
    "servers": [
      {
        "description": "Production",
        "id": "a43be97b14e11",
        "name": "To-dos",
        "url": "https://todos.stoplight.io"
      },
      {
        "description": "Sandbox",
        "id": "18b5b15918af5",
        "name": "To-dos",
        "url": "https://todos-sandbox.stoplight.io"
      }
    ],
    "summary": "Create Todo",
    "tags": []
  },
  "description": "This creates a Todo object\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
  "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM2-create-todo",
  "export_bundled_url": null,
  "export_url": null,
  "id": "b3A6Mzg5NDM2",
  "markdown": null,
  "method": "POST",
  "mock_server_url": "https://stoplight.io/mocks/elements-examples/studio-demo/389434",
  "parameters": [
    {
      "description": "application/json",
      "example": "application/json",
      "in": "header",
      "name": "Content-Type",
      "required": true,
      "type": "string"
    }
  ],
  "path": "/todos",
  "project_id": "cHJqOjYwNjYx",
  "related": [],
  "request_body": {
    "content_types": [
      "application/json"
    ],
    "description": "Name of the Todo",
    "example": null,
    "required": false,
    "schema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "description": "I'm a model's description.",
      "properties": {
        "completed": {
          "default": false,
          "description": "Boolean indicating if the task has been completed or not",
          "type": "boolean"
        },
        "completed_at": {
          "description": "Time when the task was completed",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "created_at": {
          "description": "Time when the task was created",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "id": {
          "description": "ID of the task",
          "maximum": 9999,
          "minimum": 0,
          "readOnly": true,
          "type": "number"
        },
        "name": {
          "description": "Name of the task",
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        },
        "updated_at": {
          "description": "Time when the task was updated",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "completed_at",
        "created_at",
        "updated_at"
      ],
      "title": "Todo",
      "type": "object",
      "x-examples": {},
      "x-stoplight": {
        "id": "246e949b07b91"
      }
    }
  },
  "responses": [
    {
      "content_types": [
        "multipart/form-data"
      ],
      "description": "New Todo Created",
      "example_names": [
        "Example Todo"
      ],
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "I'm a model's description.",
        "properties": {
          "completed": {
            "default": false,
            "description": "Boolean indicating if the task has been completed or not",
            "type": "boolean"
          },
          "completed_at": {
            "description": "Time when the task was completed",
            "format": "date-time",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "description": "Time when the task was created",
            "format": "date-time",
            "readOnly": true,
            "type": "string"
          },
          "id": {
            "description": "ID of the task",
            "maximum": 9999,
            "minimum": 0,
            "readOnly": true,
            "type": "number"
          },
          "name": {
            "description": "Name of the task",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "updated_at": {
            "description": "Time when the task was updated",
            "format": "date-time",
            "readOnly": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "completed_at",
          "created_at",
          "updated_at"
        ],
        "title": "Todo",
        "type": "object",
        "x-examples": {},
        "x-stoplight": {
          "id": "246e949b07b91"
        }
      },
      "status": "201"
    },
    {
      "content_types": [
        "application/json"
      ],
      "description": "Action not allowed",
      "example_names": [],
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object",
        "x-stoplight": {
          "id": "4d837350d9677"
        }
      },
      "status": "403"
    },
    {
      "content_types": [
        "application/json"
      ],
      "description": "Resource not found",
      "example_names": [],
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "A standard error object.",
        "properties": {
          "error": {
            "type": "string"
          },
          "status": {
            "description": "A code.",
            "type": "string"
          }
        },
        "required": [
          "status",
          "error"
        ],
        "title": "Error",
        "type": "object",
        "x-stoplight": {
          "id": "b4ff2c170dab2"
        },
        "x-tags": [
          "Common"
        ]
      },
      "status": "404"
    }
  ],
  "schema": null,
  "security": [
    "API Key"
  ],
  "servers": [
    "https://todos.stoplight.io",
    "https://todos-sandbox.stoplight.io"
  ],
  "slug": "b3A6Mzg5NDM2-create-todo",
  "summary": "This creates a Todo object\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
  "title": "Create Todo",
  "type": "http_operation",
  "type_label": "Endpoint",
  "uri": "/reference/todos/todo.v1.yaml/paths/~1todos/post",
  "version": null
}

Get a Stoplight project

Look up a public Stoplight project - the thing Elements Dev Portal renders - by its ID, its workspace and name, or the address of its docs, and get back its name, its workspace, the address of its hosted docs, its ID for the steps after, and every version of its docs with the default one marked. The step to start from. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.

Outputs

branch_countnumber
How many branches it has.
branch_slugslist
Each branch's slug, to loop over.
brancheslist
Every branch - each a version of the docs.
default_branchtext
The branch its docs show unless another is asked for.
docs_urltext
The address of the project's hosted docs.
handletext
The project as workspace/project, e.g. 'elements-examples/studio-demo' - another way to name it.
nametext
The project's name.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
slugtext
The project's slug, as its docs' address has it.
workspace_idtext
The ID of the workspace it belongs to.
workspace_nametext
The workspace's name.
workspace_slugtext
The workspace's slug, the start of its docs' address on stoplight.io.
Example output
{
  "branch_count": 1,
  "branch_slugs": [
    "master"
  ],
  "branches": [
    {
      "is_default": true,
      "is_published": true,
      "name": "master",
      "slug": "master"
    }
  ],
  "default_branch": "master",
  "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo",
  "handle": "elements-examples/studio-demo",
  "name": "Studio Demo",
  "project_id": "cHJqOjYwNjYx",
  "slug": "studio-demo",
  "workspace_id": "d2s6NDE1NTU",
  "workspace_name": "elements-examples",
  "workspace_slug": "elements-examples"
}

List a project's pages

List the pages of a public Stoplight project's docs - its articles, APIs, endpoints, webhooks and models - in the order its sidebar shows them, with the divider and folders each is filed under, the API it belongs to, each endpoint's method, and its address in the docs. Narrow it to one kind of page, one API or some text, on any branch. The way to find a page's slug, build an endpoint inventory, or loop over a project. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
Branchbranchtext
Optional. The version of the docs to read, by its branch's slug, such as 'v2'. The project's default branch when blank.
Kind of pagetypetext
Optional. Only pages of this kind.One of: article, http_service (API), http_operation (Endpoint), http_webhook (Webhook), model.
APIapitext
Optional. Only the endpoints, webhooks and models of this API, by its title, such as 'To-dos', or its slug. An API the project does not have is an error that names the ones it does.
Text to look forsearchtext
Optional. Only pages whose title or method contains this text. Case does not matter. To search what the pages say, use 'Search a project's docs'.
Limitlimitnumber
How many pages to return at most, from 1 to 500. 100 by default. The totals come back with them, so a cut-off is visible.From 1 to 500. Default: 100.

Outputs

branchtext
The branch that was read. Null when it was the project's default.
countnumber
How many pages were returned.
external_linkslist
Links out of the project that its sidebar shows.
firstobject
The first page returned, for the step that only wanted one. Null when none matched.
page_slugslist
The slug of each page returned, in order, to loop over.
pageslist
The pages, in the sidebar's order.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
project_nametext
The project's name.
totalnumber
How many pages the project has in all, before any filtering.
total_matchesnumber
How many pages matched in all, of which the ones returned are the first.
truncatedtrue/false
True when more matched than the limit allowed.
type_countsobject
How many pages of each kind the project has, e.g. {'article': 4, 'http_operation': 12}.
Example output
{
  "branch": null,
  "count": 2,
  "external_links": [],
  "first": {
    "api": "To-dos",
    "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM1-list-todos",
    "groups": [],
    "id": "b3A6Mzg5NDM1",
    "method": "GET",
    "section": "APIS",
    "slug": "b3A6Mzg5NDM1-list-todos",
    "title": "List Todos",
    "type": "http_operation"
  },
  "page_slugs": [
    "b3A6Mzg5NDM1-list-todos",
    "b3A6Mzg5NDM2-create-todo"
  ],
  "pages": [
    {
      "api": "To-dos",
      "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM1-list-todos",
      "groups": [],
      "id": "b3A6Mzg5NDM1",
      "method": "GET",
      "section": "APIS",
      "slug": "b3A6Mzg5NDM1-list-todos",
      "title": "List Todos",
      "type": "http_operation"
    },
    {
      "api": "To-dos",
      "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM2-create-todo",
      "groups": [],
      "id": "b3A6Mzg5NDM2",
      "method": "POST",
      "section": "APIS",
      "slug": "b3A6Mzg5NDM2-create-todo",
      "title": "Create Todo",
      "type": "http_operation"
    }
  ],
  "project_id": "cHJqOjYwNjYx",
  "project_name": "Studio Demo",
  "total": 24,
  "total_matches": 9,
  "truncated": true,
  "type_counts": {
    "article": 4,
    "http_operation": 12,
    "http_service": 2,
    "model": 6
  }
}

Save an API's document as a file

Save an API's OpenAPI document - or a model's JSON Schema - from a public Stoplight project as a file, the way the docs' Export button does: bundled, with every reference to another file copied in so it stands alone, or the original file as it is. A later step can commit it, attach it, feed it to a code generator or build an API reference page from it. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
API or modelapitextRequired
The API's page - or a model's - by its slug, such as 'YXBpOjM4OTQzNA-to-dos', its ID, or its address in the docs. List them with 'List a project's pages' and Kind of page set to API.
Branchbranchtext
Optional. The version of the docs to read, by its branch's slug, such as 'v2'. The project's default branch when blank.
Export asmodetext
Bundled, the default, copies in everything the file refers to in other files, so it stands alone; Original is the file as it is in the project.One of: bundled, original. Default: bundled.
File namefilenametext
Optional. The name to save the file under. The project's own file name by default, e.g. 'todo.v1.yaml'; a name without an extension gains the file's.

Outputs

apitext
The slug of the page that was exported.
content_typetext
The saved file's media type.
document_reftext
The saved file's reference, to attach it to an email, upload it or store it in a later step. Null when nothing was saved.
documentslist
The saved file, as a one-item list.
download_urltext
Where Lodol serves the saved file.
filenametext
The name the file was saved under.
formattext
The file's format: 'json' or 'yaml'.
modetext
How it was exported: 'bundled' or 'original'.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
size_bytesnumber
The file's size in bytes.
titletext
The API's or model's title.
typetext
What was exported: 'http_service' (an API) or 'model'.
urltext
The Export link it was downloaded from.
Example output
{
  "api": "YXBpOjM4OTQzNA-to-dos",
  "content_type": "application/yaml",
  "document_ref": "doc_stoplight_elements_todo_v1_yaml",
  "documents": [
    {
      "content_type": "application/yaml",
      "document_ref": "doc_stoplight_elements_todo_v1_yaml",
      "filename": "todo.v1.yaml",
      "size_bytes": 12135,
      "url": "/actions/core/serve-document/doc_stoplight_elements_todo_v1_yaml?teamId=65f0c0ffee0000000000c0de"
    }
  ],
  "download_url": "/actions/core/serve-document/doc_stoplight_elements_todo_v1_yaml?teamId=65f0c0ffee0000000000c0de",
  "filename": "todo.v1.yaml",
  "format": "yaml",
  "mode": "bundled",
  "project_id": "cHJqOjYwNjYx",
  "size_bytes": 12135,
  "title": "To-dos",
  "type": "http_service",
  "url": "https://stoplight.io/api/v1/projects/elements-examples/studio-demo/nodes/reference/todos/todo.v1.yaml?fromExportButton=true&snapshotType=http_service&deref=optimizedBundle"
}

Search a project's docs

Search everything a public Stoplight project's docs say - titles, summaries and text - the way Elements Dev Portal's search box does, and get back the matching pages with the passage that matched and each page's address. The way to find where the docs cover a topic, or to hand an AI step the right page. No account or API key required.

Inputs

ProjectprojecttextRequired
A public Stoplight project: its ID from the project's settings, such as 'cHJqOjYwNjYx' (Stoplight's Studio Demo); its workspace and project as 'elements-examples/studio-demo'; or the address of its docs, such as https://elements-examples.stoplight.io/docs/studio-demo, on stoplight.io or the docs' own domain.
Search forquerytextRequired
The words to look for, such as 'create todo'.
Branchbranchtext
Optional. The version of the docs to read, by its branch's slug, such as 'v2'. The project's default branch when blank.
Limitlimitnumber
How many results to return at most, from 1 to 100. 20 by default.From 1 to 100. Default: 20.

Outputs

branchtext
The branch that was read. Null when it was the project's default.
countnumber
How many results were returned.
firstobject
The best match. Null when nothing matched.
page_slugslist
The slug of each page returned, in order, to loop over.
project_idtext
The project's ID, as Elements Dev Portal takes it - chain it into the next step's Project field.
querytext
What was searched for.
resultslist
The matching pages, best match first.
totalnumber
How many pages Stoplight found.
truncatedtrue/false
True when more were found than the limit allowed.
Example output
{
  "branch": null,
  "count": 2,
  "first": {
    "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM2-create-todo",
    "id": "b3A6Mzg5NDM2",
    "project_name": "Studio Demo",
    "slug": "b3A6Mzg5NDM2-create-todo",
    "snippet": "This creates a Todo object *Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
    "summary": "This creates a Todo object\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
    "title": "Create Todo",
    "type": "http_operation"
  },
  "page_slugs": [
    "b3A6Mzg5NDM2-create-todo",
    "YXBpOjM4OTQzNA-to-dos"
  ],
  "project_id": "cHJqOjYwNjYx",
  "query": "create todo",
  "results": [
    {
      "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/b3A6Mzg5NDM2-create-todo",
      "id": "b3A6Mzg5NDM2",
      "project_name": "Studio Demo",
      "slug": "b3A6Mzg5NDM2-create-todo",
      "snippet": "This creates a Todo object *Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
      "summary": "This creates a Todo object\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*",
      "title": "Create Todo",
      "type": "http_operation"
    },
    {
      "docs_url": "https://elements-examples.stoplight.io/docs/studio-demo/YXBpOjM4OTQzNA-to-dos",
      "id": "YXBpOjM4OTQzNA",
      "project_name": "Studio Demo",
      "slug": "YXBpOjM4OTQzNA-to-dos",
      "snippet": "![](https://i.ibb.co/v3Yt03v/todo-api-background.png) ## \ud83d\udcab Overview To Do API provides a simple way for people to manage their tasks and plan their day. This API can be used to create mobile and web applications.This API is documented using **Op...",
      "summary": "![](https://i.ibb.co/v3Yt03v/todo-api-background.png)\n\n## \ud83d\udcab Overview\n\nTo Do API provides a simple way for people to manage their tasks and plan their day. This API can be used to create mobile and web applications.This API is documented using **Op...",
      "title": "To-dos",
      "type": "http_service"
    }
  ],
  "total": 2,
  "truncated": false
}

On this page