Cloudify API Docs
Beginner-friendly guide for the backend at https://cloudify.meraj.pro.
Current provider: Cloudinary. You can manage private auth tokens, public keys, and files from these endpoints.
Before You Start
You will use two different tokens in this API.
Auth token: returned from register/login. Use this for account-level routes (user, logout, keys management).
Public key: generated from /api/keys/public. Use this for file routes (upload/list/delete).
Example header format
Authorization: Bearer <TOKEN_HERE>
Quick Start Flow
If this is your first time, follow these steps in order.
- Register or login to get an auth token.
- Add a Cloudinary account in /api/keys/cloudinary.
- Create a public key in /api/keys/public.
- Use that public key to upload/list/delete files.
Auth
Create an account, login, inspect your user, and logout.
| Method | Endpoint | Auth | Input |
|---|---|---|---|
| POST | /api/auth/register | None | JSON: name, email, password, password_confirmation |
| POST | /api/auth/login | None | JSON: email, password |
| GET | /api/user | Bearer auth-token | - |
| POST | /api/logout | Bearer auth-token | - |
Example: register
curl -X POST "https://cloudify.meraj.pro/api/auth/register" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name":"Alex",
"email":"alex@example.com",
"password":"Password123!",
"password_confirmation":"Password123!"
}'
# Response includes: user + tokenCloudinary Keys (Requires Auth)
Store Cloudinary credentials for the logged-in user.
| Method | Endpoint | Auth | Input |
|---|---|---|---|
| GET | /api/keys/cloudinary | Bearer auth-token | - |
| POST | /api/keys/cloudinary | Bearer auth-token | JSON: name (cloud_name), key (api_key), secret (api_secret) |
| GET | /api/keys/cloudinary/{id} | Bearer auth-token | - |
| PUT | /api/keys/cloudinary/{id} | Bearer auth-token | JSON: name |
| DELETE | /api/keys/cloudinary/{id} | Bearer auth-token | - |
Example: add Cloudinary key
curl -X POST "https://cloudify.meraj.pro/api/keys/cloudinary" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
-d '{
"name":"your_cloud_name",
"key":"your_api_key",
"secret":"your_api_secret"
}'Public Keys (Requires Auth)
Create project-level public keys to access file endpoints safely.
| Method | Endpoint | Auth | Input |
|---|---|---|---|
| GET | /api/keys/public | Bearer auth-token | - |
| POST | /api/keys/public | Bearer auth-token | JSON: name |
| GET | /api/keys/public/{id} | Bearer auth-token | - |
| PUT | /api/keys/public/{id} | Bearer auth-token | JSON: name |
| DELETE | /api/keys/public/{id} | Bearer auth-token | - |
Example: create a public key
curl -X POST "https://cloudify.meraj.pro/api/keys/public" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
-d '{"name":"main"}'
# Response includes generated "key" value (save it).Cloudinary Files (Use Public Key)
Upload, list, and delete files by logical group name.
| Method | Endpoint | Auth | Input |
|---|---|---|---|
| POST | /api/cloudinary/upload | Bearer public_key | multipart/form-data: name, images[] |
| GET | /api/cloudinary/files | Bearer public_key | query: name |
| DELETE | /api/cloudinary/files | Bearer public_key | JSON: name, files[] (upload IDs from list/upload response) |
Allowed upload types: jpg, jpeg, png, webp, gif, svg, avif.
Files are uploaded under Cloudinary folder: uploads/<name>
Example: upload images
curl -X POST "https://cloudify.meraj.pro/api/cloudinary/upload" \ -H "Accept: application/json" \ -H "Authorization: Bearer <PUBLIC_KEY>" \ -F "name=main" \ -F "images[]=@/path/to/photo-1.jpg" \ -F "images[]=@/path/to/photo-2.png"
Example: list files
curl -X GET "https://cloudify.meraj.pro/api/cloudinary/files?name=main" \ -H "Accept: application/json" \ -H "Authorization: Bearer <PUBLIC_KEY>"
Example: delete files
curl -X DELETE "https://cloudify.meraj.pro/api/cloudinary/files" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <PUBLIC_KEY>" \
-d '{"name":"main","files":[1,2,3]}'Common Errors
Quick meanings of errors beginners usually hit first.
| Status | Meaning | What to check |
|---|---|---|
| 401 | Invalid token | Use the right token type and include `Bearer` prefix. |
| 422 | Validation failed | Missing required fields like `name`, `images[]`, or bad format. |
| 507 | No usable Cloudinary storage | Add or fix Cloudinary credentials in account keys. |
| 404 | Endpoint not found | Check path starts with `/api/...` and method is correct. |