Version deployed on Mar 14, 2018.

Bump Api

This is the official Bump API documentation. Obviously created with Bump. Note that this is an experimental API on which everything could change.

This is the documentation for version 1.0 of the API. Last update on Mar 14, 2018.

Base URL
https://bump.sh/api/v1

Authentication

Api token authentication

Use the token from your documentation settings as the username of the basic auth, with no password.

Example: curl https://bump.sh/api/v1/docs/1/versions -u DOC_TOKEN:

Note that adding a colon after your token prevents cURL from asking for a password.


Docs

Create a new version

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

URL parameters
  • id Required / string

    Documentation's id

Body
  • format string

    Format of the definition.

    Values are yaml and json.

  • definition Required / string

    Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

  • version object

    The preview object

    • version.format string

      Format of the definition.

      Values are yaml and json.

    • version.definition Required / string

      Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

Responses
  • 201

    Version has been successfully created.

  • 422 object

    Definition is not valid.

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

  • default object

    Unexpected error

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

Definition
POST https://bump.sh/api/v1/docs/{:id}/versions
Example request
$ curl \ -X POST https://bump.sh/api/v1/docs/{:id}/versions \ -H "Content-Type: application/json" \ -d '{"format":"yaml","definition":"{swagger: \"2.0\", \"info\": { \"title: ... }}\n","version":{"for...}'
Example response (201)
No content
Example response (422)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }
Example response (default)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }

Validate a documentation definition

Validate a definition against the OpenApi v2.0 schema and return errors without creating a new version. This is useful in a CI process, to validate that a changed definition file is valid and won't fail when being updated on Bump.

URL parameters
  • id Required / string

    Documentation's id

Body
  • format string

    Format of the definition.

    Values are yaml and json.

  • definition Required / string

    Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

  • version object

    The preview object

    • version.format string

      Format of the definition.

      Values are yaml and json.

    • version.definition Required / string

      Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

Responses
  • 200

    Definition is valid.

  • 422 object

    Definition is not valid.

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

  • default object

    Unexpected error

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

Definition
POST https://bump.sh/api/v1/docs/{:id}/validations
Example request
$ curl \ -X POST https://bump.sh/api/v1/docs/{:id}/validations \ -H "Content-Type: application/json" \ -d '{"format":"yaml","definition":"{swagger: \"2.0\", \"info\": { \"title: ... }}\n","version":{"for...}'
Example response (200)
No content
Example response (422)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }
Example response (default)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }

Previews

Create a preview

Create a preview for a given documentation file. The preview will have a unique temporary URL, and will be active for 30 minutes.

Body
  • format string

    Format of the definition.

    Values are yaml and json.

  • definition Required / string

    Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

  • preview object

    The preview object

    • preview.format string

      Format of the definition.

      Values are yaml and json.

    • preview.definition Required / string

      Serialized definition of the version. This should be an OpenApi 2.0 (Swagger) file serialized as a string, in YAML or JSON.

Responses
  • 201 object

    Preview has been successfully created.

    • id string

      Unique id for the preview URL: https://bump.sh/preview/:id.

    • expires_at string(date-time)

      Preview expiration date and time.

  • 422 object

    Definition is not valid.

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

  • default object

    Unexpected error

    • errors object

      Hash of invalid attributes with their error messages.

    • message string

      Human readable error message.

Definition
POST https://bump.sh/api/v1/previews
Example request
$ curl \ -X POST https://bump.sh/api/v1/previews \ -H "Content-Type: application/json" \ -d '{"format":"yaml","definition":"{swagger: \"2.0\", \"info\": { \"title: ... }}\n","preview":{"for...}'
Example response (201)
{ "id": "3ef8f52f-9056-4113-840e-2f7183b90e06", "expires_at": "2010-04-14T16:05:00+00:00" }
Example response (422)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }
Example response (default)
{ "errors": { "raw_definition": [ "The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed" ] }, "message": "Invalid definition file" }