Speca Public API
{owner}
/{urlName}
/versions{owner}
/{urlName}
/versions/{version}
{owner}
/{urlName}
/versions{owner}
/{urlName}
/versions/{version}
{owner}
/{urlName}
/versionsPath variables
Owner account url name
API url name
Request body
Version name
Name of parent version
Version description
whether this API version can be modified or not
version status
Responses
Body
curl -X PUT "https://speca.io/api/specs/my-org/my-rest-api/versions" \
-H "Content-Type: application/json" \
-d '{
"name": "v1.2-draft",
"from": "v1.0",
"desc": "some description",
"readOnly": "false",
"status": "published"
}'
HTTP/1.1 200 OK
Content-Type: application/json
{
"counter": 1,
"default_": 0,
"versions": [
{
"id": 1,
"from": 0,
"createdAt": 1543980746920,
"name": "master",
"status": "published"
}
]
}
{owner}
/{urlName}
/versions/{version}
Path variables
Owner account url name
API url name
updated version name
Request body
new version name
version description
whether this API version can be modified or not
version status
Responses
Body
{owner}
/{urlName}
/versionsPath variables
Owner account url name
API url name
Responses
Body
GET https://speca.io/api/specs/my-org/my-rest-api/versions HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"counter": 1,
"default_": 0,
"versions": [
{
"id": 0,
"from": 0,
"createdAt": 1543980746920,
"name": "master",
"status": "published"
},
{
"id": 1,
"from": 0,
"createdAt": 1550633714908,
"name": "draft",
"status": "unpublished"
}
]
}
{owner}
/{urlName}
/bundle{owner}
/{urlName}
/oas3{owner}
/{urlName}
/swagger{owner}
/{urlName}
/postman{owner}
/{urlName}
/bundleExport API documentation in html format, so it can be hosted by any web server.
Path variables
Owner account url name
API url name
Responses
Response is zip archive includes published versions of API in html format along with all required assets - js and css files.
{owner}
/{urlName}
/oas3Path variables
Owner account url name
API url name
Request parameters
Responses
Body
GET https://speca.io/api/specs/my-org/my-rest-api/oas3?specVersion=0.2 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"openapi": "3.0.0",
"info": {
"title": "Speca Public API",
"version": ""
},
"servers": [
{
"url": "https://speca.io/api"
}
],
"paths": {
"/specs/{owner}/{urlName}/oas3": {
"get": {
"summary": "Export API description in OAS3 format",
"operationId": "export-api-description-in-oas3-format",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner account url name",
"required": true,
"schema": {
"type": "string",
"example": "my-org"
}
},
{
"name": "urlName",
"in": "path",
"description": "API url name",
"required": true,
"schema": {
"type": "string",
"example": "my-rest-api"
}
},
{
"name": "specVersion",
"in": "query",
"schema": {
"type": "string",
"example": "0.2"
}
},
{
"name": "specaExt",
"in": "query",
"schema": {
"type": "boolean",
"example": true
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "Swagger 3.0"
}
}
}
}
}
}
},
....
}
{owner}
/{urlName}
/swaggerPath variables
Owner account url name
API url name
Request parameters
Responses
Body
GET https://speca.io/api/specs/my-org/my-rest-api/swagger HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"swagger": "2.0",
"info": {
"title": "Speca Public API",
"version": ""
},
"host": "speca.io",
"basePath": "/api",
"schemes": [
"https"
],
"paths": {
"/specs/{owner}/{urlName}/oas3": {
"get": {
"summary": "Export API description in OAS3 format",
"operationId": "export-api-description-in-oas3-format",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner account url name",
"required": true,
"type": "string",
"example": "my-org"
},
{
"name": "urlName",
"in": "path",
"description": "API url name",
"required": true,
"type": "string",
"example": "my-rest-api"
},
{
"name": "specVersion",
"in": "query",
"type": "string",
"example": "0.2"
},
{
"name": "specaExt",
"in": "query",
"type": "boolean",
"example": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Swagger 3.0"
}
}
}
}
},
...
}
{owner}
/{urlName}
/postmanPath variables
Owner account url name
API url name
Responses
Body
["eaf11938-52e2-4f7c-88b2-827d166823a9","72d82249-67c9-4aef-9a1e-f3b2f0b469a2","746469b7-4002-4e75-95a1-bfd144052897"]
["635624b9-d5d3-4b71-bec9-ef9f37b79e69","61e93b8d-41d4-40e9-96ce-3633d72b5fe2","ef8404f6-b550-4562-9b0c-9e8d040d341a"]
GET https://speca.io/api/specs/my-org/my-rest-api/postman HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "a6a47569-0e7a-492d-9269-2641daaa9579",
"name": "Speca Public API",
"timestamp": 1550633310503,
"order": [
"eaf11938-52e2-4f7c-88b2-827d166823a9",
"72d82249-67c9-4aef-9a1e-f3b2f0b469a2",
"746469b7-4002-4e75-95a1-bfd144052897"
],
"folders": [
{
"id": "eaf11938-52e2-4f7c-88b2-827d166823a9",
"name": "Export",
"order": [
"635624b9-d5d3-4b71-bec9-ef9f37b79e69",
"61e93b8d-41d4-40e9-96ce-3633d72b5fe2",
"ef8404f6-b550-4562-9b0c-9e8d040d341a"
],
"collection_name": "Speca Public API",
"collection_id": "a6a47569-0e7a-492d-9269-2641daaa9579"
},
{
"id": "72d82249-67c9-4aef-9a1e-f3b2f0b469a2",
"name": "Preview Updates",
"order": [
"3bd7c5cd-a31e-4ec2-a8b6-82b6fbe5331e",
"a95f7048-e4f6-468b-9373-c866b963abe5"
],
"collection_name": "Speca Public API",
"collection_id": "a6a47569-0e7a-492d-9269-2641daaa9579"
},
{
"id": "746469b7-4002-4e75-95a1-bfd144052897",
"name": "Update",
"order": [
"95cd63ea-5b2f-4732-ba6d-048b6abbbf6f",
"195c422b-9365-410c-91e1-d301b299f123"
],
"collection_name": "Speca Public API",
"collection_id": "a6a47569-0e7a-492d-9269-2641daaa9579"
}
],
"requests": [
{
"id": "635624b9-d5d3-4b71-bec9-ef9f37b79e69",
"headers": "Accept: application/json\nContent-Type: application/json\n",
"url": "https://speca.io/api/specs/:owner/:urlName/postman",
"method": "GET",
"pathVariables": {
"owner": "my-org",
"urlName": "my-rest-api"
},
"data": [],
"dataMode": "params",
"name": "Export as Postman collection",
"time": 1550633310504,
"version": 2,
"responses": [
{
"id": "1d18189b-87e2-4415-b483-b13f20b956f4",
"name": "Example Response",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": 109,
"headers": [],
"language": "javascript",
"previewType": "html",
"rawDataType": "text",
"collectionRequestId": "635624b9-d5d3-4b71-bec9-ef9f37b79e69"
}
],
"collectionId": "a6a47569-0e7a-492d-9269-2641daaa9579",
"synced": false
},
{
"id": "a95f7048-e4f6-468b-9373-c866b963abe5",
"headers": "Accept: application/json\nContent-Type: application/json\nSpeca-Version: \n",
"url": "https://speca.io/api/specs/:owner/:name/mergeSwaggerPreview?mode=merge",
"method": "POST",
"pathVariables": {
"owner": "",
"name": ""
},
"dataMode": "raw",
"name": "Show diff between spec and Swagger 2.0 definition",
"description": "This operation let you preview updates that will be result of update API with provided spec in Swagger 2.0 format.\nIn other words operation produces a diff between API definition in Speca and provided document.",
"time": 1550633310504,
"version": 2,
"responses": [
{
"id": "b4e8a989-79de-4a09-883d-33da891bcbf6",
"name": "Example Response",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": 109,
"headers": [],
"language": "javascript",
"previewType": "html",
"rawDataType": "text",
"collectionRequestId": "a95f7048-e4f6-468b-9373-c866b963abe5"
}
],
"collectionId": "a6a47569-0e7a-492d-9269-2641daaa9579",
"synced": false
},
{
"id": "95cd63ea-5b2f-4732-ba6d-048b6abbbf6f",
"headers": "Accept: application/json\nContent-Type: application/json\nSpeca-Version: \n",
"url": "https://speca.io/api/specs/:owner/:urlName/mergeSpec?mode=merge",
"method": "POST",
"pathVariables": {
"owner": "",
"urlName": ""
},
"dataMode": "raw",
"name": "Update API with a Spec Definition in internal format",
"time": 1550633310504,
"version": 2,
"responses": [
{
"id": "6e799501-7969-41e8-9627-93f78f28aba6",
"name": "Example Response",
"responseCode": {
"code": 200,
"name": "OK"
},
"time": 109,
"headers": [],
"language": "javascript",
"previewType": "html",
"rawDataType": "text",
"collectionRequestId": "95cd63ea-5b2f-4732-ba6d-048b6abbbf6f"
}
],
"collectionId": "a6a47569-0e7a-492d-9269-2641daaa9579",
"synced": false
},
...
]
}
{owner}
/{name}
/uploadUpdatePreview{owner}
/{name}
/mergeSwaggerPreview{owner}
/{name}
/uploadUpdatePreviewThis operation let you preview updates that will be result of update API with provided spec in either Swagger 2.0 or Open API format. In other words operation produces a diff between API definition in Speca and provided document.
Path variables
Request parameters
Merge definitions mode.
Preserve groups hierarchy, document items, traits and shared items. Merge operations and schemas, by default description and examples are not updated.
Preserve group hierarchy and document items, all other definitions get deleted. New items are created from the submitted document.
Add new items, existent definitions stay untouched
If true
, descriptions will be updated with the ones coming in uploaded document.
If true
, examples will be updated with the ones coming in uploaded document.
Remove items that are no longer referred by any other objects
Request headers
Request body
OpenAPI document, both Swagger 2.0 and OpenAPI 3 are accepted
Responses
Body
POST https://speca.io/api/specs/speca/petstore-api/uploadUpdatePreview?mode=merge HTTP/1.1
Content-Type: multipart/form-data
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
....
},
"created": [
{
"id": "updatePet",
"name": "Update an existing pet",
"type": "method"
},
{
"id": "placeOrder",
"name": "Place an order for a pet",
"type": "method"
}
...
],
"updated": [
{
"id": "Pet",
"name": "pet",
"type": "schema"
}
...
],
"deleted": []
}
{owner}
/{name}
/mergeSwaggerPreviewThis operation let you preview updates that will be result of update API with provided spec in Swagger 2.0 format. In other words operation produces a diff between API definition in Speca and provided document.
Path variables
Request parameters
Merge definitions mode.
Preserve groups hierarchy, document items, traits and shared items. Merge operations and schemas, by default description and examples are not updated.
Preserve group hierarchy and document items, all other definitions get deleted. New items are created from the submitted document.
Add new items, existent definitions stay untouched
If true
, descriptions will be updated with the ones coming in uploaded document.
If true
, examples will be updated with the ones coming in uploaded document.
Remove items that are no longer referred by any other objects
Request headers
Request body
Responses
Body
POST https://speca.io/api/specs/speca/petstore-api/uploadUpdatePreview?mode=merge HTTP/1.1
Content-Type: application/json
{
"swagger": "2.0",
"paths": {
...
}
"definitions": {
...
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
....
},
"created": [
{
"id": "updatePet",
"name": "Update an existing pet",
"type": "method"
},
{
"id": "placeOrder",
"name": "Place an order for a pet",
"type": "method"
}
...
],
"updated": [
{
"id": "Pet",
"name": "pet",
"type": "schema"
}
...
],
"deleted": []
}
{owner}
/{urlName}
/mergeSpecPath variables
Request parameters
Id of the group new items will be placed in.
Merge definitions mode.
Preserve groups hierarchy, document items, traits and shared items. Merge operations and schemas, by default description and examples are not updated.
Preserve group hierarchy and document items, all other definitions get deleted. New items are created from the submitted document.
Add new items, existent definitions stay untouched
If true
, descriptions will be updated with the ones coming in uploaded document.
If true
, examples will be updated with the ones coming in uploaded document.
Remove items that are no longer referred by any other objects
Request headers
Request body
API definition in Speca internal format (result of Preview update operation)
Responses
{owner}
/{urlName}
/mergeSwaggerPath variables
Request parameters
Id of the group new items will be placed in. If empty, all the new items will become children of the root group.
Merge definitions mode.
Preserve groups hierarchy, document items, traits and shared items. Merge operations and schemas, by default description and examples are not updated.
Preserve group hierarchy and document items, all other definitions get deleted. New items are created from the submitted document.
Add new items, existent definitions stay untouched
If true
, descriptions will be updated with the ones coming in uploaded document.
If true
, examples will be updated with the ones coming in uploaded document.
Remove items that are no longer referred by any other objects
Request headers
Request body
Responses
@deperecated to be removed
default version id
parent version id
{
"data": {},
"created": [
{
"id": "pet",
"name": "Pet",
"type": "method"
}
],
"updated": [
{
"id": "user",
"name": "User",
"type": "schema"
}
],
"deleted": [
{
"id": "deprecated-param",
"name": "Deprecated Param",
"type": "param"
}
]
}
Result API definition in internal Speca format
List of items that doesn’t exist and will be created
List of existing items that will be updated
List of items that will be deleted
Please checkout original specification here
This header can be passed in every API endpoint that reads or updates API spec, if you omit the header that means you deal with the default version.