FugokuFugoku Docs
Mask

Files

Versioned file storage for project resources

Files

Store, version, and manage files within your project. Files support versioning — each update creates a new version while preserving the previous content.

List Files

GET /v1/files

Returns all non-deleted files for the current project.

curl https://api.fugoku.com/v1/files \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"

Response:

{
  "data": [
    {
      "id": "file-abc123",
      "path": "/configs/app.yaml",
      "name": "app.yaml",
      "size": 2048,
      "mimeType": "text/yaml",
      "status": "synced",
      "currentVersion": 3,
      "createdAt": "2026-08-01T00:00:00.000Z",
      "updatedAt": "2026-08-15T00:00:00.000Z"
    }
  ]
}

Get File

GET /v1/files/:id
curl https://api.fugoku.com/v1/files/file-abc123 \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"

List File Versions

GET /v1/files/:id/versions

Returns all versions of a file, ordered by version number.

curl https://api.fugoku.com/v1/files/file-abc123/versions \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"

Response:

{
  "data": [
    {
      "id": "fv-abc123",
      "version": 1,
      "content": "original content",
      "checksum": "sha256:...",
      "createdAt": "2026-08-01T00:00:00.000Z"
    },
    {
      "id": "fv-def456",
      "version": 2,
      "content": "updated content",
      "checksum": "sha256:...",
      "createdAt": "2026-08-10T00:00:00.000Z"
    }
  ]
}

Create File

POST /v1/files

Request Body:

FieldTypeRequiredDescription
pathstringYesFile path (e.g. /configs/app.yaml)
namestringYesFile name
mimeTypestringNoMIME type
contentanyNoInitial file content (string or JSON)
curl -X POST https://api.fugoku.com/v1/files \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/configs/app.yaml",
    "name": "app.yaml",
    "mimeType": "text/yaml",
    "content": "key: value"
  }'

Update File

PUT /v1/files/:id

Creates a new version of the file with updated content. The previous version is preserved.

Request Body:

FieldTypeDescription
contentanyNew file content (string or JSON)
curl -X PUT https://api.fugoku.com/v1/files/file-abc123 \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "content": "updated: content" }'

Delete File

DELETE /v1/files/:id

Soft-deletes the file (sets deletedAt). The file is no longer returned in list responses.

curl -X DELETE https://api.fugoku.com/v1/files/file-abc123 \
  -H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"

File Attributes

AttributeTypeDescription
pathstringFile path
namestringFile name
sizeintegerFile size in bytes
mimeTypestringMIME type
statusstringFile status (synced, pending, error)
currentVersionintegerCurrent version number (0 = no content yet)

On this page