upsertEntity
Create or update an entity using unique_key
- If no entities are matched, a new entity is created.
- If exactly one entity is matched, a PATCH-style update is applied to the existing entity.
Activity
If no activity_id query parameter is provided, implicitly creates Activity of type EntityCreated or EntityUpdated
Request
- Base URLhttps://entity.sls.epilot.io
- URLhttps://entity.sls.epilot.io/v1/entity/{slug}:upsert
- Auth
- HTTP bearer
- or API key in header x-epilot-org-id
Path parameters
URL-friendly identifier for the entity schema
Entity Type
Query parameters
Activity to include in event feed
Update the diff and entity for the custom activity included in the query. Pending state on activity is automatically ended when activity is filled.
Dry Run mode = return results but does not perform the operation.
Don't wait for updated entity to become available in Search API. Useful for large migrations
When true, enables entity validation against the entity schema.
Strict mode = return 409 if more than one entity is matched
Request body
Example request
{
"unique_key": [
"_id"
],
"entity": {
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"_org": "123",
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"_schema": "contact",
"_tags": [
"example",
"mock"
],
"_created_at": "2021-02-09T12:41:43.662Z",
"_updated_at": "2021-02-09T12:41:43.662Z",
"_acl": {
"view": [
"org:456",
"org:789"
],
"edit": [
"org:456"
],
"delete": [
"org:456"
]
},
"_manifest": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
}Response
Entity was updated
Example response
{
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"_org": "123",
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"_schema": "contact",
"_tags": [
"example",
"mock"
],
"_created_at": "2021-02-09T12:41:43.662Z",
"_updated_at": "2021-02-09T12:41:43.662Z",
"_acl": {
"view": [
"org:456",
"org:789"
],
"edit": [
"org:456"
],
"delete": [
"org:456"
]
},
"_manifest": [
"123e4567-e89b-12d3-a456-426614174000"
]
}Changes
No recorded changes to this operation across all 18 revisions of this API.