Matrix API Reference

Comprehensive technical documentation for the Matrix communication protocol APIs and integration points.

Client-Server API

Official specification for client applications interacting with Matrix homeservers.

Application Services

Framework for building custom application services that extend Matrix functionality.

API Overview

Matrix provides three primary API surfaces:

  • Client-Server API

    For end-user applications like Element to interact with Matrix homeservers.

  • Application Services

    Custom application integration layer for bridges and bots.

  • Homeserver API

    For managing and deploying your own Matrix server instance.

Authentication

OAuth 2.0

  • Standard OAuth 2.0 flow for third-party apps
  • Access tokens with configurable expiration
  • Refresh token grants

Session Tokens

  • Device-based session management
  • Revocation endpoints
  • Rate-limited to prevent brute force

Rate Limiting

API requests are rate-limited for security. Default limits vary by endpoint type:

/createRoom

5 requests per 5 minutes

/sendEvent

300 requests per minute

Contribute

Found an error or want to suggest improvements? The Matrix API documentation is open source and welcomes contributions.

View on GitHub

Ready to integrate?

View Developer Tutorials