MechaMental
Api reference

Collections

List collections in a volume

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume 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/volumes/string/collections"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "collections": [
    {
      "collection_id": "string",
      "volume_id": "string",
      "workspace_id": "string",
      "name": "string",
      "description": "string",
      "schema_def": {
        "fields": [
          {
            "name": "string",
            "type": "string",
            "required": false,
            "description": "string"
          }
        ],
        "allow_extra_fields": true
      },
      "primary_key_field": "string",
      "search_key_fields": [
        "string"
      ],
      "allow_extra_fields": true,
      "record_count": 0,
      "page_count": 0,
      "total_size_bytes": 0,
      "indexing_enabled": true,
      "status": "active",
      "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 collection in a volume

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume 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/volumes/string/collections" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "primary_key_field": "string"  }'
{
  "message": "Collection created successfully",
  "collection": {
    "collection_id": "string",
    "volume_id": "string",
    "workspace_id": "string",
    "name": "string",
    "description": "string",
    "schema_def": {
      "fields": [
        {
          "name": "string",
          "type": "string",
          "required": false,
          "description": "string"
        }
      ],
      "allow_extra_fields": true
    },
    "primary_key_field": "string",
    "search_key_fields": [
      "string"
    ],
    "allow_extra_fields": true,
    "record_count": 0,
    "page_count": 0,
    "total_size_bytes": 0,
    "indexing_enabled": true,
    "status": "active",
    "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
}

Get a collection

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection 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/volumes/string/collections/string"
{
  "collection_id": "string",
  "volume_id": "string",
  "workspace_id": "string",
  "name": "string",
  "description": "string",
  "schema_def": {
    "fields": [
      {
        "name": "string",
        "type": "string",
        "required": false,
        "description": "string"
      }
    ],
    "allow_extra_fields": true
  },
  "primary_key_field": "string",
  "search_key_fields": [
    "string"
  ],
  "allow_extra_fields": true,
  "record_count": 0,
  "page_count": 0,
  "total_size_bytes": 0,
  "indexing_enabled": true,
  "status": "active",
  "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
}

Update a collection

PATCH
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection 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 PATCH "https://loading/v1/orgs/string/workspaces/string/volumes/string/collections/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "Collection updated successfully",
  "collection": {
    "collection_id": "string",
    "volume_id": "string",
    "workspace_id": "string",
    "name": "string",
    "description": "string",
    "schema_def": {
      "fields": [
        {
          "name": "string",
          "type": "string",
          "required": false,
          "description": "string"
        }
      ],
      "allow_extra_fields": true
    },
    "primary_key_field": "string",
    "search_key_fields": [
      "string"
    ],
    "allow_extra_fields": true,
    "record_count": 0,
    "page_count": 0,
    "total_size_bytes": 0,
    "indexing_enabled": true,
    "status": "active",
    "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 collection and all its records

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection 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/volumes/string/collections/string"
{
  "message": "Collection 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
}

Query or scan records

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/records

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection Id

Query Parameters

search_key?|

Search key field name

value?|

Search key value

limit?Limit
Default50
Range1 <= value <= 200
cursor?string|null

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/volumes/string/collections/string/records"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "records": [
    {
      "record_key": "string",
      "data": {},
      "created_at": "string",
      "updated_at": "string",
      "written_by_app_id": "string",
      "written_by_execution_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
}

Insert records into a collection

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/records

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection 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/volumes/string/collections/string/records" \  -H "Content-Type: application/json" \  -d '{    "records": [      {}    ]  }'
{
  "message": "Records inserted successfully",
  "inserted_count": 0,
  "errors": [
    {}
  ]
}
{
  "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 record by primary key

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/records/{record_key}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection Id
record_key*Record Key

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/volumes/string/collections/string/records/string"
{
  "record_key": "string",
  "data": {},
  "created_at": "string",
  "updated_at": "string",
  "written_by_app_id": "string",
  "written_by_execution_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
}

Update a record by primary key

PATCH
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/records/{record_key}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection Id
record_key*Record Key

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 PATCH "https://loading/v1/orgs/string/workspaces/string/volumes/string/collections/string/records/string" \  -H "Content-Type: application/json" \  -d '{    "fields": {}  }'
{
  "message": "Record updated successfully",
  "record": {
    "record_key": "string",
    "data": {},
    "created_at": "string",
    "updated_at": "string",
    "written_by_app_id": "string",
    "written_by_execution_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
}

Delete a record by primary key

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/records/{record_key}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection Id
record_key*Record Key

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/volumes/string/collections/string/records/string"
{
  "message": "Record 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
}

Semantic search across collection records

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/volumes/{volume_id}/collections/{collection_id}/search

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
volume_id*Volume Id
collection_id*Collection 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/volumes/string/collections/string/search" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{
  "results": [
    {
      "record_key": "string",
      "collection_id": "string",
      "collection_name": "string",
      "score": 0,
      "content_preview": "string",
      "chunk_index": 0
    }
  ],
  "query": "string",
  "total": 0
}
{
  "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
}