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

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

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" }