Skip to content

CONV-302: Add API file upload endpoint#262

Merged
menvil merged 1 commit into
developfrom
feature/CONV-302-add-api-file-upload-endpoint
Jun 3, 2026
Merged

CONV-302: Add API file upload endpoint#262
menvil merged 1 commit into
developfrom
feature/CONV-302-add-api-file-upload-endpoint

Conversation

@menvil

@menvil menvil commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds POST /api/v1/files that delegates to StoreUploadedFileAction (same action as web UI)
  • Adds FileController, UploadFileRequest, FileResource, TargetFormatResource
  • Returns 201 Created with file metadata (id, name, extension, size, dates) — no stored_path
  • Storage/size limits enforced through the shared action

Test plan

  • Upload PNG returns 201 with correct JSON shape and DB record
  • Missing file field → 422
  • Missing API key → 401
  • Free user → 403 api_not_available
  • composer test passes (562 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Adds POST /api/v1/files to upload files via the API using the same storage logic as the web app. Fulfills CONV-302 by returning file metadata on success and enforcing plan and size limits.

  • New Features
    • Route: POST /api/v1/files handled by FileController@store
    • Validation via UploadFileRequest (file is required)
    • Response: 201 Created with FileResource (id, original_name, extension, mime_type, size_bytes, created_at, expires_at); no stored path
    • Auth: API key required; Free plan gets 403 with api_not_available
    • Tests cover success, 422 for missing file, 401 without key, and 403 for Free users

Written for commit 245de38. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@menvil menvil merged commit 8938b5d into develop Jun 3, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ac1704f5-c80e-4d70-bbc8-8b947ca4ec84

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/CONV-302-add-api-file-upload-endpoint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant