Megaport API

Megaport offers a public API for access to all the services available through the Megaport Portal. You can use this API to automate your Megaport provisioning to save time and effort.

The Megaport API is based on REST. The API has predictable URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

The topics in this section step through the API calls needed to perform common tasks such as logging in, creating a Port, and creating a VXC from the Port to a cloud provider.

Beyond these topics, you can view a complete API reference at https://dev.megaport.com.

You can also start by watching some overview videos:

Play video   Watch an 8-minute video for an introduction to the Megaport API.
This video includes a walk-through of logging in to the Megaport Portal, acquiring documentation such as price lists and an LOA, and using the API in Postman.

Play video   Watch an 8-minute video on how to use the API to order a Port and VXC.

Environments

There are two server environments for the APIs:

  • The production environment: https://api.megaport.com
    You are responsible for any services and associated costs ordered in this system.

  • The staging (test) environment: https://api-staging.megaport.com
    You can test any action in this staging environment and the API calls and responses mirror the production system, but services will not be deployed and you will not be billed for any activity.

    Your staging portal account reflects the staging services created; however, these will be reset every 24 hours.

    You can use your production credentials to log in to the staging environment and order or edit services. (New user accounts take 24 hours before they are available for use in staging.)

Note

The requests in the API topics use the {API Server URL} variable. You can replace this with the staging URL (https://api-staging.megaport.com) or the production URL (https://api.megaport.com) depending on whether you want to test or work with your production deployment.

Getting started with the API and Postman

When writing and deploying your client-side code to call the Megaport API, you can use any language you prefer from Java to Python.

To step through the tutorials in these API topics, we recommend the Postman client with the imported Megaport Collection.

Postman is a straightforward, powerful HTTP client that helps build, test, and modify APIs. You can use it to interact with any functionality on any API. Postman Collections are simply a set of pre-built requests organized into folders, and they can be easily exported and shared with others.

Before you can get started with the Megaport Collection in Postman, you need a Megaport Account and you need to install Postman.

To set up the Megaport Collection in Postman:

  • Download the postman API collection and create a new collection.
    Click the Run In Postman button on the linked page.

Last update: