Create New Product


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 the visibility to private.

don't forget to replace the placeholder values with the real values

curl --location --request POST 'https://api.portal.swaggerhub.com/v1/products' \
--header 'Authorization: Bearer <YOUR-SWAGGERHUB-APIKEY>' \
--header 'Content-Type: application/json' \

--data '{
  "portalId": "<PORTAL-ID>",
  "name": "Pet Adoptions",
  "description": "API documentation, tutorials, and guides enabling programmatic adoption of pets",
  "slug": "pet-adoptions",
  "public": false,
  "hidden": false
}'

Sample response body:

{
  "id": "62a07233-3bbe-4008-b6aa-4f4e732352d5"
}

note keep note of the returned id for the products, as it will be needed for later API calls

Add Product Logo

Products can also have a logo.

🚧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:
Sample Portal Landing Page With Product