Project Files
Upload, organize, search, and manage project files.
Restore an item from trash
/organizations/{organizationId}/projects/{projectId}/files/trash/{itemId}/restore- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- itemIdRequired
- path · string
- typeRequired
- union
- restoreContents
- boolean
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.restoreFileTrashItem({ organizationId: orgs[0].id, projectId: projects[0].id, itemId: "item-id", data: {}});
List places where a file is referenced
/organizations/{organizationId}/projects/{projectId}/files/{fileId}/references- page
- query · number
- pageSize
- query · number
- lite
- query · string
- sort
- query · string
- search
- query · string
- type
- query · string
- id
- query · string
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- fileIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { references } = await gc.projectFiles.listFileReferences({ organizationId: orgs[0].id, projectId: projects[0].id, fileId: "file_123",});
Get one folder's name and parent; use listFiles with folderId to see its files
/organizations/{organizationId}/projects/{projectId}/files/folders/{folderId}- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- folderIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { folder } = await gc.projectFiles.getFileFolder({ organizationId: orgs[0].id, projectId: projects[0].id, folderId: "your-folder-id",});
Delete a file folder (files are moved to root)
/organizations/{organizationId}/projects/{projectId}/files/folders/{folderId}- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- folderIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.deleteFileFolder({ organizationId: orgs[0].id, projectId: projects[0].id, folderId: "folder-id",});
Replace a text file's content in place; id, URL and references stay unchanged
/organizations/{organizationId}/projects/{projectId}/files/{fileId}/content- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- fileIdRequired
- path · string
- 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).
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.replaceFileContent({ organizationId: orgs[0].id, projectId: projects[0].id, fileId: "your-file-id", data: "new-file-content",});
Permanently delete an item from trash
/organizations/{organizationId}/projects/{projectId}/files/trash/{itemId}- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- itemIdRequired
- path · string
- typeRequired
- union
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.permanentDeleteFileTrashItem({ organizationId: orgs[0].id, projectId: projects[0].id, itemId: "item-id", data: {}});
Open a file's content inline: text as string, images as base64, 10 MB cap
/organizations/{organizationId}/projects/{projectId}/files/{fileId}/open- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- fileIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.openFile({ organizationId: orgs[0].id, projectId: projects[0].id, fileId: "file-123",});
Empty trash (permanently delete old items)
/organizations/{organizationId}/projects/{projectId}/files/trash/empty- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- olderThanDays
- integer
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.emptyFileTrash({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Get one file's metadata only (URL, type, size, folder); openFile returns the content
/organizations/{organizationId}/projects/{projectId}/files/{fileId}- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- fileIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });const { files } = await gc.projectFiles.listProjectFiles({ organizationId: orgs[0].id, projectId: projects[0].id,});
const { file } = await gc.projectFiles.getFile({ organizationId: orgs[0].id, projectId: projects[0].id, fileId: files[0].id,});
Delete a file
/organizations/{organizationId}/projects/{projectId}/files/{fileId}- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- fileIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const response = await gc.projectFiles.deleteFile({ organizationId: orgs[0].id, projectId: projects[0].id, fileId: "file_123",});
List file folders in a project
/organizations/{organizationId}/projects/{projectId}/files/folders- page
- query · number
- pageSize
- query · number
- lite
- query · string
- sort
- query · string
- search
- query · string
- parentId
- query · string
- name
- query · string
- createdBy
- query · string
- createdAt
- query · string
- updatedAt
- query · string
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { folders } = await gc.projectFiles.listFileFolders({ organizationId: orgs[0].id, projectId: projects[0].id,});
Search file contents by meaning; returns matching snippet and relevance score per file
/organizations/{organizationId}/projects/{projectId}/files/search- page
- query · number
- pageSize
- query · number
- lite
- query · string
- sort
- query · string
- search
- query · string
- mimeType
- query · string
- similarity
- query · string
- filename
- query · string
- queryRequired
- query · string
- limit
- query · number
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { files } = await gc.projectFiles.searchFiles({ organizationId: orgs[0].id, projectId: projects[0].id, query: "example search query"});
List a project's trashed files and folders, restorable until permanently deleted
/organizations/{organizationId}/projects/{projectId}/files/trash- page
- query · number
- pageSize
- query · number
- lite
- query · string
- sort
- query · string
- search
- query · string
- type
- query · string
- mimeType
- query · string
- parentId
- query · string
- deletedBy
- query · string
- deletedAt
- query · string
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { files } = await gc.projectFiles.listFileTrash({ organizationId: orgs[0].id, projectId: projects[0].id,});
Save a file from text or image content
/organizations/{organizationId}/projects/{projectId}/files/save- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- 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. Use this OR content. Images (PNG, JPG, GIF, WebP, SVG) get variants, AI classification and auto-populated alt text and caption. DOCUMENTS ARE ALSO ACCEPTED — PDF, Word (.docx, .doc), Excel (.xlsx, .xls) — and their text is extracted and embedded into the knowledge base exactly as a console upload would. Set mimeType accordingly (application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) or let it be inferred from the filename extension. Base64 costs roughly one token per three bytes of file, so this is bounded by what the caller can afford to hold, not by the format.
- permissionGroup
- stringOptional RBAC group identifier. Plumbed for future enforcement but not yet gated at retrieval.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.projectFiles.saveFile({ organizationId: orgs[0].id, projectId: projects[0].id, data: "file content",});
List a project's files, with search, filtering and sorting
/organizations/{organizationId}/projects/{projectId}/files- page
- query · number
- pageSize
- query · number
- lite
- query · string
- sort
- query · string
- search
- query · string
- isPublic
- query · string
- grounding
- query · string
- mimeType
- query · string
- folderId
- query · string
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { files } = await gc.projectFiles.listFiles({ organizationId: orgs[0].id, projectId: projects[0].id,});