Back

Miro API Essential Guide

Aug 2, 20246 minute read

What type of API does Miro provide?

What type of API does Miro provide?

Common API Types

  1. REST (Representational State Transfer):

    • REST is one of the most popular API architectures.
    • It uses standard HTTP methods (GET, POST, PUT, DELETE, etc.) for communication.
    • REST APIs are stateless and resource-based.
    • They typically use JSON or XML for data formatting.
  2. GraphQL:

    • GraphQL is a query language for APIs developed by Facebook.
    • It allows clients to request exactly the data they need.
    • GraphQL uses a single endpoint and provides more flexibility in data fetching.
  3. SOAP (Simple Object Access Protocol):

    • SOAP is an older protocol that uses XML for message formatting.
    • It's more rigid and complex compared to REST.
    • SOAP is still used in some enterprise and legacy systems.

Educated Guess about Miro's API

  • It's highly likely that Miro uses a REST API.
  • REST APIs are widely adopted in the industry due to their simplicity, scalability, and ease of use.
  • Many collaborative and productivity tools similar to Miro use REST APIs for their integrations and third-party development.

Key Points to Consider

  • To confirm the API type, it would be best to check Miro's official developer documentation.
  • Modern platforms sometimes offer multiple API types to cater to different developer needs.
  • The actual implementation may have custom elements or variations on top of the standard REST architecture.

Best Practices

  • Always refer to the official documentation for the most accurate and up-to-date information about an API.
  • When working with any API, familiarize yourself with its authentication methods, rate limits, and data formats.
  • Keep in mind that APIs can evolve, so stay updated with any changes or new versions released by the provider.

Does the Miro API have webhooks?

Current Webhook Support

  1. Miro has recently introduced webhook support in beta.

  2. As of December 2022, webhooks became available in an early beta period.

  3. Developers can now create webhook subscriptions to receive notifications about events on Miro boards.

Webhook Functionality

  1. To create a webhook subscription, you need to send a POST request to the Miro endpoint:

    POST https://api.miro.com/v2-experimental/webhooks/board_subscriptions
    
  2. When creating a webhook subscription, you need to provide a callback URL that will receive the webhook events.

  3. The callback URL must respond to a challenge sent by Miro to verify the subscription.

Available Events

While the search results don't provide a comprehensive list of available events, they mention a few examples:

  1. Item updates on a board
  2. Board renaming
  3. Adding descriptions
  4. Widget transformations (text changes, moves, color changes, tag additions/removals)

Best Practices

  1. Ensure your callback URL is functioning correctly and can respond to the challenge sent by Miro.

  2. Test your endpoint by sending a POST request to it before creating the webhook subscription.

  3. Be aware that webhook events may not be received immediately after creating the subscription, and some actions might not trigger events as expected.

Additional Information

  1. Prior to the introduction of webhooks, Miro only had event listeners in the SDK for web plugins, which had limitations such as only working when the plugin was actively running in the Miro app.

  2. The introduction of webhooks addresses the need for real-time notifications about board changes without requiring constant polling or comparison.

It's important to note that as this is a beta feature, the functionality and available events may evolve. Developers interested in using Miro webhooks should refer to the latest official documentation for the most up-to-date information.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Miro API:

  1. The overall rate limit is 100,000 credits for API calls per minute [1].

  2. Rate limiting is applied on a per user per application basis [1].

  3. Each REST API method is assigned one of 4 rate limit weight levels [1]:

    • Level 1: 50 credits per call, 2000 requests per minute
    • Level 2: 100 credits per call, 1000 requests per minute
    • Level 3: 500 credits per call, 200 requests per minute
    • Level 4: 2000 credits per call, 50 requests per minute
  4. If the rate limit is exceeded, a 429 Too Many Requests error is returned [1].

  5. The following headers are included in API responses to help track rate limit usage [1]:

    • X-RateLimit-Limit: Total credits allowed per minute
    • X-RateLimit-Remaining: Number of credits left
    • X-RateLimit-Reset: Timestamp for when credits will reset
  6. For the Web SDK, there is a separate rate limit of 10,000 points per minute for widget operations (create, update, delete) [5].

  7. The SDK does not currently have a method to track request usage against the rate limit [5].

  8. Widget creation through the SDK should fail if the rate limit is reached [5].

The rate limits are designed to allow reasonable API usage while preventing abuse. Developers should monitor their usage and implement backoff/retry logic if needed to stay within the limits.

Latest API Version

The most recent version of the Miro API is version 2 (v2). Here are the key points to consider:

