> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.megaport.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.megaport.ferndocs.com/_mcp/server.

# Create a Managed Account

POST https://api.megaport.com/v2/managedCompanies
Content-Type: application/json

As a Megaport Partner, use this endpoint to create a new managed company account.

The parameters are defined in the Body of the request:

- `accountName` â€“ A unique, easily identifiable name for the account. The length can range from 1 to 128 characters (Required - string).
    
- `accountRef` - A reference ID for the managed account. The `accountRef` is typically an identifier used in partner systems (for example, CRM or billing). This value is shown on the invoices as the Managed Account Reference. The `accountRef` also identifies the account in email notifications. (The `accountRef` value maps to the Managed Account UID in the Portal interface.) (Required - string).
    
- `techSupportEmail` - The email address for technical support. This is used for communication regarding technical issues or inquiries. It should be a valid email format (Optional - string).
    
- `techSupportPhone` - The phone number for technical support. This is used for communication regarding technical issues or inquiries. It should be in a valid phone number format (Optional - string).
    
- `markets` - An array of objects that identify the managed account, including `marketCode`, `currency`, `taxId`, and `taxAddress`. The `taxAddress` object represents a Google Address DTO (Data Transfer Object). It contains various properties related to an address, such as latitude, longitude, street name, postcode, and more. Each property provides specific details about the address, which can be used in various applications or services (Optional - array).
    
- `resellerName` - The name of the reseller associated with the company (Optional - string).
    
- `resourceLimits` - The maximum number of services allowed to be ordered for a given product type. Resource limits can only be configured for these product types: MEGAPORT, MVE, MCR2, NAT_GATEWAY, IX, VXC (Optional - array).
    

A successful call returns a `companyUid` for the new company entry. You use the `companyUid` to reference this company in other API calls, and to act on behalf of the company.

Reference: https://en.megaport.ferndocs.com/api-reference/partner-api-for-managed-accounts/create-a-managed-account

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Body (application/json)

This endpoint expects an object.

- `accountName` (string, optional)
- `accountRef` (string, optional)

## Response

### 200

Create a Managed Account - Full Details / Create a Managed Account - Name and Reference / Create a Managed Account - Full Details / Create a Managed Account - Name and Reference

- `data` (V2ManagedCompaniesPostResponsesContentApplicationJsonSchemaData, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Types

### V2ManagedCompaniesPostResponsesContentApplicationJsonSchemaData

- `accountManagementEmail` (string, optional)
- `accountName` (string, optional)
- `accountRef` (string, optional)
- `companyId` (double, optional)
- `companyUid` (string, optional)
- `customerSuccessManagerEmail` (string, optional)
- `resourceLimits` (list of V2ManagedCompaniesPostResponsesContentApplicationJsonSchemaDataResourceLimitsItems, optional)
- `techSupportEmail` (string, optional)
- `techSupportPhone` (string, optional)

### V2ManagedCompaniesPostResponsesContentApplicationJsonSchemaDataResourceLimitsItems

- `currentCount` (double, optional)
- `limit` (double, optional)
- `productType` (string, optional)

## Examples

### Create a Managed Account - Full Details

**Response**

```json
{
  "data": {
    "accountManagementEmail": "user@example.com",
    "accountName": "Best Company Ever",
    "accountRef": "555-1212-0317-1967",
    "companyId": 0,
    "companyUid": "fd404dc9-9efd-43c1-9e0b-a58a9d250130",
    "customerSuccessManagerEmail": "user@example.com",
    "resourceLimits": [
      {
        "currentCount": 8,
        "limit": 10,
        "productType": "MEGAPORT"
      }
    ],
    "techSupportEmail": "user@example.com",
    "techSupportPhone": "5551234"
  },
  "message": "New managed company has been successfully created.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Create a Managed Account - Full Details
import requests

url = "https://api.megaport.com/v2/managedCompanies"

response = requests.post(url)

print(response.json())
```

```javascript Create a Managed Account - Full Details
const url = 'https://api.megaport.com/v2/managedCompanies';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a Managed Account - Full Details
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/managedCompanies"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a Managed Account - Full Details
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/managedCompanies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Create a Managed Account - Full Details
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v2/managedCompanies")
  .asString();
```

```php Create a Managed Account - Full Details
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v2/managedCompanies');

echo $response->getBody();
```

```csharp Create a Managed Account - Full Details
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/managedCompanies");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Create a Managed Account - Full Details
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/managedCompanies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create a Managed Account - Name and Reference

**Response**

```json
{
  "data": {
    "accountName": "Best Company Ever",
    "accountRef": "555-1212-0317-1967",
    "companyUid": "699deae1-8704-475b-b3df-9ec2b795a019"
  },
  "message": "New managed company has been successfully created.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Create a Managed Account - Name and Reference
import requests

url = "https://api.megaport.com/v2/managedCompanies"

response = requests.post(url)

print(response.json())
```

```javascript Create a Managed Account - Name and Reference
const url = 'https://api.megaport.com/v2/managedCompanies';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a Managed Account - Name and Reference
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/managedCompanies"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a Managed Account - Name and Reference
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/managedCompanies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Create a Managed Account - Name and Reference
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v2/managedCompanies")
  .asString();
```

```php Create a Managed Account - Name and Reference
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v2/managedCompanies');

echo $response->getBody();
```

```csharp Create a Managed Account - Name and Reference
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/managedCompanies");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Create a Managed Account - Name and Reference
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/managedCompanies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create a Managed Account

**Request**

```json
{
  "accountName": "Best Company Ever",
  "accountRef": "555-1212-0317-1967"
}
```

**Response**

```json
{
  "data": {
    "accountManagementEmail": "user@example.com",
    "accountName": "Best Company Ever",
    "accountRef": "555-1212-0317-1967",
    "companyId": 0,
    "companyUid": "fd404dc9-9efd-43c1-9e0b-a58a9d250130",
    "customerSuccessManagerEmail": "user@example.com",
    "resourceLimits": [
      {
        "currentCount": 8,
        "limit": 10,
        "productType": "MEGAPORT"
      }
    ],
    "techSupportEmail": "user@example.com",
    "techSupportPhone": "5551234"
  },
  "message": "New managed company has been successfully created.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Create a Managed Account
import requests

url = "https://api.megaport.com/v2/managedCompanies"

payload = {
    "accountName": "Best Company Ever",
    "accountRef": "555-1212-0317-1967"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a Managed Account
const url = 'https://api.megaport.com/v2/managedCompanies';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"accountName":"Best Company Ever","accountRef":"555-1212-0317-1967"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a Managed Account
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/managedCompanies"

	payload := strings.NewReader("{\n  \"accountName\": \"Best Company Ever\",\n  \"accountRef\": \"555-1212-0317-1967\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a Managed Account
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/managedCompanies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"accountName\": \"Best Company Ever\",\n  \"accountRef\": \"555-1212-0317-1967\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create a Managed Account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v2/managedCompanies")
  .header("Content-Type", "application/json")
  .body("{\n  \"accountName\": \"Best Company Ever\",\n  \"accountRef\": \"555-1212-0317-1967\"\n}")
  .asString();
```

```php Create a Managed Account
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v2/managedCompanies', [
  'body' => '{
  "accountName": "Best Company Ever",
  "accountRef": "555-1212-0317-1967"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create a Managed Account
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/managedCompanies");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"accountName\": \"Best Company Ever\",\n  \"accountRef\": \"555-1212-0317-1967\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a Managed Account
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "accountName": "Best Company Ever",
  "accountRef": "555-1212-0317-1967"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/managedCompanies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```