PUBLISHING API / V1
Publish docs
with every release.
Create an API once, then send an updated document after each successful deployment. APIRecap makes the new version current while keeping earlier versions available.
Before you start
Create a project in APIRecap and note its numeric ID from the project URL, for example /projects/1. Then create a named publishing key in Settings → API keys. Copy it when shown: the full key cannot be retrieved later.
Authorization: Bearer header. Owners and Editors can publish to projects they can edit; Readers cannot publish.In the commands below, replace project 1, the API slug payments, and the local file path with your values. Set APIRECAP_API_KEY in your shell or CI secret store.
Create an API from a document
Use POST /api/v1/projects/{project}/apis to create a new API inside an existing project. The request needs a name and a document. A slug is optional; if omitted, APIRecap suggests one from the name.
curl -fS -X POST "https://apirecap.com/api/v1/projects/1/apis" \
-H "Authorization: Bearer $APIRECAP_API_KEY" \
-F "name=Payments" \
-F "slug=payments" \
-F "document=@openapi.yaml"A successful create returns 201 Created with the API ID, project ID, slug, format, visibility, and "version": 1. Use the slug for later updates.
{"id":7,"project_id":1,"name":"Payments","slug":"payments","version":1,"format":"openapi_yaml","visibility":"listed"}For a JSON request, send an OpenAPI object in document with Content-Type: application/json. For Markdown or YAML text in JSON, set format to markdown or openapi_yaml and pass the source text in document.
Publish the next version
After a successful production deployment, send the replacement file to POST /api/v1/projects/{project}/apis/{api-slug}/versions. Each accepted request creates an immutable version and makes it the latest.
curl -fS -X POST "https://apirecap.com/api/v1/projects/1/apis/payments/versions" \
-H "Authorization: Bearer $APIRECAP_API_KEY" \
-F "document=@openapi.yaml"The response returns the new version number. Your current docs link points to that version, while previous versions keep their own URLs. APIRecap can compare adjacent versions so readers can see what changed. If your workflow sends a JSON body instead of a file, PUT /api/v1/projects/{project}/apis/{api-slug} also publishes the next version.
{"id":7,"project_id":1,"name":"Payments","slug":"payments","version":2,"format":"openapi_yaml"}Formats and limits
.json file or JSON object.yaml or .yml file, or YAML text.md file or UTF-8 textOpenAPI 3.0 and 3.1 documents are validated before storage. Documents have a 2 MB limit. The first document fixes that API's format: later versions must use the same type. To change from YAML to JSON or Markdown, create another API.
Invalid input returns a validation error without publishing a version. Missing or revoked keys return 401; a key without edit access returns 403.