MechaMental
Api reference

Memories

List memories in a namespace

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id

Query Parameters

thread_id?|

Filter by thread ID

memory_type?|

Filter by memory type

include_expired?Include Expired

Include expired memories

Defaultfalse
limit?Limit

Maximum number of items to return (1-500)

Default100
Range1 <= value <= 500
cursor?|

Cursor for pagination (from previous response's next_cursor)

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "memories": [
    {
      "memory_id": "string",
      "workspace_id": "string",
      "namespace_id": "string",
      "thread_id": "string",
      "key": "string",
      "content": "string",
      "content_preview": "string",
      "memory_type": "fact",
      "memory_scope": "namespace",
      "importance": 0,
      "ttl_seconds": 0,
      "expires_at": "string",
      "metadata": {},
      "tags": [],
      "source": "augmentation",
      "source_augmentation_id": "string",
      "source_step_id": "string",
      "status": "active",
      "is_indexed": true,
      "indexed_at": "string",
      "index_error": "string",
      "index_attempts": 0,
      "embedding_model_id": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Create a new memory

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories" \  -H "Content-Type: application/json" \  -d '{    "content": "string"  }'
{
  "message": "Memory created successfully",
  "memory": {
    "memory_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "thread_id": "string",
    "key": "string",
    "content": "string",
    "content_preview": "string",
    "memory_type": "fact",
    "memory_scope": "namespace",
    "importance": 0,
    "ttl_seconds": 0,
    "expires_at": "string",
    "metadata": {},
    "tags": [],
    "source": "augmentation",
    "source_augmentation_id": "string",
    "source_step_id": "string",
    "status": "active",
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "created_at": "string",
    "updated_at": "string"
  },
  "was_upsert": false
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Clear all memories in namespace

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id

Query Parameters

confirm?Confirm

Must be true to confirm deletion

Defaultfalse

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories"
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get a memory by ID

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories/{memory_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
memory_id*Memory Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories/string"
{
  "memory_id": "string",
  "workspace_id": "string",
  "namespace_id": "string",
  "thread_id": "string",
  "key": "string",
  "content": "string",
  "content_preview": "string",
  "memory_type": "fact",
  "memory_scope": "namespace",
  "importance": 0,
  "ttl_seconds": 0,
  "expires_at": "string",
  "metadata": {},
  "tags": [],
  "source": "augmentation",
  "source_augmentation_id": "string",
  "source_step_id": "string",
  "status": "active",
  "is_indexed": true,
  "indexed_at": "string",
  "index_error": "string",
  "index_attempts": 0,
  "embedding_model_id": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Delete a memory

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories/{memory_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
memory_id*Memory Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories/string"
{
  "message": "Memory deleted successfully",
  "memory_id": "string",
  "embedding_deleted": false
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Update a memory

PUT
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories/{memory_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
memory_id*Memory Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "Memory updated successfully",
  "memory": {
    "memory_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "thread_id": "string",
    "key": "string",
    "content": "string",
    "content_preview": "string",
    "memory_type": "fact",
    "memory_scope": "namespace",
    "importance": 0,
    "ttl_seconds": 0,
    "expires_at": "string",
    "metadata": {},
    "tags": [],
    "source": "augmentation",
    "source_augmentation_id": "string",
    "source_step_id": "string",
    "status": "active",
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}
POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories/query

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories/query" \  -H "Content-Type: application/json" \  -d '{    "query": "string",    "workspace_id": "string"  }'
{
  "results": [
    {
      "memory_id": "string",
      "content": "string",
      "content_text": "string",
      "score": 0,
      "memory_type": "fact",
      "memory_scope": "namespace",
      "importance": 0,
      "thread_id": "string",
      "namespace_id": "string",
      "tags": [],
      "metadata": {},
      "created_at": "string"
    }
  ],
  "total_results": 0,
  "query": "string",
  "combined_context": "string",
  "search_scope": "thread",
  "namespace_id": "string",
  "thread_id": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Re-index all memories in namespace

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/memories/reindex

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/memories/reindex"
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

List memories for a thread

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/threads/{thread_id}/memories

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
thread_id*Thread Id

Query Parameters

memory_type?|

Filter by memory type

include_namespace?Include Namespace

Include namespace-level memories

Defaulttrue
include_expired?Include Expired

Include expired memories

Defaultfalse
limit?Limit

Maximum number of items to return (1-500)

Default100
Range1 <= value <= 500
cursor?|

Cursor for pagination (from previous response's next_cursor)

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/memories"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "memories": [
    {
      "memory_id": "string",
      "workspace_id": "string",
      "namespace_id": "string",
      "thread_id": "string",
      "key": "string",
      "content": "string",
      "content_preview": "string",
      "memory_type": "fact",
      "memory_scope": "namespace",
      "importance": 0,
      "ttl_seconds": 0,
      "expires_at": "string",
      "metadata": {},
      "tags": [],
      "source": "augmentation",
      "source_augmentation_id": "string",
      "source_step_id": "string",
      "status": "active",
      "is_indexed": true,
      "indexed_at": "string",
      "index_error": "string",
      "index_attempts": 0,
      "embedding_model_id": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Clear thread-specific memories

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/apps/{app_id}/namespaces/{namespace_id}/threads/{thread_id}/memories

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
thread_id*Thread Id

Query Parameters

confirm?Confirm

Must be true to confirm deletion

Defaultfalse

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/memories"
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}