Change a sub-account's base plan.
curl --request PUT \
--url https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"plan": "9b1e4c7a-0000-4000-8000-000000000000"
}
'import requests
url = "https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription"
payload = { "plan": "9b1e4c7a-0000-4000-8000-000000000000" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan: '9b1e4c7a-0000-4000-8000-000000000000'})
};
fetch('https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription', 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://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'plan' => '9b1e4c7a-0000-4000-8000-000000000000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription"
payload := strings.NewReader("{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<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.put("https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Change a sub-account's base plan.
Assigns a new base plan to the sub-account and copies its limits onto the workspace. plan is required and must be an enabled base plan belonging to the agency (otherwise 422). Returns the detailed workspace card (including limits); a suspended sub-account stays suspended.
PUT
/
workspaces
/
{workspace}
/
subscription
Change a sub-account's base plan.
curl --request PUT \
--url https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"plan": "9b1e4c7a-0000-4000-8000-000000000000"
}
'import requests
url = "https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription"
payload = { "plan": "9b1e4c7a-0000-4000-8000-000000000000" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan: '9b1e4c7a-0000-4000-8000-000000000000'})
};
fetch('https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription', 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://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'plan' => '9b1e4c7a-0000-4000-8000-000000000000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription"
payload := strings.NewReader("{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<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.put("https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/agency/v1/workspaces/{workspace}/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"9b1e4c7a-0000-4000-8000-000000000000\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
agencyApiKeyAuthagencyBearerAuth
Your agency API key (dmly_ag_…). It authenticates the acting agency and scopes every request to that agency's own sub-accounts and plans.
Path Parameters
Workspace id.
Body
application/json
Response
Success.
Was this page helpful?
⌘I

