Lend an account to another workspace
curl --request POST \
--url https://app.gtm-api.com/id/v4/api/account-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"account_sid": "<string>",
"to_email": "jsmith@example.com",
"to_team_sid": "<string>",
"planned_return_at": "<string>"
}
'import requests
url = "https://app.gtm-api.com/id/v4/api/account-shares"
payload = {
"account_sid": "<string>",
"to_email": "jsmith@example.com",
"to_team_sid": "<string>",
"planned_return_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_sid: '<string>',
to_email: 'jsmith@example.com',
to_team_sid: '<string>',
planned_return_at: '<string>'
})
};
fetch('https://app.gtm-api.com/id/v4/api/account-shares', 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://app.gtm-api.com/id/v4/api/account-shares",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_sid' => '<string>',
'to_email' => 'jsmith@example.com',
'to_team_sid' => '<string>',
'planned_return_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <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://app.gtm-api.com/id/v4/api/account-shares"
payload := strings.NewReader("{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<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.post("https://app.gtm-api.com/id/v4/api/account-shares")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/id/v4/api/account-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"channel": "linkedin",
"to_team_sid": "<string>",
"to_user_sid": "<string>",
"to_email": "<string>",
"owner_cluster_id": 123,
"holder_cluster_id": 123,
"owner_account_sid": "<string>",
"owner_channel_ref": "<string>",
"holder_account_sid": "<string>",
"holder_channel_ref": "<string>",
"owner_account_label": "<string>",
"status": "pending",
"holder_over_slot": true,
"end_reason": "returned_by_holder",
"failure_reason": "park_failed",
"planned_return_at": "<string>",
"expiry_notified_at": "<string>",
"phase_claimed_at": "<string>",
"phase_attempts": 123,
"ended_at": "<string>",
"ended_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}account_shares
Lend an account to another workspace
Lend ONE of your connected accounts to another workspace, temporarily and revocably. This is a loan, not a handover: permanent ownership transfer has no MCP tool at all. Target exactly one of to_email (resolved to that user's working team) or to_team_sid; neither, both, a bad email or a self-target is 422. account_sid is prefix agnostic (ln_ac_, em_ac_); `channel` says which service owns it. ALWAYS ASYNC: returns 201 with status pending, and the loan has NOT started. Poll search_account_shares with filter { sid: { eq } } until status is active (the holder can work) or failed (read failure_reason); rolling_back means it is being undone, so do not re-issue. holder_over_slot true means the copy landed in the holder's subscription hold and they cannot work until they upgrade; a share never fails on slots. One row is one account with no bulk arm, so N accounts is N calls. planned_return_at only emails the owner a recall link; there is no auto return. Needs can_manage_account_shares.
Contract:
- MCP tool `create_account_share`, registry package `mcp.id/account_shares`, mount `id.access`.
- Operation `create`, response envelope `create`.
- Flags: none.
POST
/
api
/
account-shares
Lend an account to another workspace
curl --request POST \
--url https://app.gtm-api.com/id/v4/api/account-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"account_sid": "<string>",
"to_email": "jsmith@example.com",
"to_team_sid": "<string>",
"planned_return_at": "<string>"
}
'import requests
url = "https://app.gtm-api.com/id/v4/api/account-shares"
payload = {
"account_sid": "<string>",
"to_email": "jsmith@example.com",
"to_team_sid": "<string>",
"planned_return_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_sid: '<string>',
to_email: 'jsmith@example.com',
to_team_sid: '<string>',
planned_return_at: '<string>'
})
};
fetch('https://app.gtm-api.com/id/v4/api/account-shares', 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://app.gtm-api.com/id/v4/api/account-shares",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_sid' => '<string>',
'to_email' => 'jsmith@example.com',
'to_team_sid' => '<string>',
'planned_return_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <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://app.gtm-api.com/id/v4/api/account-shares"
payload := strings.NewReader("{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<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.post("https://app.gtm-api.com/id/v4/api/account-shares")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/id/v4/api/account-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_sid\": \"<string>\",\n \"to_email\": \"jsmith@example.com\",\n \"to_team_sid\": \"<string>\",\n \"planned_return_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"channel": "linkedin",
"to_team_sid": "<string>",
"to_user_sid": "<string>",
"to_email": "<string>",
"owner_cluster_id": 123,
"holder_cluster_id": 123,
"owner_account_sid": "<string>",
"owner_channel_ref": "<string>",
"holder_account_sid": "<string>",
"holder_channel_ref": "<string>",
"owner_account_label": "<string>",
"status": "pending",
"holder_over_slot": true,
"end_reason": "returned_by_holder",
"failure_reason": "park_failed",
"planned_return_at": "<string>",
"expiry_notified_at": "<string>",
"phase_claimed_at": "<string>",
"phase_attempts": 123,
"ended_at": "<string>",
"ended_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}Authorizations
Body
application/json
Request body of create_account_share.