Method: projects.create

  • This page details how to create a new, empty script project using the Apps Script API.

  • The creation is done via an HTTP POST request to https://script.googleapis.com/v1/projects.

  • The request body can include a title for the project and an optional parentId to bind the script to a specific Google Drive file.

  • A successful response will return a newly created Project instance.

  • This operation requires the https://www.googleapis.com/auth/script.projects authorization scope.

Creates a new, empty script project with no script files and a base manifest file.

HTTP request

POST https://script.googleapis.com/v1/projects

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
 "title": string,
 "parentId": string
}
Fields
title

string

The title for the project.

parentId

string

The Drive ID of a parent file that the created script project is bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or Google Slides file. If not set, a standalone script project is created.

Response body

If successful, the response body contains a newly created instance of Project .

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/script.projects

For more information, see the OAuth 2.0 Overview.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年10月31日 UTC.