Skip to content
Primary navigation

Archive project

client.Admin.Organization.Projects.Archive(ctx, projectID) (*Project, error)
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
type Project struct{…}

Represents an individual project.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

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

formatunixtime
Object OrganizationProject

The object type, which is always organization.project

ArchivedAt int64Optional

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

formatunixtime
ExternalKeyID stringOptional

The external key associated with the project.

Name stringOptional

The name of the project. This appears in reporting.

Status stringOptional

active or archived

Archive project

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAdminAPIKey("My Admin API Key"),
  )
  project, err := client.Admin.Organization.Projects.Archive(context.TODO(), "project_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
}