Perform bulk operations on Enterprise Accounts
Perform bulk operations (CREATE, UPDATE, DELETE) on Enterprise Accounts
curl --request PATCH \
--url https://api.mezmo.com/v3/enterprise/account \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-bulk+json' \
--data '
{
"operations": [
{
"operation_id": "4b1a1504fa47866dafe8b5d4",
"entity_id": "471ef1c4154b987a94509213",
"entity": {
"company": "Snippet Factory",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": {
"type": "enterprise"
},
"retention": 7,
"enable_syslog": false,
"include_admins": false
}
}
]
}
'import requests
url = "https://api.mezmo.com/v3/enterprise/account"
payload = { "operations": [
{
"operation_id": "4b1a1504fa47866dafe8b5d4",
"entity_id": "471ef1c4154b987a94509213",
"entity": {
"company": "Snippet Factory",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": { "type": "enterprise" },
"retention": 7,
"enable_syslog": False,
"include_admins": False
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-bulk+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/x-bulk+json'},
body: JSON.stringify({
operations: [
{
operation_id: '4b1a1504fa47866dafe8b5d4',
entity_id: '471ef1c4154b987a94509213',
entity: {
company: 'Snippet Factory',
owneremail: 'admin@snippetfactory.com',
external_id: 'd615396c40',
plan: {type: 'enterprise'},
retention: 7,
enable_syslog: false,
include_admins: false
}
}
]
})
};
fetch('https://api.mezmo.com/v3/enterprise/account', 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",
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([
'operations' => [
[
'operation_id' => '4b1a1504fa47866dafe8b5d4',
'entity_id' => '471ef1c4154b987a94509213',
'entity' => [
'company' => 'Snippet Factory',
'owneremail' => 'admin@snippetfactory.com',
'external_id' => 'd615396c40',
'plan' => [
'type' => 'enterprise'
],
'retention' => 7,
'enable_syslog' => false,
'include_admins' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-bulk+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"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-bulk+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")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-bulk+json")
.body("{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/enterprise/account")
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/x-bulk+json'
request.body = "{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}{
"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": {
"operations": [
{
"operation_id": "408efce8aa57bd0d8a861298",
"entity_id": "cb7b7c1f5100d2d5d31ad4f1",
"entity": {
"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": {}
},
"result": {
"detail": "Account created successfully",
"context": [
{
"message": "Account not found",
"code": "ECONTRACT"
}
]
}
}
]
}
}{
"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
}
]
}{
"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": {
"operations": [
{
"operation_id": "408efce8aa57bd0d8a861298",
"entity_id": "cb7b7c1f5100d2d5d31ad4f1",
"entity": {
"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": {}
},
"result": {
"detail": "Account created successfully",
"context": [
{
"message": "Account not found",
"code": "ECONTRACT"
}
]
}
}
]
}
}{
"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.
Body
Request body for bulk operations on accounts
Request body for bulk operations on accounts
List of bulk operations
1 - 100 elementsShow child attributes
Show child attributes
Response
A normalized representation of an error that is returned from an http request in response to failed input validation
A normalized representation of an error that is returned from an http request in response to failed input validation
The HTTP status code the error is associated with
300 <= x <= 599A textual classifier of the error or failure
35A message describing the nature of the error or failure
200The portion of the inbound request which triggered the validation failure
body, querystring, params, headers List of metadata objects describing validation failures or contextual information
200Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://api.mezmo.com/v3/enterprise/account \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-bulk+json' \
--data '
{
"operations": [
{
"operation_id": "4b1a1504fa47866dafe8b5d4",
"entity_id": "471ef1c4154b987a94509213",
"entity": {
"company": "Snippet Factory",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": {
"type": "enterprise"
},
"retention": 7,
"enable_syslog": false,
"include_admins": false
}
}
]
}
'import requests
url = "https://api.mezmo.com/v3/enterprise/account"
payload = { "operations": [
{
"operation_id": "4b1a1504fa47866dafe8b5d4",
"entity_id": "471ef1c4154b987a94509213",
"entity": {
"company": "Snippet Factory",
"owneremail": "admin@snippetfactory.com",
"external_id": "d615396c40",
"plan": { "type": "enterprise" },
"retention": 7,
"enable_syslog": False,
"include_admins": False
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-bulk+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/x-bulk+json'},
body: JSON.stringify({
operations: [
{
operation_id: '4b1a1504fa47866dafe8b5d4',
entity_id: '471ef1c4154b987a94509213',
entity: {
company: 'Snippet Factory',
owneremail: 'admin@snippetfactory.com',
external_id: 'd615396c40',
plan: {type: 'enterprise'},
retention: 7,
enable_syslog: false,
include_admins: false
}
}
]
})
};
fetch('https://api.mezmo.com/v3/enterprise/account', 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",
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([
'operations' => [
[
'operation_id' => '4b1a1504fa47866dafe8b5d4',
'entity_id' => '471ef1c4154b987a94509213',
'entity' => [
'company' => 'Snippet Factory',
'owneremail' => 'admin@snippetfactory.com',
'external_id' => 'd615396c40',
'plan' => [
'type' => 'enterprise'
],
'retention' => 7,
'enable_syslog' => false,
'include_admins' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-bulk+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"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-bulk+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")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-bulk+json")
.body("{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/enterprise/account")
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/x-bulk+json'
request.body = "{\n \"operations\": [\n {\n \"operation_id\": \"4b1a1504fa47866dafe8b5d4\",\n \"entity_id\": \"471ef1c4154b987a94509213\",\n \"entity\": {\n \"company\": \"Snippet Factory\",\n \"owneremail\": \"admin@snippetfactory.com\",\n \"external_id\": \"d615396c40\",\n \"plan\": {\n \"type\": \"enterprise\"\n },\n \"retention\": 7,\n \"enable_syslog\": false,\n \"include_admins\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}{
"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": {
"operations": [
{
"operation_id": "408efce8aa57bd0d8a861298",
"entity_id": "cb7b7c1f5100d2d5d31ad4f1",
"entity": {
"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": {}
},
"result": {
"detail": "Account created successfully",
"context": [
{
"message": "Account not found",
"code": "ECONTRACT"
}
]
}
}
]
}
}{
"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
}
]
}{
"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": {
"operations": [
{
"operation_id": "408efce8aa57bd0d8a861298",
"entity_id": "cb7b7c1f5100d2d5d31ad4f1",
"entity": {
"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": {}
},
"result": {
"detail": "Account created successfully",
"context": [
{
"message": "Account not found",
"code": "ECONTRACT"
}
]
}
}
]
}
}{
"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
}
]
}
