Add general upload API endpoint with project as form parameter #53

Merged
qwc merged 1 commit from feature/general-upload-api into main 2026-02-06 14:36:59 +01:00
Owner

Summary

  • Add POST /api/upload endpoint that accepts project as a form parameter
  • Refactor upload logic into shared handleAPIUploadWithSlug function
  • Both endpoints (/api/project/{slug}/upload and /api/upload) work in parallel
  • Update API documentation to describe both options

Usage

curl -X POST \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "project=my-project" \
  -F "archive=@docs.zip" \
  -F "version=v1.0.0" \
  https://docs.example.com/api/upload

Closes #52

Test plan

  • Test upload via /api/project/{slug}/upload still works
  • Test upload via /api/upload with project form parameter
  • Verify error handling for missing project parameter

🤖 Generated with Claude Code

## Summary - Add `POST /api/upload` endpoint that accepts `project` as a form parameter - Refactor upload logic into shared `handleAPIUploadWithSlug` function - Both endpoints (`/api/project/{slug}/upload` and `/api/upload`) work in parallel - Update API documentation to describe both options ## Usage ```bash curl -X POST \ -H "Authorization: Bearer YOUR_TOKEN" \ -F "project=my-project" \ -F "archive=@docs.zip" \ -F "version=v1.0.0" \ https://docs.example.com/api/upload ``` Closes #52 ## Test plan - [ ] Test upload via `/api/project/{slug}/upload` still works - [ ] Test upload via `/api/upload` with project form parameter - [ ] Verify error handling for missing project parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add general upload API endpoint with project as form parameter
All checks were successful
CI / test (pull_request) Successful in 1m6s
CI / build (pull_request) Successful in 51s
CI / docker (pull_request) Has been skipped
b70b766c7b
Adds POST /api/upload as an alternative to POST /api/project/{slug}/upload.
The new endpoint accepts project slug as a form parameter instead of URL path,
making it easier to use in scripts where the project is a variable.

Both endpoints work in parallel and are functionally identical.

Closes #52

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
qwc merged commit b0554038d8 into main 2026-02-06 14:36:59 +01:00
qwc deleted branch feature/general-upload-api 2026-02-06 14:37:00 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/asiakirjat!53
No description provided.