Giant Context
Knowledge BaseDevelopers
Join the Waitlist

Project Files

Upload, organize, search, and manage project files.


GET

Get all places where a file is referenced

/organizations/{id}/projects/{projectId}/files/{fileId}/references

Returns a comprehensive list of all entities that reference this file across the project. This includes pages, headers, footers, blog posts, templates, sidebars, dialogs, forms, and branding settings. Useful for understanding the impact of deleting or replacing a file.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
fileIdRequired
path · stringFile ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: fileReferences } = await gc.projectFiles.getFileReferences({  id: "example-id",  projectId: "example-project-id",  fileId: "example-file-id"});
GET

Get a file folder

/organizations/{id}/projects/{projectId}/files/folders/{folderId}

Retrieves the details of a single folder in the project file manager, including its name, parent folder ID, and creation metadata.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
folderIdRequired
path · stringFolder ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: fileFolder } = await gc.projectFiles.getFileFolder({  id: "file-id",  projectId: "project-id",  folderId: "folder-id"});
PUT

Replace file content

/organizations/{id}/projects/{projectId}/files/{fileId}/content

Replaces the content of an existing text file. The file must be a text-based type (Markdown, plain text, CSV, JSON, YAML, HTML, CSS, JS, XML, SVG). The file's storage object is overwritten, its size is updated, and AI embeddings are re-generated from the new content. The file ID, URL, metadata, and all references remain unchanged.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
fileIdRequired
path · stringFile ID
BodyRequired
contentRequired
stringThe new text content for the file. Replaces the existing content entirely. The file must be a text-based type (Markdown, plain text, CSV, JSON, YAML, HTML, CSS, JS, XML, SVG).
SDKcURL
curl -X PUT "https://api.giantcontext.com/organizations/id_uuid/projects/projectId_uuid/files/fileId_uuid/content" \  -H "Authorization: Bearer $API_KEY" \  -H "Content-Type: application/json" \  -d '{  "content": "content_value"}'
GET

Read file content

/organizations/{id}/projects/{projectId}/files/{fileId}/open

Returns the actual content of a file inline — text as a string, images as base64. Use this when you need to read or analyze a file's content rather than just its metadata. Text files (Markdown, CSV, JSON, YAML, plain text, HTML, CSS, JS, XML, SVG) are returned in the 'content' field. Image files (PNG, JPG, GIF, WebP) are returned as base64 in the 'base64Content' field. Files over 10 MB or unsupported types return 404.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
fileIdRequired
path · stringFile ID
SDKcURL
curl -X GET "https://api.giantcontext.com/organizations/id_uuid/projects/projectId_uuid/files/fileId_uuid/open" \  -H "Authorization: Bearer $API_KEY"
GET

Get a file

/organizations/{id}/projects/{projectId}/files/{fileId}

Retrieves the full details of a single file in the project file manager, including its filename, MIME type, size, dimensions, storage URL, alt text, caption, and folder assignment.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
fileIdRequired
path · stringFile ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: file } = await gc.projectFiles.getFile({  id: "YOUR_ID",  projectId: "YOUR_PROJECT_ID",  fileId: "YOUR_FILE_ID"});
GET

Get file folders in a project

/organizations/{id}/projects/{projectId}/files/folders

Returns all folders in the project file manager. Optionally filter by parentId to list only child folders of a specific parent folder. Pass parentId='null' or omit it to list root-level folders. Folders are used to organize uploaded files (images, documents, media).

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: fileFolders } = await gc.projectFiles.getFileFolders({  id: "file-id",  projectId: "project-id"});
GET

Get items in trash

/organizations/{id}/projects/{projectId}/files/trash

Returns all soft-deleted files and folders currently in the project's file trash. Items remain in trash until they are restored or permanently deleted. Each item includes its original metadata and the date it was trashed.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: trash } = await gc.projectFiles.listFileTrash({  id: "file-id",  projectId: "project-id"});
POST

Save a file from text or image content

/organizations/{id}/projects/{projectId}/files/save

Saves a file to the project from raw text content (Markdown, Mermaid, CSV, JSON, YAML, plain text, etc.) or base64-encoded image data (PNG, JPG, GIF, WebP, SVG). The file is stored in the project and processed for AI embeddings (text) or image classification (images). Use this to save documents, notes, diagrams, structured data, or screenshots into the project knowledge base.

Parameters
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
BodyRequired
title
stringDisplay title for the file.
content
stringThe text content of the file. Supports plain text, Markdown, Mermaid diagrams, CSV, JSON, YAML, and other text-based formats. Use this OR base64Content.
filenameRequired
stringFilename with extension (e.g. 'notes.md', 'diagram.mmd', 'data.csv', 'screenshot.png'). The extension determines how the file is stored and processed.
folderId
stringTarget folder ID. Files are placed in the root if omitted. Takes precedence over folderPath.
isPublic
booleanWhether this file should be publicly accessible. Public files can be embedded in websites and viewed by public RAG surfaces when their grounding mode is allowed. Private files are only accessible to authenticated project members. Defaults to false for this endpoint. If grounding='context', this is coerced to true because context is public shaping material.
mimeType
stringMIME type of the content. Inferred from filename extension if not provided. Common values: text/plain, text/markdown, text/csv, application/json, text/yaml, image/png, image/jpeg.
grounding
unionHow the AI should use this file's content. Ask the user before choosing. 'fact' (default) = content the AI can cite verbatim (prices, testimonials, team bios, product specs, support docs). 'context' = public background that shapes AI-generated content but is never quoted directly (competitive research, market positioning, brand voice, strategy docs safe for public-page generation). If grounding='context', isPublic is coerced to true.
folderPath
stringSlash-delimited folder path (e.g. 'business/competitors'). Each segment is get-or-created under the prior level. Ignored if folderId is provided.
description
stringHuman-authored description of the file's content. Combined with AI vision classification to produce richer embeddings. Especially useful for screenshots and diagrams where the AI may describe the visual chrome rather than the semantic meaning.
base64Content
stringBase64-encoded binary content for image files (PNG, JPG, GIF, WebP, SVG). Use this OR content. Images are processed through the same pipeline as uploads — variants are generated, AI classification runs, and alt text/caption are auto-populated.
permissionGroup
stringOptional RBAC group identifier. Plumbed for future enforcement but not yet gated at retrieval.
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: file } = await gc.projectFiles.saveFile({  id: "file_123",  projectId: "proj_123",  data: "file_content"});
GET

Get files in a project

/organizations/{id}/projects/{projectId}/files

Returns a paginated list of files (images, documents, media) uploaded to the project file manager. Supports full-text search by filename, filtering by folder ID and MIME type, and standard pagination and sorting options. Files at the root level can be retrieved by passing folderId as 'null'.

Parameters
page
query · number
pageSize
query · number
search
query · string
folderId
query · stringFilter by folder ID (use 'null' for root)
mimeType
query · stringFilter by MIME type prefix (e.g. 'image/', 'video/', 'image/png'). Matches via SQL LIKE so 'image/' returns all images.
idRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: files } = await gc.projectFiles.getFiles({  id: "file-id",  projectId: "project-id"});

Built byHuman
This content was designed and written by a human.
    Socials
    • Discord
    • BlueSky

    © 2026 Giant Context
    PrivacyTerms of UseCookie Policy