Project Trash

Review and restore trashed project resources.

POST

Restore a trash batch

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

Parameters

organizationId Required
path · string
projectId Required
path · string
batchId Required
path · string

SDK

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.projectTrash.restoreProjectTrashBatch({  organizationId: orgs[0].id,  projectId: projects[0].id,  batchId: "batch-123",});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs_res = gc.me.list_my_organizations()org_id = orgs_res.organizations[0].idprojects_res = gc.projects.list_projects(organization_id=org_id)project_id = projects_res.projects[0].idresult = gc.project_trash.restore_project_trash_batch(    organization_id=org_id,    project_id=project_id,    batch_id="batch_123")
curl -X POST "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash/batches/batchId_uuid/restore" \  -H "Authorization: Bearer $API_KEY" \  -H "Content-Type: application/json" \  -d '{}'
POST

Restore a deleted entity from the project trash

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

Parameters

organizationId Required
path · string
projectId Required
path · string
trashId Required
path · string

SDK

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.projectTrash.restoreProjectTrashItem({  organizationId: orgs[0].id,  projectId: projects[0].id,  trashId: "trash-id",});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs_res = gc.me.list_my_organizations()org_id = orgs_res.organizations[0].idprojects_res = gc.projects.list_projects(organization_id=org_id)project_id = projects_res.projects[0].idresult = gc.project_trash.restore_project_trash_item(    organization_id=org_id,    project_id=project_id,    trash_id="your_trash_id_here")
curl -X POST "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash/trashId_uuid/restore" \  -H "Authorization: Bearer $API_KEY" \  -H "Content-Type: application/json" \  -d '{}'
GET

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

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

Parameters

organizationId Required
path · string
projectId Required
path · string
trashId Required
path · string

SDK

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 { trashItem } = await gc.projectTrash.getProjectTrashItem({  organizationId: orgs[0].id,  projectId: projects[0].id,  trashId: "your-trash-id",});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs = gc.me.list_my_organizations().organizationsprojects = gc.projects.list_projects(organization_id=orgs[0].id).projectstrash_item = gc.project_trash.get_project_trash_item(    organization_id=orgs[0].id,    project_id=projects[0].id,    trash_id="trash_123")
curl -X GET "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash/trashId_uuid" \  -H "Authorization: Bearer $API_KEY"
DELETE

Permanently delete an entity from the project trash

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

Parameters

organizationId Required
path · string
projectId Required
path · string
trashId Required
path · string

SDK

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.projectTrash.permanentDeleteProjectTrashItem({  organizationId: orgs[0].id,  projectId: projects[0].id,  trashId: "trash-id-123",});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs = gc.me.list_my_organizations().organizationsorg_id = orgs[0].idprojects = gc.projects.list_projects(organization_id=org_id).projectsproject_id = projects[0].idtrash_id = "trash_123"result = gc.project_trash.permanent_delete_project_trash_item(    organization_id=org_id,    project_id=project_id,    trash_id=trash_id)
curl -X DELETE "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash/trashId_uuid" \  -H "Authorization: Bearer $API_KEY"
GET

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

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

Parameters

page
query · number
pageSize
query · number
lite
query · string
sort
query · string
search
query · string
entityType
query · string
organizationId Required
path · string
projectId Required
path · string

SDK

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 { trash } = await gc.projectTrash.listProjectTrash({  organizationId: orgs[0].id,  projectId: projects[0].id,});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs = gc.me.list_my_organizations().organizationsorg_id = orgs[0].idprojects = gc.projects.list_projects(organization_id=org_id).projectsproject_id = projects[0].idtrash = gc.project_trash.list_project_trash(    organization_id=org_id,    project_id=project_id)
curl -X GET "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash" \  -H "Authorization: Bearer $API_KEY"
DELETE

Empty all items from trash

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

Parameters

organizationId Required
path · string
projectId Required
path · string

SDK

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.projectTrash.emptyProjectTrash({  organizationId: orgs[0].id,  projectId: projects[0].id,});
import osfrom giantcontext import GiantContextgc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])orgs = gc.me.list_my_organizations().organizationsorg_id = orgs[0].idprojects = gc.projects.list_projects(organization_id=org_id).projectsproject_id = projects[0].idresult = gc.project_trash.empty_project_trash(    organization_id=org_id,    project_id=project_id)
curl -X DELETE "https://api.giantcontext.com/organizations/organizationId_uuid/projects/projectId_uuid/trash" \  -H "Authorization: Bearer $API_KEY"
Built Autonomously With AI

This content was built autonomously. Giant Context analyzed the site, determined what was missing, created and submitted an idea and draft, which Giant Context staff accepted and published.

Powered by Giant Context