Overview

CodeRifts REST API — integrate anywhere

POST/api/diff

Compare two OpenAPI specifications and return a detailed analysis report. Specs can be URLs or inline JSON/YAML.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Body
basestringrequired

URL or inline spec (base version)

headstringrequired

URL or inline spec (new version)

formatstring

"json" (default) or "markdown"

Example
curl -X POST https://app.coderifts.com/api/diff \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "base": "https://petstore.swagger.io/v2/swagger.json",
    "head": "https://your-api.com/openapi.yaml"
  }'

Authentication: Bearer token via Authorization header. Get your key at app.coderifts.com/api/signup. See the full API reference at app.coderifts.com/api/docs for all options.

Rate limits#

Plan Requests / Month Price
Free 1,000 $0
Pro Unlimited $49/mo
Team Unlimited $79/mo
Enterprise Unlimited Contact us

See full pricing details.

CI/CD integration examples#

GitHub Actions#

- name: Check API breaking changes
  run: |
    RESULT=$(curl -s -X POST https://app.coderifts.com/api/diff \
      -H "Authorization: Bearer ${{ secrets.CODERIFTS_API_KEY }}" \
      -H "Content-Type: application/json" \
      -d '{"base": "main:api/openapi.yaml", "head": "api/openapi.yaml"}')
    echo "$RESULT" | jq .summary

GitLab CI#

api-contract-check:
  stage: test
  script:
    - |
      curl -sf -X POST https://app.coderifts.com/api/diff \
        -H "Authorization: Bearer $CODERIFTS_API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"base\": \"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME:api/openapi.yaml\", \"head\": \"api/openapi.yaml\"}"

Prefer a GitHub-native experience? Install the GitHub App instead.

Updated

Was this page helpful?