Contacts
Upload a CSV of contacts with a consent attestation
POST
/
v1
/
contacts
/
imports
Upload a CSV of contacts with a consent attestation
curl --request POST \
--url https://api-us.larynth.com/v1/contacts/imports \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie lx_session= \
--form 'attestation_text=<string>;type=text/plain' \
--form 'file=@example-file;type=text/csv' \
--form 'campaign_id=3c90c3cc-0d44-4b50-8888-8dd25736052a;type=text/plain'import requests
url = "https://api-us.larynth.com/v1/contacts/imports"
files = { "file": ("example-file", open("example-file", "rb"), "text/csv") }
files["attestation_text"] = (None, "<string>", "text/plain")
files["campaign_id"] = (None, "3c90c3cc-0d44-4b50-8888-8dd25736052a", "text/plain")
headers = {
"cookie": "lx_session=",
"Idempotency-Key": "<idempotency-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('attestation_text', '<string>');
form.append('file', '<string>');
form.append('campaign_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
const options = {
method: 'POST',
headers: {cookie: 'lx_session=', 'Idempotency-Key': '<idempotency-key>'}
};
options.body = form;
fetch('https://api-us.larynth.com/v1/contacts/imports', 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-us.larynth.com/v1/contacts/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--",
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"Idempotency-Key: <idempotency-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://api-us.larynth.com/v1/contacts/imports"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "lx_session=")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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-us.larynth.com/v1/contacts/imports")
.header("cookie", "lx_session=")
.header("Idempotency-Key", "<idempotency-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/contacts/imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'lx_session='
request["Idempotency-Key"] = '<idempotency-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"attested_at": "2023-11-07T05:31:56Z",
"attested_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rows_ok": 123,
"rows_rejected": 123,
"rows_total": 123,
"status": "uploaded",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"consent_kind": "express",
"consent_source": "import",
"error": "<string>",
"finished_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}Authorizations
sessionapiKey
Dashboard session cookie
Headers
Replays within 24 h return the stored response; the same key with a different body returns 409
Required string length:
8 - 255Body
multipart/form-data
Attestation of how consent was obtained
Required string length:
20 - 4000CSV with an e164 column; other columns become attributes
Also enrol every imported contact in this campaign
Available options:
express, express_written Available options:
import, web_form, verbal_recorded, other Response
Accepted
Available options:
uploaded, processing, done, failed Available options:
express, express_written Available options:
import, web_form, verbal_recorded, other ⌘I
Upload a CSV of contacts with a consent attestation
curl --request POST \
--url https://api-us.larynth.com/v1/contacts/imports \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie lx_session= \
--form 'attestation_text=<string>;type=text/plain' \
--form 'file=@example-file;type=text/csv' \
--form 'campaign_id=3c90c3cc-0d44-4b50-8888-8dd25736052a;type=text/plain'import requests
url = "https://api-us.larynth.com/v1/contacts/imports"
files = { "file": ("example-file", open("example-file", "rb"), "text/csv") }
files["attestation_text"] = (None, "<string>", "text/plain")
files["campaign_id"] = (None, "3c90c3cc-0d44-4b50-8888-8dd25736052a", "text/plain")
headers = {
"cookie": "lx_session=",
"Idempotency-Key": "<idempotency-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('attestation_text', '<string>');
form.append('file', '<string>');
form.append('campaign_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
const options = {
method: 'POST',
headers: {cookie: 'lx_session=', 'Idempotency-Key': '<idempotency-key>'}
};
options.body = form;
fetch('https://api-us.larynth.com/v1/contacts/imports', 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-us.larynth.com/v1/contacts/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--",
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"Idempotency-Key: <idempotency-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://api-us.larynth.com/v1/contacts/imports"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "lx_session=")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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-us.larynth.com/v1/contacts/imports")
.header("cookie", "lx_session=")
.header("Idempotency-Key", "<idempotency-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/contacts/imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'lx_session='
request["Idempotency-Key"] = '<idempotency-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attestation_text\"\r\nContent-Type: text/plain\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: text/csv\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"campaign_id\"\r\nContent-Type: text/plain\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"attested_at": "2023-11-07T05:31:56Z",
"attested_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rows_ok": 123,
"rows_rejected": 123,
"rows_total": 123,
"status": "uploaded",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"consent_kind": "express",
"consent_source": "import",
"error": "<string>",
"finished_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}