Submit a team message

Submit one message turn to a team conversation and obtain a task identifier.

POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-teams/{team_id}/sessions/{context_id}/messages

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5. For private deployments, use the corresponding product API URL.

Prepare product identity and object identifiers in the same environment.

Request

curl --request POST \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-teams/$TEAM_ID/sessions/$CONTEXT_ID/messages" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"message_id":"message-example","parts":[{"kind":"text","text":"整理资料"}],"requested_member":{"agent_workspace_id":"workspace-example","agent_id":"agent-example"},"idempotency_key":"team-turn-example"}'

Parameter

Location

Type

Required

Description

workspace_id

Path

string

Yes

Current Workspace ID, consistent with the product identity and request headers in the same environment.

team_id

Path

string

Yes

Team ID from the team list or creation response.

context_id

Path

string

Yes

Team conversation ID from creation or the list.

message_id

Body

string

Yes

Nonempty message identifier with no surrounding whitespace.

parts

Body

array (message parts)

Yes

Nonempty array; see the Text part example.

requested_member

Body

object

No

Explicitly selected member reference.

idempotency_key

Body

string

Yes

Unique key for this submission. Retain it on retries; use a new key for new content.

metadata

Body

object

No

Business metadata. Runtime-reserved keys cannot be supplied.

202 means accepted. Save task_id and read the final state through Confirm task results. selection is the frozen choice for this turn, not an answer. requested_member must be a currently valid member; if omitted, selection depends on members/the selector.

Successful response

{
  "code": 0,
  "data": {
    "task_id": "task-example",
    "selection": {
      "member": {
        "agent_workspace_id": "workspace-example",
        "agent_id": "agent-example"
      },
      "reason": "explicit",
      "membership_version": 2,
      "snapshot": {
        "strategy": "explicit"
      }
    }
  }
}

Field

Type

Description

code

integer

0 on success.

data

object

Corresponding response object.

HTTP202. Returns the corresponding object; confirm writes with the corresponding read operation.

Error responses

Errors and concurrency handling distinguishes parameter, version, member/conversation state, and admission failures.

Last updated on