Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Project

POST/api/v2/filesystem/projects/create
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 new Project.

Note that third-party applications using this endpoint via OAuth2 cannot be associated with an Ontology SDK as this will reduce the scope of operations to only those within specified projects. When creating the application, select "No, I won't use an Ontology SDK" on the Resources page.

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

CreateProjectRequest
object
Hide child attributes

Hide child attributes

displayName
string

The display name of the Resource

description
string
optional
spaceRid
string

The unique resource identifier (RID) of a Space.

roleGrants
map<RoleId, array>
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

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 \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/filesystem/projects/create?preview=true" \ -d '{"organizationRids":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"displayName":"My Important Project","defaultRoles":["8bf49052-dc37-4528-8bf0-b551cfb71268"],"description":"project description","roleGrants":{"8bf49052-dc37-4528-8bf0-b551cfb71268":[{"principalId":"f05f8da4-b84c-4fca-9c77-8af0b13d11de","principalType":"USER"}]},"spaceRid":"ri.compass.main.folder.a86ad5f5-3db5-48e4-9fdd-00aa3e5731ca"}'

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
SpaceNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe referenced space cannot be found.
ParametersspaceRid
ProjectCreationNotSupportedError CodeINVALID_ARGUMENT
Status Code400
DescriptionProject creation is not supported in the current user's space.
ParametersspaceRid
ProjectNameAlreadyExistsError CodeCONFLICT
Status Code404
DescriptionThe requested display name for the created project is already being used in the space.
ParametersdisplayName, spaceRid
InvalidDisplayNameError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe display name of a Resource should not be exactly `.` or `..`, contain a forward slash `/` or be too long.
ParametersdisplayName
OrganizationsNotFoundError CodeNOT_FOUND
Status Code404
DescriptionAt least one organization RID could not be found.
ParametersorganizationRids
InvalidRoleIdsError CodeINVALID_ARGUMENT
Status Code400
DescriptionA roleId referenced in either default roles or role grants does not exist in the project role set for the space.
ParametersrequestedRoleIds
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
CreateProjectPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not create the Project.