Search documentation
karat

+

K

User Documentation ↗

Create object

POST/api/gotham/v1/objects/types/{objectType}

Creates an object for the given object type.

By default, all "representative" property types must be specified for the requested object type to be created successfully. If any representative properties are missing on initial creation, a MissingRepresentativePropertyTypes error will be raised with the missing property types as an argument.

Path parameters

objectType
string

The type of object to create.

Request body

CreateObjectRequest
object
Hide child attributes

Hide child attributes

title
string
optional

Initial title for created object; may be omitted, in which case a "default" title is assigned.

properties
list<AddInitialPropertyRequest>
optional

Initial property values to add during creation; may be left empty, in which case the object will begin with no properties.

Show child attributes

Show child attributes

AddInitialPropertyRequest
object

Adds initial property during object creation. This is similar but different from a non-initial creation in that it does not require security to be specified; instead, the security of the object being created is inherited.

Show child attributes

Show child attributes

propertyType
string

The name of the property in the API - also called the Property Type URI.

value
any

Represents the value of a property. The following table provides expected representations of scalar data types:

TypeJSON encodingExample
DateISO 8601 extended local date string"2021-05-01"
Decimalstring"2.718281828"
Doublenumber3.14159265
Integernumber238940
Longstring"58319870951433"
Stringstring"Call me Ishmael"
TimestampISO 8601 extended offset date-time string in UTC zone"2021-01-04T05:00:00Z"
security
object

Security mutation details for a component of an object - property, media, link. Specifying security overrides the system's default security when creating and updating data. If portion markings are specified, permissions may be specified. If portion markings are not specified, permissions must be specified.

This model may evolve over time for other security features.

Show child attributes

Show child attributes

portionMarkings
list<PortionMarking>
optional

Collection of classification portion markings; markings are validated against the system's Classification Based Access Control (CBAC) rules.

If invalid, an InvalidClassificationPortionMarkings error will be thrown.

If not specified, no markings will be applied.

Show child attributes

Show child attributes

PortionMarking
string

Security markings represent the level of access control that applies to a specific piece of information (e.g., object property, object title). Security markings are required upon creating a new object, and upon adding a new property to an existing object. To access information with one or more markings, the user must have access to the markings associated with that information as defined by your organization's defined security rules. Only users with the correct permissions can get, update, or delete a property with security markings.

In particular, if a user creates an object and adds a property of type with highly restricted markings, it is possible that subsequent calls to the get object properties endpoint may fail to display the highly restricted property.

Contact your Palantir administrator for more information on the markings that your organization uses.

permissions
list<PermissionItem>
optional

An optional mapping of groups to permissions allowed for the group. If not specified, the system's default is for the Everyone group to have WRITE permission, and the Administrators group to have OWNER permission.

A user will get the highest permission of any of the group they belong to. If portion markings are specified, the user must have access to all the markings specified before these permissions are applied.

Show child attributes

Show child attributes

PermissionItem
object

A mapping of a group to a permission.

Show child attributes

Show child attributes

group
object

A qualified group name as used when defining permissions. A group contains a name, and optionally a realm. The realm is required for external groups.

Show child attributes

Show child attributes

name
string

The base name of the group.

realm
string
optional

The realm of the group. Empty for internal groups.

permission
string (enum)

A permission, one of READ, WRITE, or OWNER. Each successive permission implies the previous ones, so WRITE implies READ, and OWNER implies READ and WRITE.

Enum values: READ, WRITE, OWNER

validationMode
string (enum)
optional

Validation mode when mutating Object instances. Defaults to STRICT if not specified.

STRICT mode strictly enforces ontology compliance:

  • All representative property types must be specified when creating an object.
  • No disallowed property types may be specified when creating an object or adding to an object.
  • Property values for enumeration property types must be a valid enum instance.

LENIENT mode enforces that object / property / link types exist.

Enum values: STRICT, LENIENT

Response body

CreateObjectResponse
object

Success response

Hide child attributes

Hide child attributes

primaryKey
string

The primary key/unique identifier of an object, useful for interacting with Gotham APIs to load and mutate objects.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/gotham/v1/objects/types/com.palantir.object.person" \ -d '{"title":"John Smith","properties":[{"propertyType":"com.palantir.property.name","value":{"FIRST_NAME":"John","LAST_NAME":"Smith"}},{"propertyType":"com.palantir.property.age","value":24}],"security":{"portionMarkings":["SENSITIVE"]}}'

Response

Copied!
1 2 3 { "primaryKey": "ri.gotham.111111-0.object-internal.111111" }