Update Entity

Endpoint

URL: /:projectId/entities/:entityId

Method: PATCH

Authentication Required: Yes


Description

Updates an existing entity. Only the entity’s creator or a master-level user can perform this action.


Request

Path Parameters

ParameterTypeRequiredDescription
entityIdstringYesThe ID of the entity to update.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authenticated users.

Body Parameters

FieldTypeRequiredDescription
titlestringNoUpdated title of the entity.
contentstringNoUpdated content.
attachmentsarrayNoUpdated attachments.
keywordsarrayNoUpdated list of keywords.
locationobjectNoUpdated location { longitude: number, latitude: number }.
metadataobjectNoUpdated metadata.
mentionsarrayNoUpdated mentions list with objects like { id: string }.

Example Request

PATCH /entities/abc123
 
{
  "title": "Updated Entity Title",
  "keywords": ["update", "example"],
  "metadata": { "color": "blue" },
  "location": {
    "longitude": -73.935242,
    "latitude": 40.73061
  }
}

Response

Success Response (200 OK)

Returns the updated entity object:

{
  "id": "abc123",
  "title": "Updated Entity Title",
  "content": "...",
  "keywords": ["update", "example"],
  "metadata": { "color": "blue" },
  "location": {
    "type": "Point",
    "coordinates": [-73.935242, 40.73061]
  },
  ...
}

Error Responses

Missing Entity ID (400 Bad Request)

{
  "error": "Missing entityId in request.",
  "code": "entity/invalid-id"
}

Unauthorized (403 Forbidden)

{
  "error": "User is not authorized to update this entity.",
  "code": "entity/unauthorized"
}

Entity Not Found (404 Not Found)

{
  "error": "Entity not found.",
  "code": "entity/not-found"
}

Server Error (500 Internal Server Error)

{
  "error": "Internal server error.",
  "code": "entity/server-error",
  "details": "<Error message>"
}

Notes

  • Fields not included in the request body will remain unchanged.
  • The location field, if updated, must include both longitude and latitude.
  • A webhook validateEntityUpdated is triggered before the update is applied.