Link Child Account
Moves an existing individual customer account under the owner ship of an existing enterprise with the option to change its direct owner
curl --request PATCH \
--url https://api.mezmo.com/v3/enterprise/account/{account_id}/attach \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": "enterprise",
"owner": "admin@snippetfactory.com"
}
'import requests
url = "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach"
payload = {
"plan": "enterprise",
"owner": "admin@snippetfactory.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan: 'enterprise', owner: 'admin@snippetfactory.com'})
};
fetch('https://api.mezmo.com/v3/enterprise/account/{account_id}/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'plan' => 'enterprise',
'owner' => 'admin@snippetfactory.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach"
payload := strings.NewReader("{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mezmo.com/v3/enterprise/account/{account_id}/attach")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/enterprise/account/{account_id}/attach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"type": "<string>",
"page": {
"next": "<string>",
"previous": "<string>"
},
"pk": "<string>",
"links": {
"self": {
"list": {
"method": "get",
"uri": "https://api.mezmo.com/v3/enterprise/resource"
},
"detail": {
"method": "get",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"update": {
"method": "patch",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"replace": {
"method": "put",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"create": {
"method": "post",
"uri": "https://api.mezmo.com/v3/enterprise/resource"
}
},
"related": {}
}
},
"data": {
"account_id": "8aca3b99b4ee99db2c0fb6b7",
"enterprise_id": "c0c41da6c8",
"account": "b35eda6673",
"company": "Snippet Factory",
"deactivated": "2023-11-07T05:31:56Z",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": {
"type": "enterprise"
},
"quota": {
"retention": 14
},
"retention": 45,
"created": "2023-11-07T05:31:56Z",
"meta": {},
"owner": {
"user_id": "8602b169800306cb2122207e",
"firstname": "John",
"lastname": "Doe",
"email": "member@snippetfactory.com",
"name": "John Doe",
"accounts": [
"9fc4097ce3",
"f4aba3b697"
],
"enterprise_ids": [
"1905a829ed",
"810d90f7d9"
],
"verified": true
}
}
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}Authorizations
The primary authentication method for the Mezmo API.
Pass the key in the Authorization header in the format Token <ACCESS TOKEN>.
For example:
curl -H 'Authorization: Token <ACCESS TOKEN>'
This key is used for all APIs with the exception of ingest.
Path Parameters
The unique identifier of the account to attach
1 - 24Body
Object to serialize as the body of the http request
Object to serialize as the body of the http request
The new billing plan type to assign the target account once attached
4 - 50"enterprise"
Email address of the user acount who will be the new owner of the target account once it is successfully attached
"admin@snippetfactory.com"
Response
Response format containing the information of the account that was attached.
Response format containing the information of the account that was attached.
Was this page helpful?
curl --request PATCH \
--url https://api.mezmo.com/v3/enterprise/account/{account_id}/attach \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": "enterprise",
"owner": "admin@snippetfactory.com"
}
'import requests
url = "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach"
payload = {
"plan": "enterprise",
"owner": "admin@snippetfactory.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan: 'enterprise', owner: 'admin@snippetfactory.com'})
};
fetch('https://api.mezmo.com/v3/enterprise/account/{account_id}/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'plan' => 'enterprise',
'owner' => 'admin@snippetfactory.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mezmo.com/v3/enterprise/account/{account_id}/attach"
payload := strings.NewReader("{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mezmo.com/v3/enterprise/account/{account_id}/attach")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/enterprise/account/{account_id}/attach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"enterprise\",\n \"owner\": \"admin@snippetfactory.com\"\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"type": "<string>",
"page": {
"next": "<string>",
"previous": "<string>"
},
"pk": "<string>",
"links": {
"self": {
"list": {
"method": "get",
"uri": "https://api.mezmo.com/v3/enterprise/resource"
},
"detail": {
"method": "get",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"update": {
"method": "patch",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"replace": {
"method": "put",
"uri": "https://api.mezmo.com/v3/enterprise/resource/{resource_id}"
},
"create": {
"method": "post",
"uri": "https://api.mezmo.com/v3/enterprise/resource"
}
},
"related": {}
}
},
"data": {
"account_id": "8aca3b99b4ee99db2c0fb6b7",
"enterprise_id": "c0c41da6c8",
"account": "b35eda6673",
"company": "Snippet Factory",
"deactivated": "2023-11-07T05:31:56Z",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": {
"type": "enterprise"
},
"quota": {
"retention": 14
},
"retention": 45,
"created": "2023-11-07T05:31:56Z",
"meta": {},
"owner": {
"user_id": "8602b169800306cb2122207e",
"firstname": "John",
"lastname": "Doe",
"email": "member@snippetfactory.com",
"name": "John Doe",
"accounts": [
"9fc4097ce3",
"f4aba3b697"
],
"enterprise_ids": [
"1905a829ed",
"810d90f7d9"
],
"verified": true
}
}
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}
