Skip to content
Primary navigation

Archive project

client.admin.organization.projects.archive(stringprojectID, RequestOptionsoptions?): Project { id, created_at, object, 4 more }
POST/organization/projects/{project_id}/archive

Archives a project in the organization. Archived projects cannot be used or updated.

ParametersExpand Collapse
projectID: string
ReturnsExpand Collapse
Project { id, created_at, object, 4 more }

Represents an individual project.

id: string

The identifier, which can be referenced in API endpoints

created_at: number

The Unix timestamp (in seconds) of when the project was created.

formatunixtime
object: "organization.project"

The object type, which is always organization.project

archived_at?: number | null

The Unix timestamp (in seconds) of when the project was archived or null.

formatunixtime
external_key_id?: string | null

The external key associated with the project.

name?: string | null

The name of the project. This appears in reporting.

status?: string | null

active or archived

Archive project

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const project = await client.admin.organization.projects.archive('project_id');

console.log(project.id);
{
    "id": "proj_abc",
    "object": "organization.project",
    "name": "Project DEF",
    "created_at": 1711471533,
    "archived_at": 1711471533,
    "status": "archived"
}
Returns Examples
{
    "id": "proj_abc",
    "object": "organization.project",
    "name": "Project DEF",
    "created_at": 1711471533,
    "archived_at": 1711471533,
    "status": "archived"
}