Add Contacts to a List
curl --request POST \
--url https://www.gomry.com/api/v1/lists/{listId}/contacts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"contact_ids": [
"<string>"
]
}
'import requests
url = "https://www.gomry.com/api/v1/lists/{listId}/contacts"
payload = { "contact_ids": ["<string>"] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: ['<string>']})
};
fetch('https://www.gomry.com/api/v1/lists/{listId}/contacts', 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://www.gomry.com/api/v1/lists/{listId}/contacts",
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([
'contact_ids' => [
'<string>'
]
]),
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://www.gomry.com/api/v1/lists/{listId}/contacts"
payload := strings.NewReader("{\n \"contact_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.gomry.com/api/v1/lists/{listId}/contacts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.gomry.com/api/v1/lists/{listId}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"list_id": "<string>",
"contacts_on_list": 123,
"invalid_contact_ids": [
"<string>"
]
}Lists
Add Contacts to a List
Add contacts to a list, which starts the list’s automations for them
POST
/
lists
/
{listId}
/
contacts
Add Contacts to a List
curl --request POST \
--url https://www.gomry.com/api/v1/lists/{listId}/contacts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"contact_ids": [
"<string>"
]
}
'import requests
url = "https://www.gomry.com/api/v1/lists/{listId}/contacts"
payload = { "contact_ids": ["<string>"] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: ['<string>']})
};
fetch('https://www.gomry.com/api/v1/lists/{listId}/contacts', 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://www.gomry.com/api/v1/lists/{listId}/contacts",
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([
'contact_ids' => [
'<string>'
]
]),
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://www.gomry.com/api/v1/lists/{listId}/contacts"
payload := strings.NewReader("{\n \"contact_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.gomry.com/api/v1/lists/{listId}/contacts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.gomry.com/api/v1/lists/{listId}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"list_id": "<string>",
"contacts_on_list": 123,
"invalid_contact_ids": [
"<string>"
]
}Add Contacts to a List
Adds up to 100 existing contacts to a list. A contact already on the list stays as it is. Adding a contact starts the automations that follow this list (Automations page, trigger Added to a list) for that contact. Each contact goes through an automation once, so calling this again for the same contact starts nothing twice. This is how another system starts a Gomry flow: create or find the contact, then add it to the list the automation follows. Required scopes:lists:read and contacts:write (adding writes the contact)
Path Parameters
Body
Contact ids, from 1 to 100. Ids that are not contacts of your organization are returned in
invalid_contact_ids and skipped.Response
{
"list_id": "lst_8f2c",
"contacts_on_list": 2,
"invalid_contact_ids": []
}
Errors
400the body is not{ "contact_ids": [...] }with 1 to 100 ids404the list is not one of your organization’s422none of the ids are contacts of your organization

