Giant Context
Giant ContextObtenez un accès anticipé

Project Trash

Review and restore trashed project resources.


POST

Restore a trash batch

/organizations/{organizationId}/projects/{projectId}/trash/batches/{batchId}/restore

Restores every trash entry that shares a batch id back to its original location. Batches are created when a single user action trashed multiple rows — for example, deleting a folder places the folder, its files, and its subfolders into the same batch. Folders are restored before files so parent-child foreign keys hold.

Parameters
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
batchIdRequired
path · stringTrash batch ID (shared by all entries created together)
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const result = await gc.projectTrash.restoreProjectTrashBatch({  organizationId: org.id,  projectId: projects[0].id,  batchId: "batch-123",});
POST

Restore an item from trash

/organizations/{organizationId}/projects/{projectId}/trash/{trashId}/restore

Restores a soft-deleted entity from the project trash back to its original location. Dynamically rebuilds the database INSERT from the stored JSONB entity snapshot. Returns the restored entity type, entity ID, and associated app ID.

Parameters
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
trashIdRequired
path · stringTrash item ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const result = await gc.projectTrash.restoreProjectTrashItem({  organizationId: org.id,  projectId: projects[0].id,  trashId: "trash-123",});
GET

Get one trashed item's entity type, deletion metadata and stored data snapshot

/organizations/{organizationId}/projects/{projectId}/trash/{trashId}

Retrieves the full details of a single item in the project trash by its trash record ID. Includes the original entity type, entity ID, name, deletion timestamp, and the stored entity data snapshot.

Parameters
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
trashIdRequired
path · stringTrash item ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const trashItem = await gc.projectTrash.getProjectTrashItem({  organizationId: org.id,  projectId: projects[0].id,  trashId: "trash-123",});
DELETE

Permanently delete an item from trash

/organizations/{organizationId}/projects/{projectId}/trash/{trashId}

Permanently and irreversibly removes an item from the project trash. For media/file items, also deletes the associated file from cloud storage. This operation cannot be undone. The item will no longer be recoverable after this action.

Parameters
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
trashIdRequired
path · stringTrash item ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const result = await gc.projectTrash.permanentDeleteProjectTrashItem({  organizationId: org.id,  projectId: projects[0].id,  trashId: "trash-123",});
GET

List soft-deleted items across a whole project, filterable by entity type

/organizations/{organizationId}/projects/{projectId}/trash

Returns a paginated list of all soft-deleted resources across the entire project, including pages, posts, files, forms, and other entities. Supports filtering by entity type to narrow results. Each trash item includes the original entity metadata, deletion timestamp, and the user who deleted it.

Parameters
page
query · numberPage number to return, 1-indexed. Defaults to 1.
pageSize
query · numberItems per page (1-100). Defaults to 10.
lite
query · stringWhen 'true', return only essential fields (id, slug, title/name) to reduce payload size. Useful for context fetching and link resolution.
sort
query · stringSort specifier as 'field:direction'. Sortable fields: name, entityType, deletedAt. Direction is 'asc' or 'desc' and defaults to 'asc'.
search
query · stringFree-text search. Matched against: name.
entityType
query · stringFilter by entityType. Operators: entityType=value (equals), entityType_ne, entityType_gt, entityType_gte, entityType_lt, entityType_lte, entityType_like (contains), entityType_isnull=true|false, entityType_has=value (jsonb array contains), entityType[]=a&entityType[]=b (in).
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const { trash } = await gc.projectTrash.listProjectTrash({  organizationId: org.id,  projectId: projects[0].id,});
DELETE

Empty all items from trash

/organizations/{organizationId}/projects/{projectId}/trash

Permanently and irreversibly deletes all items currently in the project trash. For media/file items, also removes the associated files from cloud storage. This operation cannot be undone. Returns the count of permanently deleted items.

Parameters
organizationIdRequired
path · stringOrganization ID
projectIdRequired
path · stringProject ID
SDK
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = await gc.organizations.getOrganizationBySlug({ slug: "my-org" });const { projects } = await gc.projects.listProjects({ organizationId: org.id });
const result = await gc.projectTrash.emptyProjectTrash({  organizationId: org.id,  projectId: projects[0].id,});

BuiltAutonomously With AI
This content was built autonomously. Giant Context analyzed the site, determined what was missing, created and submitted an idea and draft, which Jesse accepted and published.
[0]
Produit
  • Comment ça marche
  • Mind
  • Créer
  • Capturer
  • Cultiver
  • Optimiser
  • Publication
  • Tarifs
  • Cas d'usage

© 2026 Giant Context
Politique de confidentialitéConditions d'utilisationPolitique relative aux cookiesUtilisation acceptable
Powered by
Project Trash | Giant Context