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
The preview creation request object
-
definition string
REQUIRED if
url
is not present.Serialized definition. 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. -
url string(uri)
REQUIRED if
definition
is not present.Target definition URL. It should be accessible through HTTP by Bump.sh servers.
POST /previews
curl \
-X POST https://bump.sh/api/v1/previews \
-H "Content-Type: application/json" \
-d '{"definition":"{\"openapi\": \"3.0\", \"info\": { \"title\": … }}\n","references":[{"location":"https://example.com/api/models/pet.yml","content":"string"}],"url":"https://example.com"}'
Request examples
{
"definition": "{\"openapi\": \"3.0\", \"info\": { \"title\": … }}\n",
"references": [
{
"location": "https://example.com/api/models/pet.yml",
"content": "string"
}
],
"url": "https://example.com"
}
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"
]
}
}