Contacts
Create a contact
Add a contact to your audience.
POST
/
v1
/
contacts
/
create
Create a contact
curl --request POST \
--url https://app.loops.so/api/v1/contacts/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "alex@company.com",
"firstName": "Alex",
"lastName": "Rivera",
"subscribed": true,
"userGroup": "customers",
"userId": "usr_7f8e9d0c1b2a",
"mailingLists": {
"clm2k8j4h6g0f8d6s4a2b0z8": true
},
"favoriteColor": "blue"
}
'import requests
url = "https://app.loops.so/api/v1/contacts/create"
payload = {
"email": "alex@company.com",
"firstName": "Alex",
"lastName": "Rivera",
"subscribed": True,
"userGroup": "customers",
"userId": "usr_7f8e9d0c1b2a",
"mailingLists": { "clm2k8j4h6g0f8d6s4a2b0z8": True },
"favoriteColor": "blue"
}
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({
email: 'alex@company.com',
firstName: 'Alex',
lastName: 'Rivera',
subscribed: true,
userGroup: 'customers',
userId: 'usr_7f8e9d0c1b2a',
mailingLists: {clm2k8j4h6g0f8d6s4a2b0z8: true},
favoriteColor: 'blue'
})
};
fetch('https://app.loops.so/api/v1/contacts/create', 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.loops.so/api/v1/contacts/create",
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([
'email' => 'alex@company.com',
'firstName' => 'Alex',
'lastName' => 'Rivera',
'subscribed' => true,
'userGroup' => 'customers',
'userId' => 'usr_7f8e9d0c1b2a',
'mailingLists' => [
'clm2k8j4h6g0f8d6s4a2b0z8' => true
],
'favoriteColor' => 'blue'
]),
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://app.loops.so/api/v1/contacts/create"
payload := strings.NewReader("{\n \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\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://app.loops.so/api/v1/contacts/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.loops.so/api/v1/contacts/create")
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 \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "clh3k9m2p4q6r8s0t2v4x6z8"
}{
"success": false,
"message": "Invalid email address."
}{
"success": false,
"message": "Invalid email address."
}If you want to “update or create” contacts, consider using the Update a contact endpoint instead.
Authorizations
Body
application/json
You can add custom contact properties as keys in this request (of type string, number, boolean or date. See available date formats). Make sure to create the properties in Loops before using them in API calls.
Last modified on July 21, 2026
Was this page helpful?
⌘I
Create a contact
curl --request POST \
--url https://app.loops.so/api/v1/contacts/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "alex@company.com",
"firstName": "Alex",
"lastName": "Rivera",
"subscribed": true,
"userGroup": "customers",
"userId": "usr_7f8e9d0c1b2a",
"mailingLists": {
"clm2k8j4h6g0f8d6s4a2b0z8": true
},
"favoriteColor": "blue"
}
'import requests
url = "https://app.loops.so/api/v1/contacts/create"
payload = {
"email": "alex@company.com",
"firstName": "Alex",
"lastName": "Rivera",
"subscribed": True,
"userGroup": "customers",
"userId": "usr_7f8e9d0c1b2a",
"mailingLists": { "clm2k8j4h6g0f8d6s4a2b0z8": True },
"favoriteColor": "blue"
}
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({
email: 'alex@company.com',
firstName: 'Alex',
lastName: 'Rivera',
subscribed: true,
userGroup: 'customers',
userId: 'usr_7f8e9d0c1b2a',
mailingLists: {clm2k8j4h6g0f8d6s4a2b0z8: true},
favoriteColor: 'blue'
})
};
fetch('https://app.loops.so/api/v1/contacts/create', 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.loops.so/api/v1/contacts/create",
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([
'email' => 'alex@company.com',
'firstName' => 'Alex',
'lastName' => 'Rivera',
'subscribed' => true,
'userGroup' => 'customers',
'userId' => 'usr_7f8e9d0c1b2a',
'mailingLists' => [
'clm2k8j4h6g0f8d6s4a2b0z8' => true
],
'favoriteColor' => 'blue'
]),
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://app.loops.so/api/v1/contacts/create"
payload := strings.NewReader("{\n \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\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://app.loops.so/api/v1/contacts/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.loops.so/api/v1/contacts/create")
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 \"email\": \"alex@company.com\",\n \"firstName\": \"Alex\",\n \"lastName\": \"Rivera\",\n \"subscribed\": true,\n \"userGroup\": \"customers\",\n \"userId\": \"usr_7f8e9d0c1b2a\",\n \"mailingLists\": {\n \"clm2k8j4h6g0f8d6s4a2b0z8\": true\n },\n \"favoriteColor\": \"blue\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "clh3k9m2p4q6r8s0t2v4x6z8"
}{
"success": false,
"message": "Invalid email address."
}{
"success": false,
"message": "Invalid email address."
}
