Skip to main content
POST
/
:projectId
/
entities
Create Entity
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/entities \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "<string>",
  "foreignId": "<string>",
  "sourceId": "<string>",
  "title": "<string>",
  "content": "<string>",
  "attachments": [
    {}
  ],
  "keywords": [
    {}
  ],
  "mentions": [
    {}
  ],
  "location": {
    "longitude": 123,
    "latitude": 123
  },
  "metadata": {},
  "excludeUserId": true
}'
{
  "id": "<string>",
  "userId": "<string>",
  "shortId": "<string>",
  "foreignId": "<string>",
  "sourceId": "<string>",
  "title": "<string>",
  "content": "<string>",
  "attachments": [
    {}
  ],
  "keywords": [
    {}
  ],
  "mentions": [
    {}
  ],
  "location": {
    "type": "<string>",
    "coordinates": [
      123
    ]
  },
  "metadata": {},
  "createdAt": "<string>",
  "updatedAt": "<string>"
}
Creates a new entity. Can be used with or without authentication. When authenticated, author gains reputation.

Body Parameters

userId
string
Optional ID of the user creating the entity. Must match the authenticated user.
foreignId
string
External reference ID
sourceId
string
Optional origin identifier
title
string
Title of the entity
content
string
Content body of the entity
attachments
array
Array of attachment objects
keywords
array
Array of keywords associated with the entity
mentions
array
List of mentioned users with { id: string, username: string } format
location
object
metadata
object
Optional custom metadata object
excludeUserId
boolean
If true, excludes assigning a user ID

Response

id
string
Unique entity identifier
userId
string
ID of the user who created the entity
shortId
string
Short identifier for easy sharing
foreignId
string
External reference ID if provided
sourceId
string
Origin identifier if provided
title
string
Entity title
content
string
Entity content
attachments
array
Array of attachment objects
keywords
array
Array of keywords
mentions
array
Array of mentioned users
location
object
metadata
object
Custom metadata
createdAt
string
Creation timestamp in ISO 8601 format
updatedAt
string
Last update timestamp in ISO 8601 format

Error Responses

{
  "error": "User is not authorized to create this entity.",
  "code": "entity/unauthorized"
}
{
  "error": "Invalid projectId, project does not exist.",
  "code": "report/invalid-foreign-key"
}
{
  "error": "Internal server error.",
  "code": "entity/server-error",
  "details": "<Error message>"
}

Notes

  • If userId is provided, it must match the logged-in user unless the request is from a master key.
  • Mentions will trigger a notification if the mentioned user is not the creator.
  • User reputation is updated if an authenticated user creates the entity.
I