Forum Discussion

Libor's avatar
Libor
New Contributor
4 years ago
Solved

publish/unpublish through registry api

Hello, We have automated way how to create and upload new api documentation to swaggerhub during releasing of new version of our application to production servers. But we still need to log into swag...
  • HKosova's avatar
    4 years ago

    Hi Libor,

     

    This is now possible - you can publish and unpublish definitions by using "PUT ​/apis​/{owner}​/{api}​/{version}​/settings​/lifecycle":

    curl -X PUT "https://api.swaggerhub.com/apis/OWNER/API_NAME/VERSION/settings/lifecycle"
         -H "Authorization: SWAGGERHUB_API_KEY"
         -H "Content-Type: application/json"
         -d "{\"published\": true}"

    API docs