Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Marking Category

POST/api/v2/admin/markingCategories
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 MarkingCategory.

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

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Request body

CreateMarkingCategoryRequest
object
Hide child attributes

Hide child attributes

initialPermissions
object

The initial permissions for the Marking Category. This can be changed later through MarkingCategoryPermission operations. The provided permissions must include at least one ADMINISTER role assignment.

WARNING: If you do not list your own principal ID or the ID of a Group that you are a member of as an ADMINISTER, you will create a Marking Category that you cannot administer.

Show child attributes

Show child attributes

name
string
description
string

Response body

MarkingCategory
object

The created MarkingCategory

Hide child attributes

Hide child attributes

id
string

The ID of a marking category. For user-created categories, this will be a UUID. Markings associated with Organizations are placed in a category with ID "Organization".

name
string
description
string
categoryType
string (enum)

Enum values: CONJUNCTIVE, DISJUNCTIVE

markingType
string (enum)

Enum values: MANDATORY, CBAC

markings
list<MarkingId>
optional
Show child attributes

Show child attributes

createdTime
string

The time at which the resource was created.

createdBy
string
optional

The Foundry user who created this resource

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/admin/markingCategories?preview=true" \ -d '{"name":"Customer Data","description":"Markings related to data about our customers","initialPermissions":{"organizationRids":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"roles":[{"role":"ADMINISTER","principalId":"f05f8da4-b84c-4fca-9c77-8af0b13d11de"}],"isPublic":false}}'

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 { "categoryType": "CONJUNCTIVE", "markings": [ "18212f9a-0e63-4b79-96a0-aae04df23336" ], "createdBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de", "name": "Customer Data", "description": "Markings related to data about our customers", "createdTime": "2003-05-06T12:34:56.789Z", "id": "0950264e-01c8-4e83-81a9-1a6b7f77621a", "markingType": "MANDATORY" }

Error responses

Error Name
CreateMarkingCategoryMissingInitialAdminRoleError CodeINVALID_ARGUMENT
Status Code400
DescriptionAt least one ADMINISTER role assignment must be provided when creating a marking category.
Parameters
CreateMarkingCategoryMissingOrganizationError CodeINVALID_ARGUMENT
Status Code400
DescriptionAt least one organization must be provided when creating a marking category.
Parameters
PrincipalNotFoundError CodeNOT_FOUND
Status Code404
DescriptionA principal (User or Group) with the given PrincipalId could not be found
ParametersprincipalId
CreateMarkingCategoryPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not create the MarkingCategory.
Parameters