MechaMental
Api reference

Thread Messages

List Messages

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

app_id*App Id

App ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread ID

Query Parameters

ascending?Ascending

If true, oldest first. If false, newest first.

Defaulttrue
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

curl -X GET "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/messages"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "messages": [
    {
      "message_id": "string",
      "thread_id": "string",
      "workspace_id": "string",
      "app_id": "string",
      "namespace_id": "string",
      "role": "system",
      "content": "string",
      "source": "user_input",
      "execution_id": "string",
      "augmentation_id": "string",
      "endpoint_id": "string",
      "model": "string",
      "token_count": 0,
      "prompt_tokens": 0,
      "completion_tokens": 0,
      "tool_call_id": "string",
      "tool_calls": [
        {}
      ],
      "tool_name": "string",
      "artifacts": [
        {}
      ],
      "metadata": {},
      "parent_message_id": "string",
      "created_at": "string"
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Create Message

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

app_id*App Id

App ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread 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

curl -X POST "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/messages" \  -H "Content-Type: application/json" \  -d '{    "workspace_id": "string",    "app_id": "string",    "namespace_id": "string",    "thread_id": "string",    "role": "system",    "content": "string"  }'
{
  "message_id": "string",
  "thread_id": "string",
  "workspace_id": "string",
  "app_id": "string",
  "namespace_id": "string",
  "role": "system",
  "content": "string",
  "source": "user_input",
  "execution_id": "string",
  "augmentation_id": "string",
  "endpoint_id": "string",
  "model": "string",
  "token_count": 0,
  "prompt_tokens": 0,
  "completion_tokens": 0,
  "tool_call_id": "string",
  "tool_calls": [
    {}
  ],
  "tool_name": "string",
  "artifacts": [
    {}
  ],
  "metadata": {},
  "parent_message_id": "string",
  "created_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Clear Thread Messages

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

app_id*App Id

App ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread ID

Header Parameters

authorization?string|null

Response Body

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/messages"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Conversation Context

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

app_id*App Id

App ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread 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

curl -X POST "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/messages/context" \  -H "Content-Type: application/json" \  -d '{    "workspace_id": "string",    "app_id": "string",    "namespace_id": "string",    "thread_id": "string"  }'
{
  "messages": [
    {}
  ],
  "total_tokens": 0,
  "message_count": 0,
  "truncated": false
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete Message

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

app_id*App Id

App ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread ID

message_id*Message Id

Message ID

Query Parameters

timestamp*Timestamp

Message timestamp (ISO format)

Header Parameters

authorization?string|null

Response Body

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/apps/string/namespaces/string/threads/string/messages/string?timestamp=string"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Messages Without App

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/namespaces/{namespace_id}/threads/{thread_id}/messages

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread ID

Query Parameters

ascending?Ascending

If true, oldest first. If false, newest first.

Defaulttrue
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

curl -X GET "https://loading/v1/orgs/string/workspaces/string/namespaces/string/threads/string/messages"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "messages": [
    {
      "message_id": "string",
      "thread_id": "string",
      "workspace_id": "string",
      "app_id": "string",
      "namespace_id": "string",
      "role": "system",
      "content": "string",
      "source": "user_input",
      "execution_id": "string",
      "augmentation_id": "string",
      "endpoint_id": "string",
      "model": "string",
      "token_count": 0,
      "prompt_tokens": 0,
      "completion_tokens": 0,
      "tool_call_id": "string",
      "tool_calls": [
        {}
      ],
      "tool_name": "string",
      "artifacts": [
        {}
      ],
      "metadata": {},
      "parent_message_id": "string",
      "created_at": "string"
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Create Message Without App

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

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Workspace ID

namespace_id*Namespace Id

Namespace ID

thread_id*Thread Id

Thread 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

curl -X POST "https://loading/v1/orgs/string/workspaces/string/namespaces/string/threads/string/messages" \  -H "Content-Type: application/json" \  -d '{    "workspace_id": "string",    "app_id": "string",    "namespace_id": "string",    "thread_id": "string",    "role": "system",    "content": "string"  }'
{
  "message_id": "string",
  "thread_id": "string",
  "workspace_id": "string",
  "app_id": "string",
  "namespace_id": "string",
  "role": "system",
  "content": "string",
  "source": "user_input",
  "execution_id": "string",
  "augmentation_id": "string",
  "endpoint_id": "string",
  "model": "string",
  "token_count": 0,
  "prompt_tokens": 0,
  "completion_tokens": 0,
  "tool_call_id": "string",
  "tool_calls": [
    {}
  ],
  "tool_name": "string",
  "artifacts": [
    {}
  ],
  "metadata": {},
  "parent_message_id": "string",
  "created_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}