Customers
Assign Customer CSMs
Assign Customer Success Manager contacts to customers by Stripe customer ID.
Monk resolves each Stripe customer ID within the authenticated organization.
For each matched customer, existing imported CSM contacts are demoted to
Unreachable except the incoming CSM email, then the incoming CSM is
created or updated. Manually-created CSM contacts are preserved.
POST
/
v1
/
customers
/
csm-assignments
Assign Customer CSMs
curl --request POST \
--url https://api.monk.com/v1/customers/csm-assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"stripeCustomerId": "cus_123",
"csm": {
"name": "Nurah Example",
"email": "nurah@example.com"
}
}
]
}
'import requests
url = "https://api.monk.com/v1/customers/csm-assignments"
payload = { "assignments": [
{
"stripeCustomerId": "cus_123",
"csm": {
"name": "Nurah Example",
"email": "nurah@example.com"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignments: [
{
stripeCustomerId: 'cus_123',
csm: {name: 'Nurah Example', email: 'nurah@example.com'}
}
]
})
};
fetch('https://api.monk.com/v1/customers/csm-assignments', 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.monk.com/v1/customers/csm-assignments",
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([
'assignments' => [
[
'stripeCustomerId' => 'cus_123',
'csm' => [
'name' => 'Nurah Example',
'email' => 'nurah@example.com'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.monk.com/v1/customers/csm-assignments"
payload := strings.NewReader("{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.monk.com/v1/customers/csm-assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers/csm-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 1,
"notFound": 1,
"results": [
{
"stripeCustomerId": "cus_123",
"status": "updated",
"customerId": "8d081545-cc04-4e0b-88a2-4f71f2d2a351",
"csmContactId": "5dd9fa1a-6e18-4bbf-8095-c36c1b6b97dc",
"demotedCount": 1
},
{
"stripeCustomerId": "cus_missing",
"status": "not_found"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Send up to 100 assignments per request. Unmapped Stripe customer IDs
are returned as
not_found results instead of failing the whole request.
Scope: customers:writeAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
CSM assignments keyed by Stripe customer ID.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
CSM assignment results
Show child attributes
Show child attributes
⌘I
Assign Customer CSMs
curl --request POST \
--url https://api.monk.com/v1/customers/csm-assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"stripeCustomerId": "cus_123",
"csm": {
"name": "Nurah Example",
"email": "nurah@example.com"
}
}
]
}
'import requests
url = "https://api.monk.com/v1/customers/csm-assignments"
payload = { "assignments": [
{
"stripeCustomerId": "cus_123",
"csm": {
"name": "Nurah Example",
"email": "nurah@example.com"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignments: [
{
stripeCustomerId: 'cus_123',
csm: {name: 'Nurah Example', email: 'nurah@example.com'}
}
]
})
};
fetch('https://api.monk.com/v1/customers/csm-assignments', 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.monk.com/v1/customers/csm-assignments",
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([
'assignments' => [
[
'stripeCustomerId' => 'cus_123',
'csm' => [
'name' => 'Nurah Example',
'email' => 'nurah@example.com'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.monk.com/v1/customers/csm-assignments"
payload := strings.NewReader("{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.monk.com/v1/customers/csm-assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers/csm-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignments\": [\n {\n \"stripeCustomerId\": \"cus_123\",\n \"csm\": {\n \"name\": \"Nurah Example\",\n \"email\": \"nurah@example.com\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 1,
"notFound": 1,
"results": [
{
"stripeCustomerId": "cus_123",
"status": "updated",
"customerId": "8d081545-cc04-4e0b-88a2-4f71f2d2a351",
"csmContactId": "5dd9fa1a-6e18-4bbf-8095-c36c1b6b97dc",
"demotedCount": 1
},
{
"stripeCustomerId": "cus_missing",
"status": "not_found"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}