Rolebase Developers
API Reference

file

Represents a stored file in Rolebase. Files can be associated with organizations and members for purposes such as profile pictures, document storage, and attachments.

Fields

FieldTypeDescription
iduuidUnique identifier for the file (auto-generated)
bucketIdStringReference to the storage bucket
nameStringOriginal name of the file (optional)
mimeTypeStringMIME type of the file (optional)
sizeIntegerSize of the file in bytes (optional)
etagStringEntity tag for caching and conditional requests (optional)
isUploadedBooleanWhether the file has been fully uploaded (optional)
metadataJSONAdditional metadata about the file (optional)
createdAtTimestampWhen the file was created (defaults to current timestamp)
updatedAtTimestampWhen the file was last updated (defaults to current timestamp)
uploadedByUserIduuidReference to the user who uploaded the file (optional)

Relationships

Object Relationships

  • bucket — The storage bucket containing the file

Array Relationships

  • members — Members using this file (e.g., as a profile picture)
  • orgs — Organizations associated with this file

Storage Buckets

Files are stored in buckets that define storage parameters:

  • cacheControl — Cache control settings
  • downloadExpiration — Download link expiration time
  • maxUploadFileSize — Maximum allowed file size
  • minUploadFileSize — Minimum allowed file size
  • presignedUrlsEnabled — Whether presigned URLs are enabled for secure temporary access

Query Examples

Get a Specific File

query GetFile($id: uuid!) {
  file(id: $id) {
    id
    name
    mimeType
    size
    createdAt
    metadata
  }
}

Permissions

File access is open to all authenticated users and public requests:

  • View — All authenticated users and public requests can view file metadata (limited to 1 result)
  • Create — All authenticated users can upload files

Files are stored securely in configurable storage buckets. Presigned URLs enable secure temporary access, and MIME type validation ensures proper file handling. ETags support caching and conditional requests for efficient file delivery.