Create a preview

POST /previews

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

Body

The preview object

  • 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 servers, like local files or internal URLs.

    Hide references attributes Show references attributes array[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.

Responses

  • Success

    Hide response attributes Show response attributes object
    • id string

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

    • expires_at string(date-time)

      Preview expiration date and time.

    • The public URL where the preview will be visible.

  • 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 /previews
curl \
 -X POST https://bump.sh/api/v1/previews \
 -H "Content-Type: application/json" \
 -d '{"definition":"{asyncapi: \"2.0\", \"info\": { \"title: … }}\n","references":[{"location":"https://example.com/api/models/pet.yml","content":"string"}]}'
Request example
{
  "definition": "{asyncapi: \"2.0\", \"info\": { \"title: … }}\n",
  "references": [
    {
      "location": "https://example.com/api/models/pet.yml",
      "content": "string"
    }
  ]
}
Request examples
{
  "definition": "{asyncapi: \"2.0\", \"info\": { \"title: … }}\n",
  "references": [
    {
      "location": "https://example.com/api/models/pet.yml",
      "content": "string"
    }
  ]
}
Response examples (201)
{
  "id": "3ef8f52f-9056-4113-840e-2f7183b90e06",
  "expires_at": "2010-04-14 17:05:00 +0100",
  "public_url": "https://bump.sh/preview/3ef8f52f-9056-4113-840e-2f7183b90e06"
}
Response examples (201)
{
  "id": "3ef8f52f-9056-4113-840e-2f7183b90e06",
  "expires_at": "2010-04-14T17:05:00+01:00",
  "public_url": "https://bump.sh/preview/3ef8f52f-9056-4113-840e-2f7183b90e06"
}
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"
    ]
  }
}
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"
    ]
  }
}