Create a new version

POST /versions

Deploy a new version for a given documentation, which will become the current version.

application/json

Body

The version creation request object

  • documentation string Required

    UUID or slug of the documentation.

  • hub string

    UUID or slug of the hub if the documentation is part of a hub.

  • Name of the documentation to create. Used only if auto_create_documentation is set.

  • Create the documentation if it does not exist yet. Must be used with a hub and a documentation.

    Default value is false.

  • definition string Required

    Serialized definition of the version. This should be an OpenAPI 2.x, 3.x or AsyncAPI 2.x file serialized as a string, in YAML or JSON.

  • references array[object]

    Import external references used by definition. It's usually resources not accessible by Bump.sh servers, like local files or internal URLs.

    Hide references attributes Show references attributes object
    • location string

      Location of the external reference as it's called from definition, without the relative path (the part after #/). Can be an URL of a file system path.

    • content string

      Content of the external reference, as a string.

  • Select a branch for this new version (branch will be created if it doesn't exist).

    Defaults to the main branch.

  • UUID of a previously deployed version

  • temporary boolean

    Whether you want the new version to be temporary or not. By default a new version will be permanent to your documentation.

  • unpublished boolean Deprecated

    Alias for temporary property.

Responses

  • 201 application/json

    Documentation version successfully created

    Hide response attributes Show response attributes object
    • id string

      Unique id of your version.

    • doc_id string

      Unique id of your documentation.

    • The public URL of your documentation.

  • 204

    Documentation is unchanged

  • 400 application/json

    Bad request

    Hide response attribute Show response attribute object
    • message string

      Human readable error message for status 400.

  • 422 application/json

    Definition is not valid.

    Hide response attributes Show response attributes object
    • message string

      Human readable error message.

    • errors object

      Hash of invalid attributes with their error messages.

POST /versions
curl \
 -X POST https://bump.sh/api/v1/versions \
 -H "Authorization: Token $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"definition":"{\"openapi\": \"3.1.0\", \"info\": { \"title\": … }}","references":[{"location":"https://example.com/api/models/pet.yml","content":"string"}],"branch_name":"dev","documentation":"my_api_slug"}'
{
  "definition": "{\"openapi\": \"3.1.0\", \"info\": { \"title\": … }}",
  "references": [
    {
      "location": "https://example.com/api/models/pet.yml",
      "content": "string"
    }
  ],
  "branch_name": "dev",
  "documentation": "my_api_slug"
}
{
  "definition": "{\"openapi\": \"3.1.0\", \"info\": { \"title\": … }}",
  "references": [
    {
      "location": "https://example.com/api/models/pet.yml",
      "content": "string"
    }
  ],
  "documentation": "my_new_api_slug",
  "documentation_name": "My new API documentation",
  "auto_create_documentation": true
}
{
  "definition": "{\"openapi\": \"3.1.0\", \"info\": { \"title\": … }}",
  "references": [
    {
      "location": "https://example.com/api/models/pet.yml",
      "content": "string"
    }
  ],
  "documentation": "my_new_api_slug",
  "documentation_name": "My new API documentation",
  "auto_create_documentation": true,
  "hub": "my_hub_slug"
}
Response examples (201)
{
  "id": "2361df99-3467-4c80-a0cc-45c9fe565812",
  "doc_id": "3ef8f52f-9056-4113-840e-2f7183b90e06",
  "doc_public_url": "https://bump.sh/doc/my-own-documentation"
}
Response examples (400)
{
  "message": "You need to upgrade to a paid plan to perform this request. Please go to https://bump.sh/account/billing"
}
Response examples (422)
{
  "message": "Invalid definition file",
  "errors": {
    "raw_definition": [
      "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed"
    ]
  }
}