Memokit
API Reference

Entities API

Extract and manage entities from memories

Entities API

The Entities API allows you to create, list, and manage entities extracted from memories. Entities represent people, places, organizations, and other named concepts.

Entity Object

FieldTypeDescription
idstringUnique entity identifier
namestringEntity name
typestringEntity type (PERSON, ORGANIZATION, LOCATION, etc.)
descriptionstringOptional description
metadataobjectCustom metadata
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

Entity Types

TypeDescription
PERSONA human individual
ORGANIZATIONA company, institution, or group
LOCATIONA place or geographic location
PRODUCTA product or service
EVENTAn event or occurrence
CONCEPTAn abstract concept or idea
OTHEROther entity types

Create Entity

Create a new entity.

POST /v1/entities

Request Body

FieldTypeRequiredDescription
namestringYesEntity name
typestringYesEntity type
descriptionstringNoEntity description
metadataobjectNoCustom metadata

Example Request

curl -X POST https://api.memokit.dev/v1/entities \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Smith",
    "type": "PERSON",
    "description": "Software engineer and TypeScript enthusiast",
    "metadata": {
      "department": "Engineering",
      "role": "Senior Developer"
    }
  }'

Response

{
  "id": "ent_abc123",
  "name": "John Smith",
  "type": "PERSON",
  "description": "Software engineer and TypeScript enthusiast",
  "metadata": {
    "department": "Engineering",
    "role": "Senior Developer"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

List Entities

Retrieve a paginated list of entities.

GET /v1/entities

Query Parameters

ParameterTypeRequiredDescription
typestringNoFilter by entity type
searchstringNoSearch by name
pagenumberNoPage number (default: 1)
limitnumberNoItems per page (default: 20, max: 100)

Example Request

curl -X GET "https://api.memokit.dev/v1/entities?type=PERSON&limit=10" \
  -H "Authorization: Bearer mk_your_api_key"

Response

{
  "items": [
    {
      "id": "ent_abc123",
      "name": "John Smith",
      "type": "PERSON",
      "description": "Software engineer and TypeScript enthusiast",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "ent_def456",
      "name": "Jane Doe",
      "type": "PERSON",
      "description": "Product manager",
      "createdAt": "2024-01-14T09:00:00Z",
      "updatedAt": "2024-01-14T09:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 25,
    "totalPages": 3
  }
}

Get Entity

Retrieve a specific entity by ID.

GET /v1/entities/:id

Path Parameters

ParameterTypeDescription
idstringEntity ID

Example Request

curl -X GET https://api.memokit.dev/v1/entities/ent_abc123 \
  -H "Authorization: Bearer mk_your_api_key"

Response

{
  "id": "ent_abc123",
  "name": "John Smith",
  "type": "PERSON",
  "description": "Software engineer and TypeScript enthusiast",
  "metadata": {
    "department": "Engineering",
    "role": "Senior Developer"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Delete Entity

Delete an entity permanently.

DELETE /v1/entities/:id

Path Parameters

ParameterTypeDescription
idstringEntity ID

Example Request

curl -X DELETE https://api.memokit.dev/v1/entities/ent_abc123 \
  -H "Authorization: Bearer mk_your_api_key"

Response

{
  "success": true,
  "id": "ent_abc123"
}

Error Codes

CodeDescription
ENTITY_NOT_FOUNDThe specified entity does not exist
INVALID_ENTITY_TYPEThe entity type is not valid
NAME_REQUIREDEntity name is required

On this page