Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Project From Template

POST/api/v2/filesystem/projects/createFromTemplate
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Creates a project from a project template.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:filesystem-write.

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Request body

CreateProjectFromTemplateRequest
object
Hide child attributes

Hide child attributes

templateRid
string

The unique resource identifier (RID) of a project template.

variableValues
map<ProjectTemplateVariableId, ProjectTemplateVariableValue>
optional
Show child attributes

Show child attributes

defaultRoles
list<RoleId>
optional
Show child attributes

Show child attributes

organizationRids
list<OrganizationRid>
optional
Show child attributes

Show child attributes

projectDescription
string
optional

Response body

Project
object
Hide child attributes

Hide child attributes

rid
string

The unique resource identifier (RID) of a Project.

displayName
string

The display name of the Project. Must be unique and cannot contain a /

description
string
optional

The description associated with the Project.

documentation
string
optional

The documentation associated with the Project.

path
string

The full path to the resource, including the resource name itself

createdBy
string

The Foundry user who created this resource

updatedBy
string

The Foundry user who last updated this resource

createdTime
string

The time at which the resource was created.

updatedTime
string

The time at which the resource was most recently updated.

trashStatus
string (enum)

The trash status of the Project.

Enum values: DIRECTLY_TRASHED, ANCESTOR_TRASHED, NOT_TRASHED

spaceRid
string

The Space Resource Identifier (RID) that the Project lives in.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/filesystem/projects/createFromTemplate?preview=true" \ -d '{"variableValues":{"name":"my project name"},"organizationRids":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"defaultRoles":["8bf49052-dc37-4528-8bf0-b551cfb71268"],"templateRid":"ri.compass.main.template.c410f510-2937-420e-8ea3-8c9bcb3c1791"}'

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 { "path": "/Empyrean Airlines/My Important Project", "updatedTime": "2024-09-25T17:29:35.974Z", "updatedBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de", "createdBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de", "displayName": "My Important Project", "documentation": "project documentation", "description": "project description", "createdTime": "2024-09-25T17:29:35.974Z", "rid": "ri.compass.main.folder.01a79a9d-e293-48db-a585-9ffe221536e8", "spaceRid": "ri.compass.main.folder.a86ad5f5-3db5-48e4-9fdd-00aa3e5731ca", "trashStatus": "NOT_TRASHED" }

Error responses

Error Name
ProjectTemplateNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe project template RID referenced cannot be found.
ParametersprojectTemplateRid
DefaultRolesNotInSpaceRoleSetError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe requested default roles are not in the role set of the space for the project template.
Parameters
NotAuthorizedToApplyOrganizationError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe user is not authorized to apply at least one of the organization markings required to create the project from template.
ParametersorganizationRids
InvalidOrganizationHierarchyError CodeINVALID_ARGUMENT
Status Code400
DescriptionOrganizations on a project must also exist on the parent space. This error is thrown if the configuration of a project's organizations (on creation or subsequently) results in the project being marked with either no organizations in a marked space, or with an organization that is not present on the parent space.
ParametersorganizationRids
CreateProjectNoOwnerLikeRoleGrantError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe create project request would create a project with no principal being granted an owner-like role. As a result, there would be no user with administrative privileges over the project. A role is defined to be owner-like if it has the `compass:edit-project` operation. In the common case of the default role-set, this is just the `compass:manage` role.
ParametersgrantedRoleIds, roleSetOwnerLikeRoleIds
CreateGroupPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe user is not authorized to create the group in the organization required to create the project from template.
ParametersorganizationsWithoutPermission
AddGroupToParentGroupPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe user is not authorized to add a a group to the parent group required to create the project from template.
ParametersparentGroupsWithoutPermission
TemplateGroupNameConflictError CodeCONFLICT
Status Code409
DescriptionCreating the project from template would attempt to create new groups with names conflicting either with other new groups, or existing groups.
ParametersconflictingGroupNames
TemplateMarkingNameConflictError CodeCONFLICT
Status Code409
DescriptionCreating the project from template would attempt to create new markings with names conflicting either with other new markings, or existing markings.
ParametersconflictingMarkingNames
InvalidPrincipalIdsForGroupTemplateError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe template requested for project creation contains principal IDs that do not exist.
ParametersinvalidPrincipalIds
InvalidDescriptionError CodeINVALID_ARGUMENT
Status Code400
DescriptionEither the user has not passed a value for a template with unset project description, or has passed a value for a template with fixed project description.
Parameters
InvalidOrganizationsError CodeINVALID_ARGUMENT
Status Code400
DescriptionEither the user has not passed organizations for a template with suggested organizations, or has passed organization for a template with fixed organizations.
Parameters
MissingVariableValueError CodeINVALID_ARGUMENT
Status Code400
DescriptionA variable defined on the template requested for project creation does not have a value set in the request.
ParameterstemplateVariableId
InvalidVariableError CodeINVALID_ARGUMENT
Status Code400
DescriptionA variable referenced in the request to create project from template is not defined on the template.
ParameterstemplateVariableId
InvalidVariableEnumOptionError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe value passed in the request to create project from template for an enum type variable is not a valid option.
ParametersvariableId, invalidOption, validOptions
OrganizationsNotFoundError CodeNOT_FOUND
Status Code404
DescriptionAt least one organization RID could not be found.
ParametersorganizationRids
InvalidDefaultRolesError CodeINVALID_ARGUMENT
Status Code400
DescriptionEither the user has not passed default roles for a template with suggested default roles, or has passed default roles for a template with fixed default roles.
Parameters
CreateProjectFromTemplatePermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not createFromTemplate the Project.
Parameters
ProjectNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe given Project could not be found.
ParametersprojectRid