Skip to content

Upload from scripts and CI

The REST API takes the same API key as MCP and acts on the same namespace. Base URL: https://app.jitprompt.com.

Terminal window
curl -H "Authorization: Bearer $JITPROMPT_KEY" \
-F "file=@docs/refund-policy.md" -F "title=Refund policy" \
https://app.jitprompt.com/documents
# {"document_id": "…", "status": "pending", "deduped": false}

Uploading identical content again returns the existing document with "deduped": true and uses no ingestion — so re-running the upload of an unchanged file is free.

Replacing content keeps the document’s id and title:

Terminal window
curl -X PUT -H "Authorization: Bearer $JITPROMPT_KEY" \
-H "Content-Type: text/markdown" --data-binary @docs/refund-policy.md \
https://app.jitprompt.com/documents/$DOC_ID/content
Terminal window
curl -s -H "Authorization: Bearer $JITPROMPT_KEY" \
https://app.jitprompt.com/documents/$DOC_ID | jq -r .status # … ready
name: publish instructions
on:
push:
branches: [main]
paths: ["instructions/**"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upload changed files
env:
JITPROMPT_KEY: ${{ secrets.JITPROMPT_KEY }}
run: |
for f in instructions/*.md; do
curl -sf -H "Authorization: Bearer $JITPROMPT_KEY" \
-F "file=@$f" -F "title=$(head -1 "$f" | sed 's/^# //')" \
https://app.jitprompt.com/documents
done

New content creates a new document; to keep one document per file, store the document_id and use PUT …/content instead. Every upload or replacement counts as one ingestion against your plan.

The full endpoint list is in the API reference.