# Cloudflare R2 Integration via LowCodeAPI

**Last Updated**: February 10, 2026

## Overview
Custom made Object Storage APIs for Cloudflare R2.

**Categories:**
- {'id': 'file-sharing-collaboration', 'name': 'File Sharing & Collaboration'}

## Base Endpoint
https://api.lowcodeapi.com/cloudflare-r2

**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`

## Authentication
**Type:** TOKEN

**Official Documentation:** https://developers.cloudflare.com/r2/api

## URL Format (Important)

LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.

### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`

### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`

### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

## API Categories

## Common Endpoints

### Generate signed url for R2

**Method:** GET
**LowCodeAPI Path:** 

**New Format URL:**
https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/cloudflare-r2/signed-url?api_token=YOUR_API_TOKEN

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| type | enum |  |
| expires_in | number |  |
| key_name | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN'
```

### Signed url for fetching file object

**Method:** GET
**LowCodeAPI Path:** 

**New Format URL:**
https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-fetch?api_token=YOUR_API_TOKEN

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| expires_in | number |  |
| key_name | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN'
```

### Signed url for uploading file object

**Method:** GET
**LowCodeAPI Path:** 

**New Format URL:**
https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-upload?api_token=YOUR_API_TOKEN

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| acl | enum |  |
| expires_in | number |  |
| key_name | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/cloudflare-r2?api_token=YOUR_API_TOKEN'
```


## Usage Examples

### Example 1: Upload a File

Uploading a file to storage:

```bash
# Upload a file - no path parameters needed
curl -X POST "https://api.lowcodeapi.com/cloudflarer2/upload?api_token=YOUR_API_TOKEN" \
  -F "file=@/path/to/your/file.jpg"

# Response returns file ID or URL
```

### Example 2: List Files

```bash
# Get list of all files
curl -X GET "https://api.lowcodeapi.com/cloudflarer2/files?api_token=YOUR_API_TOKEN"
```

### Example 3: Retrieve Specific File

```bash
# Get specific file by ID
curl -X GET "https://api.lowcodeapi.com/cloudflarer2/files/{FILE_ID}?api_token=YOUR_API_TOKEN"

# Delete file
curl -X DELETE "https://api.lowcodeapi.com/cloudflarer2/files/{FILE_ID}?api_token=YOUR_API_TOKEN"
```

## Error Handling

LowCodeAPI returns standard HTTP status codes. Common errors:

| Status Code | Description |
|-------------|-------------|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Endpoint or resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Provider API error |

All error responses include error details:

```json
{
  "data": {
    "error": {
      "message": "Error description",
      "code": "ERROR_CODE"
    }
  }
}
```

## Complete Endpoint Reference

| Endpoint | Method | Category |
|----------|--------|----------|
| Generate signed url for R2 | GET | Signed URL |
| Signed url for fetching file object | GET | Signed URL |
| Signed url for uploading file object | GET | Signed URL |

## API Definition Endpoints

You can fetch the complete API specification for this provider:

**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/cloudflare-r2/openapi'
```

**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/cloudflare-r2/definition'
```

## Response Format

All responses are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider (object or array)
  }
}
```