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
}
'import requests
url = "https://api.replyke.com/api/v6/:projectId/entities"
payload = {
"userId": "<string>",
"foreignId": "<string>",
"sourceId": "<string>",
"title": "<string>",
"content": "<string>",
"attachments": [{}],
"keywords": [{}],
"mentions": [{}],
"location": {
"longitude": 123,
"latitude": 123
},
"metadata": {},
"excludeUserId": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
foreignId: '<string>',
sourceId: '<string>',
title: '<string>',
content: '<string>',
attachments: [{}],
keywords: [{}],
mentions: [{}],
location: {longitude: 123, latitude: 123},
metadata: {},
excludeUserId: true
})
};
fetch('https://api.replyke.com/api/v6/:projectId/entities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.replyke.com/api/v6/:projectId/entities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>',
'foreignId' => '<string>',
'sourceId' => '<string>',
'title' => '<string>',
'content' => '<string>',
'attachments' => [
[
]
],
'keywords' => [
[
]
],
'mentions' => [
[
]
],
'location' => [
'longitude' => 123,
'latitude' => 123
],
'metadata' => [
],
'excludeUserId' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.replyke.com/api/v6/:projectId/entities"
payload := strings.NewReader("{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.replyke.com/api/v6/:projectId/entities")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replyke.com/api/v6/:projectId/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}"
response = http.request(request)
puts response.read_body{
"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>"
}Entity Endpoints
Create Entity
Create a new entity with optional metadata, attachments, and location
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
}
'import requests
url = "https://api.replyke.com/api/v6/:projectId/entities"
payload = {
"userId": "<string>",
"foreignId": "<string>",
"sourceId": "<string>",
"title": "<string>",
"content": "<string>",
"attachments": [{}],
"keywords": [{}],
"mentions": [{}],
"location": {
"longitude": 123,
"latitude": 123
},
"metadata": {},
"excludeUserId": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
foreignId: '<string>',
sourceId: '<string>',
title: '<string>',
content: '<string>',
attachments: [{}],
keywords: [{}],
mentions: [{}],
location: {longitude: 123, latitude: 123},
metadata: {},
excludeUserId: true
})
};
fetch('https://api.replyke.com/api/v6/:projectId/entities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.replyke.com/api/v6/:projectId/entities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>',
'foreignId' => '<string>',
'sourceId' => '<string>',
'title' => '<string>',
'content' => '<string>',
'attachments' => [
[
]
],
'keywords' => [
[
]
],
'mentions' => [
[
]
],
'location' => [
'longitude' => 123,
'latitude' => 123
],
'metadata' => [
],
'excludeUserId' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.replyke.com/api/v6/:projectId/entities"
payload := strings.NewReader("{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.replyke.com/api/v6/:projectId/entities")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replyke.com/api/v6/:projectId/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\",\n \"foreignId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"attachments\": [\n {}\n ],\n \"keywords\": [\n {}\n ],\n \"mentions\": [\n {}\n ],\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"metadata\": {},\n \"excludeUserId\": true\n}"
response = http.request(request)
puts response.read_body{
"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
string
Optional ID of the user creating the entity. Must match the authenticated user.
string
External reference ID
string
Optional origin identifier
string
Title of the entity
string
Content body of the entity
array
Array of attachment objects
array
Array of keywords associated with the entity
array
List of mentioned users with
{ id: string, username: string } formatobject
Optional custom metadata object
boolean
If true, excludes assigning a user ID
Response
string
Unique entity identifier
string
ID of the user who created the entity
string
Short identifier for easy sharing
string
External reference ID if provided
string
Origin identifier if provided
string
Entity title
string
Entity content
array
Array of attachment objects
array
Array of keywords
array
Array of mentioned users
object
Custom metadata
string
Creation timestamp in ISO 8601 format
string
Last update timestamp in ISO 8601 format
Error Responses
Unauthorized - 403 Forbidden
Unauthorized - 403 Forbidden
{
"error": "User is not authorized to create this entity.",
"code": "entity/unauthorized"
}
Invalid Project ID - 400 Bad Request
Invalid Project ID - 400 Bad Request
{
"error": "Invalid projectId, project does not exist.",
"code": "report/invalid-foreign-key"
}
Server Error - 500 Internal Server Error
Server Error - 500 Internal Server Error
{
"error": "Internal server error.",
"code": "entity/server-error",
"details": "<Error message>"
}
Notes
- If
userIdis 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

