Bump.sh Versions API

The Versions API from Bump.sh — 2 operation(s) for versions.

OpenAPI Specification

bump-sh-versions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bump.sh Api Branches Versions API
  description: 'This is the official Bump.sh API documentation.  Obviously created

    with Bump.sh.


    The Bump.sh API is a REST API. It enables you to [create, update](#operation-post-versions)

    or [preview](#operation-post-previews) your API(s) documentation,

    [create stand-alone documentation diffs](#operation-post-diffs) or

    [validate a documentation definition](#operation-post-validations)

    (currently in OpenAPI or AsyncAPI).


    Our [webhook](#webhook-documentation-change) also lets you get

    notifications every time a change is introduced in your API.

    '
  version: '1.0'
servers:
- url: https://bump.sh/api/v1
  name: Production
security:
- Authorization token: []
- Basic token: []
tags:
- name: Versions
paths:
  /versions:
    post:
      tags:
      - Versions
      summary: Create a New Version
      description: 'Deploy a new version for a given documentation, which will become the current version.

        '
      requestBody:
        $ref: '#/components/requestBodies/Version'
      responses:
        '201':
          summary: Documentation version successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Version'
        '204':
          description: Documentation is unchanged
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDisabledOwner'
        '422':
          $ref: '#/components/responses/InvalidDefinition'
  /versions/{version_id}:
    get:
      tags:
      - Versions
      summary: Fetch a Full Documentation Version Including Diff Summary
      description: 'Fetch a full documentation version including diff summary.

        '
      parameters:
      - in: path
        name: version_id
        schema:
          type: string
          description: UUID of an existing documentation version.
        required: true
        description: UUID of an existing version from which to fetch a documentation change
      - in: query
        name: formats
        description: 'A list of formats to render in the response. Possible

          values are `text`, `markdown`, `html` or `json`. If not

          provided defaults to render both `text`, `markdown` and

          `json` formats.

          '
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          summary: Success
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Version'
                - $ref: '#/components/schemas/WithDiff'
        '202':
          summary: Documentation version is still being processed. Please try again later
        '400':
          summary: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDisabledOwner'
        '404':
          description: Version not found
components:
  schemas:
    Version:
      properties:
        id:
          type: string
          description: Unique id of your version.
          example: 2361df99-3467-4c80-a0cc-45c9fe565812
        doc_id:
          type: string
          description: Unique id of your documentation.
          example: 3ef8f52f-9056-4113-840e-2f7183b90e06
        doc_public_url:
          type: string
          description: The public URL of your documentation.
          example: https://bump.sh/doc/my-own-documentation
    DiffItem:
      properties:
        id:
          type: string
          description: The identifier of the diff change
          example: post-versions
        name:
          type: string
          description: The human name of diff change
          example: POST /versions
        status:
          type: string
          enum:
          - added
          - modified
          - removed
          example: modified
        type:
          type: string
          description: The object type of the diff change
          example: endpoint
        breaking:
          type: boolean
          description: Identifies if the item is a breaking change
          example: true
        previous:
          type: object
          description: Object attributes values, before change. Possible attributes depend on the object `type` ('endpoint', 'body', 'response'…)
          example:
            path: /versions
            deprecated: false
            verb: POST
        current:
          type: object
          description: Object attributes values, after change. Possible attributes depend on the object `type` ('property', 'operation', 'message'…)
          example:
            path: /version
            deprecated: false
            verb: PUT
        breaking_details:
          type: object
          description: 'Represents breaking change reasons, used to give more

            context about this question: _why is this change

            breaking?_

            '
          properties:
            message_key:
              type: string
              description: This property is used to generate the human message about breaking change reason
              example: removed_not_deprecated
            breaking_attributes:
              type: array
              description: 'When diff status is modified, this property is an

                array including every modified attribute responsible

                of the breaking change.

                '
              items:
                type: string
              example:
              - verb
              - path
        children:
          type: array
          description: A list of children item changes
          items:
            $ref: '#/components/schemas/DiffItem'
    DocumentationRequest:
      type: object
      required:
      - documentation
      properties:
        documentation:
          type: string
          description: UUID or slug of the documentation.
          example: 0776d85d-e097-47c1-8c60-cb1190d11945
        hub:
          type: string
          description: UUID or slug of the hub if the documentation is part of a hub.
          example: my_hub_slug
        documentation_name:
          type: string
          description: Name of the documentation to create. Used only if `auto_create_documentation` is set.
        auto_create_documentation:
          type: boolean
          default: false
          description: Create the documentation if it does not exist yet. Must be used with a `hub` and a `documentation`.
    Error:
      properties:
        message:
          type: string
          description: Human readable error message.
          example: Invalid definition file
        errors:
          type: object
          description: Hash of invalid attributes with their error messages.
          example:
            raw_definition:
            - The property '#/paths//docs/{:id}/validations/post' contains additional properties ["yolo"] outside of the schema when none are allowed
    WithDiff:
      properties:
        diff_details:
          type: array
          description: Details of each change as a list of diff items
          items:
            $ref: '#/components/schemas/DiffItem'
        diff_markdown:
          type: string
          description: The comparaison diff summary in markdown format
          example: "## Modified (1)\n\n* `POST /user`\n  * Path parameters added: `id`, `email`\n  * Query parameters added: `period`, `limit`\n"
        diff_summary:
          type: string
          description: The comparaison diff summary
          example: "Updated: POST /versions\n  Response modified: 201\n    Body attribute added: doc_id\n"
        diff_public_url:
          type: string
          description: The public URL of your diff
          example: https://bump.sh/doc/my-own-documentation/change/2361df99-3467-4c80-a0cc-45c9fe565812
        diff_breaking:
          type: boolean
          description: Identifies if the diff includes breaking changes
          example: false
    ErrorDisabledOwner:
      properties:
        message:
          type: string
          description: Human readable error message for status 400.
          example: You need to upgrade your subscription plan to perform this request.
    Reference:
      type: object
      properties:
        location:
          type: string
          description: 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.
          example: https://example.com/api/models/pet.yml
        content:
          type: string
          description: Content of the external reference, as a string.
    VersionRequest:
      type: object
      required:
      - definition
      properties:
        definition:
          type: string
          description: '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.

            '
          example: '{"openapi": "3.0", "info": { "title": … }}

            '
        references:
          type: array
          description: Import external references used by `definition`. It's usually resources not accessible by Bump.sh servers, like local files or internal URLs.
          items:
            $ref: '#/components/schemas/Reference'
        branch_name:
          type: string
          description: 'Select a branch for this new version (branch will be

            created if it doesn''t exist).


            *Defaults to the main branch*.

            '
  requestBodies:
    Version:
      description: The version creation request object
      content:
        application/json:
          schema:
            allOf:
            - $ref: '#/components/schemas/DocumentationRequest'
            - $ref: '#/components/schemas/VersionRequest'
            - type: object
              properties:
                previous_version_id:
                  type: string
                  description: UUID of a previously deployed version
                  example: 3ef8f52f-9056-4113-840e-2f7183b90e06
                temporary:
                  type: boolean
                  description: Whether you want the new version to be temporary or not. By default a new version will be permanent to your documentation. Temporary versions have a time to live of 7 days after which they are removed.
                  example: false
                unpublished:
                  type: boolean
                  description: Alias for temporary property.
                  deprecated: true
                  example: false
          examples:
            default:
              $ref: '#/components/examples/NewVersion/ExistingDocumentation'
            auto_create_standalone:
              $ref: '#/components/examples/NewVersion/CreatingStandaloneDocumentation'
            auto_create_in_hub:
              $ref: '#/components/examples/NewVersion/CreatingDocumentationInHub'
  responses:
    InvalidDefinition:
      summary: Definition is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  examples:
    NewVersion:
      CreatingDocumentationInHub:
        summary: Create a new documentation inside a hub
        value:
          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
      CreatingStandaloneDocumentation:
        summary: Create a new standalone documentation with the given version
        value:
          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
      ExistingDocumentation:
        summary: Create new version on an existing documentation
        value:
          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
  securitySchemes:
    Authorization token:
      type: http
      scheme: token
    Basic token:
      type: http
      scheme: basic
      deprecated: true
x-topics:
- title: Authentication
  content:
    $ref: ./authentication.md
  example:
    $ref: ./authentication-example.md