Skip to main content
POST
/
v1
/
contacts
/
create
Create contact
curl --request POST \
  --url https://app.loops.so/api/v1/contacts/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "source": "<string>",
  "subscribed": true,
  "userGroup": "<string>",
  "userId": "<string>",
  "mailingLists": {}
}
'
import requests

url = "https://app.loops.so/api/v1/contacts/create"

payload = {
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"source": "<string>",
"subscribed": True,
"userGroup": "<string>",
"userId": "<string>",
"mailingLists": {}
}
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: '<string>',
firstName: '<string>',
lastName: '<string>',
source: '<string>',
subscribed: true,
userGroup: '<string>',
userId: '<string>',
mailingLists: {}
})
};

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' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'source' => '<string>',
'subscribed' => true,
'userGroup' => '<string>',
'userId' => '<string>',
'mailingLists' => [

]
]),
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\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"source\": \"<string>\",\n \"subscribed\": true,\n \"userGroup\": \"<string>\",\n \"userId\": \"<string>\",\n \"mailingLists\": {}\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\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"source\": \"<string>\",\n \"subscribed\": true,\n \"userGroup\": \"<string>\",\n \"userId\": \"<string>\",\n \"mailingLists\": {}\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\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"source\": \"<string>\",\n \"subscribed\": true,\n \"userGroup\": \"<string>\",\n \"userId\": \"<string>\",\n \"mailingLists\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "id": "clw9h3y5a014yl70k9m2n4p8q"
}
{
  "success": false,
  "message": "An error message"
}
If you want to “update or create” contacts, consider using the Update a contact endpoint instead.

Request

Body

email
string
required
The contact’s email address.
firstName
string
The contact’s first name.
lastName
string
The contact’s last name.
source
string
A custom source value to replace the default “API”. Read more
subscribed
boolean
default:true
Whether the contact will receive campaign and workflow emails. Read more
We recommend leaving this field out of your requests unless you specifically want to unsubscribe or re-subscribe a contact. All new contacts are subscribed by default.
userGroup
string
You can use groups to segment users when sending emails. Currently, a contact can only be in one user group. Read more
userId
string
A unique user ID (for example, from an external application). Read more
mailingLists
object
Manage mailing list subscriptions.
Include key-value pairs of mailing list IDs and a boolean denoting if the contact should be added (true) or removed (false) from the list. Read more
"mailingLists": {
  "cm06f5v0e45nf0ml5754o9cix": true,
  "cm16k73gq014h0mmj5b6jdi9r": false
}

Custom properties

You can also include custom contact properties in your request body. These should be added as top-level attributes in the request. Custom properties can be of type string, number, boolean or date (see allowed date formats).
{
  "email": "test@example.com",
  "plan": "pro" /* Custom property */,
  "dateJoined": 1704711066 /* Custom property */
}
There are a few reserved names that you cannot use for custom properties.
To empty or reset the value of a contact property, send a null value.

Response

Success

success
boolean
required
id
string
required
The internal ID of the new contact.

Error

If a matching contact already exists in your audience, a 409 Conflict error will be returned. All other errors will be 400 Bad Request.
success
boolean
required
message
string
required
An error message describing the problem with the request.
{
  "success": true,
  "id": "clw9h3y5a014yl70k9m2n4p8q"
}
{
  "success": false,
  "message": "An error message"
}
Last modified on June 29, 2026