Create Contact Import
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/contacts/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"csv": "<string>",
"file_name": "<string>",
"mapping": {},
"dry_run": false,
"existing": "update",
"marketing_consent": false,
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"type": "contact_imports"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/contacts/imports"
payload = { "data": {
"attributes": {
"csv": "<string>",
"file_name": "<string>",
"mapping": {},
"dry_run": False,
"existing": "update",
"marketing_consent": False,
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"type": "contact_imports"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
csv: '<string>',
file_name: '<string>',
mapping: {},
dry_run: false,
existing: 'update',
marketing_consent: false,
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
type: 'contact_imports'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/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.member.dev/api/v1/teams/{team_id}/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 => json_encode([
'data' => [
'attributes' => [
'csv' => '<string>',
'file_name' => '<string>',
'mapping' => [
],
'dry_run' => false,
'existing' => 'update',
'marketing_consent' => false,
'tag_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'type' => 'contact_imports'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/contacts/imports"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/teams/{team_id}/contacts/imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/contacts/imports")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"error_rows": [
{
"reason": "<string>",
"row": 123,
"email": "<string>"
}
],
"error_rows_truncated": true,
"new_count": 123,
"row_count": 123,
"skipped_count": 123,
"updated_count": 123
},
"id": "<string>",
"type": "contact_import_previews"
}
}{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_count": 123,
"error_rows": [
{
"reason": "<string>",
"row": 123,
"email": "<string>"
}
],
"error_rows_truncated": true,
"existing": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"marketing_consent": true,
"processed_rows": 123,
"row_count": 123,
"skipped_count": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"tag_ids": [
"<string>"
],
"updated_count": 123
},
"id": "<string>",
"links": {
"self": "<string>"
},
"type": "contact_imports"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}contacts-admin
Create Contact Import
Start an import from CSV text, or preview it with dry_run=true.
A dry run writes and stores nothing and answers 200 with counts and the first 100
bad rows (type contact_import_previews). A real run answers 201 with a
queued import that a worker starts within about 30 seconds. An
Idempotency-Key replay with the same body answers 200 with the stored import.
Limits: 10 MiB, 50,000 rows, one live import per team, 10 starts per hour.
POST
/
api
/
v1
/
teams
/
{team_id}
/
contacts
/
imports
Create Contact Import
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/contacts/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"csv": "<string>",
"file_name": "<string>",
"mapping": {},
"dry_run": false,
"existing": "update",
"marketing_consent": false,
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"type": "contact_imports"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/contacts/imports"
payload = { "data": {
"attributes": {
"csv": "<string>",
"file_name": "<string>",
"mapping": {},
"dry_run": False,
"existing": "update",
"marketing_consent": False,
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"type": "contact_imports"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
csv: '<string>',
file_name: '<string>',
mapping: {},
dry_run: false,
existing: 'update',
marketing_consent: false,
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
type: 'contact_imports'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/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.member.dev/api/v1/teams/{team_id}/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 => json_encode([
'data' => [
'attributes' => [
'csv' => '<string>',
'file_name' => '<string>',
'mapping' => [
],
'dry_run' => false,
'existing' => 'update',
'marketing_consent' => false,
'tag_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'type' => 'contact_imports'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/contacts/imports"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/teams/{team_id}/contacts/imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/contacts/imports")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"csv\": \"<string>\",\n \"file_name\": \"<string>\",\n \"mapping\": {},\n \"dry_run\": false,\n \"existing\": \"update\",\n \"marketing_consent\": false,\n \"tag_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"type\": \"contact_imports\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"error_rows": [
{
"reason": "<string>",
"row": 123,
"email": "<string>"
}
],
"error_rows_truncated": true,
"new_count": 123,
"row_count": 123,
"skipped_count": 123,
"updated_count": 123
},
"id": "<string>",
"type": "contact_import_previews"
}
}{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_count": 123,
"error_rows": [
{
"reason": "<string>",
"row": 123,
"email": "<string>"
}
],
"error_rows_truncated": true,
"existing": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"marketing_consent": true,
"processed_rows": 123,
"row_count": 123,
"skipped_count": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"tag_ids": [
"<string>"
],
"updated_count": 123
},
"id": "<string>",
"links": {
"self": "<string>"
},
"type": "contact_imports"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}