Skip to content

Create File Request

Create new file request.

Endpoint

http
POST /api/v1/requests

Parameters

Body parameters

ParameterTypeRequiredDescription
emailstringyesThe email address to send upload request link via email.
notesstringyesThe notes for the upload request recipient.
folder_idstringyesThe id of the parent folder under which upload request folder will be created. If not set, the folder with upladed files will be created in home directory.
namestringyesThe name of folder which will be created after upload request will be filled.

Request example

sh
curl --location --request POST 'https://files.ro/api/v1/requests' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
  "email": "jane@doe.com",
  "notes": "Please send me any files!",
  "folder_id": "",
  "name": "My Upload Request"
}'

Response

json
{
  "data": {
    "id": "req_123",
    "type": "upload-request",
    "attributes": {
      "folder_id": "folder_123",
      "status": "open",
      "email": "user@example.com",
      "notes": "Please upload invoices"
    },
    "relationships": {
      "folder": {
        "data": {
          "id": "folder_123",
          "type": "folder",
          "attributes": {
            "name": "Projects",
            "color": "#00BC7E",
            "emoji": null,
            "filesize": 12345678,
            "isTeamFolder": false,
            "items": 12,
            "trashed_items": 0,
            "created_at": "01. Jan. 2024",
            "updated_at": "02. Jan. 2024",
            "deleted_at": null
          },
          "relationships": {
            "shared": {
              "data": {
                "id": "share_123",
                "type": "shared",
                "attributes": {
                  "permission": "editor",
                  "protected": false,
                  "item_id": "item_123",
                  "expire_in": 24,
                  "token": "share_token",
                  "link": "https://files.ro/share/share_token",
                  "type": "folder"
                }
              }
            },
            "parent": {
              "data": {
                "type": "folder",
                "id": "folder_root",
                "attributes": {
                  "name": "Root"
                }
              }
            },
            "user": {
              "data": {
                "type": "user",
                "id": "user_123",
                "attributes": {
                  "name": "Jane Doe",
                  "avatar": "https://files.ro/storage/avatars/jane.png",
                  "color": "#00BC7E"
                }
              }
            }
          }
        }
      },
      "user": {
        "data": {
          "id": "user_123",
          "type": "user",
          "attributes": {
            "name": "Jane",
            "color": "#00BC7E",
            "avatar": "https://files.ro/storage/avatars/jane.png"
          }
        }
      }
    }
  }
}
json
{
  "type": "error",
  "message": "You are not authorized"
}
json
{
  "type": "error",
  "message": "Access Denied"
}
json
{
  "message": "The given data was invalid.",
  "errors": {
    "field": [
      "The field is required."
    ]
  }
}