Create a Run in Postman button to instantly bring your Postman collections into your user's environment. The Run in Postman button enables users to fork collections. You can embed the button in your website or a README to let developers interact with your API more quickly.
You can create the Run in Postman button from API specification formats like OpenAPI and RAML. First, convert the file to a collection by importing it into Postman or by generating a collection from your API.
To enable sharing, creating the Run in Postman button requires that your collection is located in a public workspace and that it contains HTTP requests only. This option is not available for other types of protocols.
If the collection is present in a public workspace, you can directly embed the copied code where you would like the button to display. If the collection is present in a team or a personal workspace, share the collection to a public workspace to create the Run in Postman button.
To create the button, do the following:
Select Collections in the sidebar and select the collection you want to share.
Select Share.
Select the Via Run in Postman tab.
Choose a live or static button:
To create a live button, you need to share the collection to a public workspace. If you don't have a public workspace to share to, you can create a new one using the modal. For users on Enterprise plans, you need to have a Community Manager role to create a new public workspace.
You can optionally include an environment to embed with your collection. Select the Add an environment dropdown list and choose the environment.
Select Copy Code.
Your embed code will include your collection's ID. In the examples below, :collection_id is a placeholder for that ID and :collection_url is a placeholder for url. If you choose to include an environment in your button, the code will also have the environment parameter.
Embed the code where you would like the button to display.
The following is an example of code to embed in Markdown format.
[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman" style="width: 128px; height: 32px;">](https://god.gw.postman.com/run-collection/:collection_id)
The following is an example of code to embed in HTML format.
<div class="postman-run-button"
data-postman-action="collection/fork"
data-postman-var-1=":collection_id"
data-postman-collection-url=":collection_url"></div>
<script type="text/javascript">
(function (p,o,s,t,m,a,n) {
!p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
!o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
(n = o.createElement("script")),
(n.id = s+t), (n.async = 1), (n.src = m), n
));
}(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>
Select the Run in Postman button to open the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen. All collections shared with the new Run in Postman buttons come with fork counts, that help you and your consumers understand how developers use the API.
Live Run in Postman buttons are automatically updated with changes in the original collection, so your consumers always get the most recent version of your collection without publishers having to manually update the collection's link.
Last modified: 2024/05/07
Additional resources
Case Studies
Videos
Blog posts