Create Product
This section describes how to create a product and set the main product settings.
A new product can be created via the POST Create product request. Below is a sample cURL request, which creates a product with the base settings populated, and sets public to false to restrict access to organization members. You can also provide a template ID and change the type property value to copy to create a product from a template.
💡 Don't forget to replace the placeholder values with the real values
curl --location --request POST 'https://api.portal.swaggerhub.com/v1/portals/<PORTAL-ID>/products' \
--header 'Authorization: Bearer <YOUR-SWAGGER-APIKEY>' \
--header 'Content-Type: application/json' \
--data '{
"type": "new",
"name": "Pet Adoptions",
"description": "API documentation, tutorials, and guides enabling programmatic adoption of pets",
"slug": "pet-adoptions",
"public": false,
"visibility": "visible"
}'Sample Response Body
{
"id": "62a07233-3bbe-4008-b6aa-4f4e732352d5"
}📝 Note: Keep note of the returned
idfor the product, as it will be needed for later API calls.
Add Product Logo
Products can also have a logo.
🚧 Important: In the current version of the API, we do not support attachment uploading. The logo image file for the product must be uploaded via your portal user interface.
After updating the product settings, the published portal now looks as follows: