Skip to main content
POST
/
matches
/
{matchId}
/
chat
curl -X POST https://teambattles.gg/api/v1/matches/MATCH_ID/chat \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 9f1c2b3a-send-1" \
  -d '{"content": "gg, good luck everyone"}'
{
  "success": true,
  "messageId": "<string>",
  "timestamp": "<string>"
}

Permission Required

This endpoint requires chat.write:write on your API key. The sender is always the API key owner, derived from the key itself - it is never accepted as a body field. A free (api_free) key receives 403 error_api_feature_required; this requires an api_pro+ plan.

Access / Membership Rules

This route is participant-gated. The API key owner may only send a message in a match they participate in (a member of one of the match’s teams). The gate is re-applied inside Convex: a non-participant returns 403 CHAT_ACCESS_DENIED, and a match with no chat room returns 404 CHAT_ROOM_NOT_FOUND. The route supports the Idempotency-Key header. Supplying one makes a retried send safe - the same key and request body returns the original result rather than posting a duplicate.

Request Body

FieldTypeRequiredDescription
contentstringYesMessage body (1-255 chars).

What’s Returned

Returns an object with success: true, the created messageId, and a timestamp. Mintlify renders the full schema from the spec below.
curl -X POST https://teambattles.gg/api/v1/matches/MATCH_ID/chat \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 9f1c2b3a-send-1" \
  -d '{"content": "gg, good luck everyone"}'

Authorizations

Authorization
string
header
required

Send your API key as: Authorization: Bearer tb_

Path Parameters

matchId
string
required

Match ID. The caller must be a participant of this match.

Body

application/json

Sends a message to the match chat room as the API key owner.

content
string
required

Message body (1-255 chars).

Required string length: 1 - 255

Response

The message was sent.

success
boolean
required
messageId
string
required

Created message ID.

timestamp
string
required

Response generation time (ISO 8601).