Current API Version

  • Miro is currently on API version 2 (v2) [1].

Migration from v1 to v2

  • Miro has completely revamped their REST API in v2, focusing on performance, reliability, and developer experience [1].
  • Developers using v1 are encouraged to migrate to v2 for the latest features, improvements, and support [2].

Key Changes in v2

  • The polymorphic Widget API endpoints have been replaced with specific, independent API endpoints for each type of widget ("item") on a Miro board [1].
  • New capabilities in v2 include:
    • Webhooks
    • Bulk Operations
    • Mindmaps
    • Flowchart shapes
    • Resource URLs for downloading certain resources on a Miro board [1]

Migration Resources

To help developers migrate from v1 to v2, Miro has provided the following resources:

  1. Web SDK:

  2. REST API:

Important Note

  • The OAuth 2.0 endpoint (/v1/oauth) is not part of the required migration and will continue to support all versions of the Miro REST API [2].

Documentation

  • The v1 documentation has been removed and is no longer maintained. However, developers can still download the v1 documentation for historical reference if needed [2].

In summary, the most recent version of the Miro API is v2, and Miro strongly encourages all developers to migrate to this version for the latest features and support.

How to get a Miro developer account and API Keys?

Create a Developer Team

  1. Sign up for a Miro account if you don't already have one.

  2. After signing in, create a Developer team for your Miro account by:

    • Clicking your user account avatar
    • Selecting "Settings" from the drop-down menu
    • Clicking the "Your apps" tab
    • Clicking "+ Create new app" in the "Your apps" view
  3. In the "Create new team" modal, accept Miro's terms of service and click "Create team".

Create and Configure Your App

  1. In the "Create new app" modal:

    • Enter a name for your app
    • Select the "Expire user authorization token" checkbox if you want to enable expiring access tokens (recommended for security)
    • Click "Create app"
  2. Configure your app by editing the app manifest:

    • Click "Edit in Manifest" on the app settings page
    • Set the appName property
    • Set the required scopes (permissions) for your app, such as board:read and board:write
  3. Note your client ID and client secret from the app settings, as you'll need these for OAuth authentication.

Implement OAuth 2.0 Authorization

To use the Miro REST API, you need to implement the OAuth 2.0 authorization code flow:

  1. Create an authorization request link:

    https://miro.com/oauth/authorize?response_type=code&client_id={your_client_id}&redirect_uri={your_redirect_uri}
    
  2. Direct users to this link to authorize your app.

  3. After authorization, exchange the received code for an access token using a POST request to Miro's token endpoint.

  4. Use the access token in the Authorization header when making API calls.

What can you do with the Miro API?

Based on the search results provided, here's a list of data models you can interact with using the Miro API, along with what is possible for each:

Widgets / Items

  • Card

    • Create, update, get, delete card items
    • Additional type-specific endpoints for interacting with cards
  • Sticker/Sticky Note

    • Create, update, get, delete sticky note items
    • Additional type-specific endpoints for interacting with sticky notes
  • Text

    • Create, update, get, delete text items
    • Additional type-specific endpoints for interacting with text
  • Shape

    • Create, update, get, delete shape items
    • Additional type-specific endpoints for interacting with shapes
  • App Card

    • Create, update, get, delete app card items
    • Additional type-specific endpoints for interacting with app cards
  • Document

    • Create, update, get, delete document items
    • Access document URL for downloading
  • Embed

    • Create, update, get, delete embed items
    • Access preview URL for embedded content
  • Frame

    • Create, update, get, delete frame items
    • Additional type-specific endpoints for interacting with frames
  • Image

    • Create, update, get, delete image items
    • Access image URL for downloading

Tags

  • Create, update, get, delete tags
  • Associate tags with items on the board

Boards

  • Access and manipulate board data
  • Interact with board items
  • Manage board UI and viewport

Teams

  • Access team data (REST API only)

Organizations

  • Access organization data (REST API only)

Webhooks

  • Create and manage webhooks for real-time event notifications

Bulk Operations

  • Perform operations on multiple items simultaneously

Mindmaps

  • Create and manipulate mindmap structures

Flowchart shapes

  • Work with specialized shapes for flowcharts

Connectors

  • Create and manage connections between items on the board

Custom Actions

  • Define and manage custom actions for your app

Storage

  • Use storage collections for app-specific data persistence

Collaboration

  • Access collaboration features and real-time events

This list covers the main data models and interactions possible with the Miro API, based on the information provided in the search results. The API offers a wide range of capabilities for creating, updating, and managing various types of content on Miro boards, as well as accessing team and organization data.