> For the complete documentation index, see [llms.txt](https://docs.msquared.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.msquared.io/apis-and-tooling/api-reference.md).

# API Reference

Developers can use the M² REST API to interact programmatically with M² resources and services using HTTP requests.

With the API, developers can create game content and mods, list user / server data, manage pixel streaming sessions, retrieve information about their organization and projects.

M² REST API supports any programming language or framework that can send HTTP requests. Our API reference shows examples written using `Python`, `cURL` and `JavaScript`.

## Basics

### Spec

Our API is exposed as an HTTP/2-3 endpoint over TLS. All endpoints live under a dedicated customer URL (`https://{organization-id}.m2worlds.io`) and follow REST practices.

### Rate Limits

We limit the number of calls you can make over a certain period of time. When the rate limit is exceeded, an error is returned with the status `429 Too Many Requests`. Calling applications will need to handle the 429 status code and use exponential backoff or some other retry logic to decrease the rate of calls to your API.

## Endpoints

### [Accounts](/apis-and-tooling/api-reference/accounts.md)

The Accounts service allows you to manage user accounts registered within your organization, including creation, updates, and access control.

### [Key/Value Store](/apis-and-tooling/api-reference/kvstore.md)

This service provides a flexible, runtime-accessible key/value store for persisting arbitrary data. It can be used by both game clients and servers to cache, retrieve, and manage state and user data.

### [Organizations](/apis-and-tooling/api-reference/organizations.md)

Manage your organization's configuration, including associated resources such as Projects. This service helps structure how different teams and services operate within your SaaS environment.

### [Realtime](/apis-and-tooling/api-reference/realtime.md)

Provides real-time updates from the Key/Value Store via WebSockets. Ideal for live data synchronization between game clients and backend services.

### [User Profile](/apis-and-tooling/api-reference/profile.md)

DEPRECATED. Previously used to manage player profile data. This service is being phased out in favor of the more flexible Key/Value Store.

### [World Builder](/apis-and-tooling/api-reference/world-builder.md)

Controls the creation and management of World Builder content and mods. It interfaces with the Unreal Engine editor to customize cooking, packaging, and deployment for both game clients and servers.

### [Worlds](/apis-and-tooling/api-reference/worlds.md)

The Worlds service manages virtual environments, each defined by World Builder content with custom runtime settings (map selection, session duration, etc.).
