You can create the project of container-bound script type in Google Docs using Apps Script API. And when you have some scripts and you want to add the scripts in the project of container-bound script type, please do the following flow.
1. Create new project in Google Docs
You can create it using Method: projects.create.
Endpoint :
POST https://script.googleapis.com/v1/projects
Request body :
{
"title": string, // project name
"parentId": string, // file ID of Google Docs
}
2. Import scripts in created project
You can import the scripts in the created project using Method: projects.updateContent.
Endpoint :
PUT https://script.googleapis.com/v1/projects/{scriptId}/content
Request body :
{
"files": [
{
object(File)
}
],
}
Note :
- In order to use this API, please include
https://www.googleapis.com/auth/script.projects in the scopes.
References :
If this was not what you want, I'm sorry.