MechaMental
Api reference

Namespaces

List Namespaces

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

Path Parameters

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

Query Parameters

search?|

Search by name or description

limit?Limit

Maximum number of items to return (1-200)

Default50
Range1 <= value <= 200
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"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "namespaces": [
    {
      "namespace_id": "string",
      "name": "string",
      "description": "string",
      "app_id": "string",
      "workspace_id": "string",
      "environment_id": "string",
      "embedding_model_id": "string",
      "extraction_model_id": "string",
      "auto_extract_entities": false,
      "is_private": false,
      "index_threads": false,
      "episodes_enabled": false,
      "episode_config": {},
      "status": "active",
      "context_type": "string",
      "tags": [
        "string"
      ],
      "thread_ids": [
        "string"
      ],
      "source_ids": [
        "string"
      ],
      "memory_vault_id": "string",
      "node_ids": [
        "string"
      ],
      "reindex_status": "string",
      "reindex_started_at": "string",
      "reindex_completed_at": "string",
      "reindex_progress": {},
      "reindex_error": "string",
      "created_by": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "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 Namespace

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App 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" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "environment_id": "string"  }'
{
  "message": "Namespace created successfully",
  "namespace": {
    "namespace_id": "string",
    "name": "string",
    "description": "string",
    "app_id": "string",
    "workspace_id": "string",
    "environment_id": "string",
    "embedding_model_id": "string",
    "extraction_model_id": "string",
    "auto_extract_entities": false,
    "is_private": false,
    "index_threads": false,
    "episodes_enabled": false,
    "episode_config": {},
    "status": "active",
    "context_type": "string",
    "tags": [
      "string"
    ],
    "thread_ids": [
      "string"
    ],
    "source_ids": [
      "string"
    ],
    "memory_vault_id": "string",
    "node_ids": [
      "string"
    ],
    "reindex_status": "string",
    "reindex_started_at": "string",
    "reindex_completed_at": "string",
    "reindex_progress": {},
    "reindex_error": "string",
    "created_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "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 Namespace

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

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 GET "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string"
{
  "namespace_id": "string",
  "name": "string",
  "description": "string",
  "app_id": "string",
  "workspace_id": "string",
  "environment_id": "string",
  "embedding_model_id": "string",
  "extraction_model_id": "string",
  "auto_extract_entities": false,
  "is_private": false,
  "index_threads": false,
  "episodes_enabled": false,
  "episode_config": {},
  "status": "active",
  "context_type": "string",
  "tags": [
    "string"
  ],
  "thread_ids": [
    "string"
  ],
  "source_ids": [
    "string"
  ],
  "memory_vault_id": "string",
  "node_ids": [
    "string"
  ],
  "reindex_status": "string",
  "reindex_started_at": "string",
  "reindex_completed_at": "string",
  "reindex_progress": {},
  "reindex_error": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "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 Namespace

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

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 DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string"
{
  "message": "Namespace deleted successfully"
}
{
  "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 Namespace

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

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 PUT "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "Namespace updated successfully",
  "namespace": {
    "namespace_id": "string",
    "name": "string",
    "description": "string",
    "app_id": "string",
    "workspace_id": "string",
    "environment_id": "string",
    "embedding_model_id": "string",
    "extraction_model_id": "string",
    "auto_extract_entities": false,
    "is_private": false,
    "index_threads": false,
    "episodes_enabled": false,
    "episode_config": {},
    "status": "active",
    "context_type": "string",
    "tags": [
      "string"
    ],
    "thread_ids": [
      "string"
    ],
    "source_ids": [
      "string"
    ],
    "memory_vault_id": "string",
    "node_ids": [
      "string"
    ],
    "reindex_status": "string",
    "reindex_started_at": "string",
    "reindex_completed_at": "string",
    "reindex_progress": {},
    "reindex_error": "string",
    "created_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "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
}

Reindex Namespace

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

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/reindex" \  -H "Content-Type: application/json" \  -d '{    "new_embedding_model_id": "string"  }'
{
  "namespace_id": "string",
  "name": "string",
  "description": "string",
  "app_id": "string",
  "workspace_id": "string",
  "environment_id": "string",
  "embedding_model_id": "string",
  "extraction_model_id": "string",
  "auto_extract_entities": false,
  "is_private": false,
  "index_threads": false,
  "episodes_enabled": false,
  "episode_config": {},
  "status": "active",
  "context_type": "string",
  "tags": [
    "string"
  ],
  "thread_ids": [
    "string"
  ],
  "source_ids": [
    "string"
  ],
  "memory_vault_id": "string",
  "node_ids": [
    "string"
  ],
  "reindex_status": "string",
  "reindex_started_at": "string",
  "reindex_completed_at": "string",
  "reindex_progress": {},
  "reindex_error": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "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
}

Add Thread To Namespace

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
thread_id*Thread 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/threads/string"
{
  "namespace_id": "string",
  "name": "string",
  "description": "string",
  "app_id": "string",
  "workspace_id": "string",
  "environment_id": "string",
  "embedding_model_id": "string",
  "extraction_model_id": "string",
  "auto_extract_entities": false,
  "is_private": false,
  "index_threads": false,
  "episodes_enabled": false,
  "episode_config": {},
  "status": "active",
  "context_type": "string",
  "tags": [
    "string"
  ],
  "thread_ids": [
    "string"
  ],
  "source_ids": [
    "string"
  ],
  "memory_vault_id": "string",
  "node_ids": [
    "string"
  ],
  "reindex_status": "string",
  "reindex_started_at": "string",
  "reindex_completed_at": "string",
  "reindex_progress": {},
  "reindex_error": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "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
}

Remove Thread From Namespace

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
app_id*App Id
namespace_id*Namespace Id
thread_id*Thread 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/threads/string"
{
  "namespace_id": "string",
  "name": "string",
  "description": "string",
  "app_id": "string",
  "workspace_id": "string",
  "environment_id": "string",
  "embedding_model_id": "string",
  "extraction_model_id": "string",
  "auto_extract_entities": false,
  "is_private": false,
  "index_threads": false,
  "episodes_enabled": false,
  "episode_config": {},
  "status": "active",
  "context_type": "string",
  "tags": [
    "string"
  ],
  "thread_ids": [
    "string"
  ],
  "source_ids": [
    "string"
  ],
  "memory_vault_id": "string",
  "node_ids": [
    "string"
  ],
  "reindex_status": "string",
  "reindex_started_at": "string",
  "reindex_completed_at": "string",
  "reindex_progress": {},
  "reindex_error": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "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
}