curl --request POST \
--url 'https://api.askmiso.com/v1/users?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"user_id": "user_1234",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "John Doe",
"profile_image": "<string>",
"age": 33,
"gender": "M",
"city": "Mountain View",
"state": "California",
"country": "US",
"group_id": "Northwind Corp",
"description": "Engineer from Northwind Corp",
"custom_attributes": {
"acquisition_channel": "Facebook Campaign 2020",
"declared_interests": [
"Drama",
"Romance"
]
}
}
]
}
'import requests
url = "https://api.askmiso.com/v1/users?api_key="
payload = { "data": [
{
"user_id": "user_1234",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "John Doe",
"profile_image": "<string>",
"age": 33,
"gender": "M",
"city": "Mountain View",
"state": "California",
"country": "US",
"group_id": "Northwind Corp",
"description": "Engineer from Northwind Corp",
"custom_attributes": {
"acquisition_channel": "Facebook Campaign 2020",
"declared_interests": ["Drama", "Romance"]
}
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: [
{
user_id: 'user_1234',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
name: 'John Doe',
profile_image: '<string>',
age: 33,
gender: 'M',
city: 'Mountain View',
state: 'California',
country: 'US',
group_id: 'Northwind Corp',
description: 'Engineer from Northwind Corp',
custom_attributes: {
acquisition_channel: 'Facebook Campaign 2020',
declared_interests: ['Drama', 'Romance']
}
}
]
})
};
fetch('https://api.askmiso.com/v1/users?api_key=', 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.askmiso.com/v1/users?api_key=",
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' => [
[
'user_id' => 'user_1234',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'name' => 'John Doe',
'profile_image' => '<string>',
'age' => 33,
'gender' => 'M',
'city' => 'Mountain View',
'state' => 'California',
'country' => 'US',
'group_id' => 'Northwind Corp',
'description' => 'Engineer from Northwind Corp',
'custom_attributes' => [
'acquisition_channel' => 'Facebook Campaign 2020',
'declared_interests' => [
'Drama',
'Romance'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.askmiso.com/v1/users?api_key="
payload := strings.NewReader("{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.askmiso.com/v1/users?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.askmiso.com/v1/users?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "success",
"data": {
"task_id": "<string>"
}
}{
"message:": "Request timeout."
}{
"message": "invalid api key."
}{
"message": "Request is denied due to bot blocking. Please only access this API from a real browser or use Secret API Key instead."
}{
"errors": true,
"message": "None of the records are inserted, because at least one of them contain schema errors. Please see `data` field for details.",
"data": [
"data.0.user_id is invalid. The attribute expected to be of type 'string', but 'array' is given.",
"data.0.created_at is invalid. The attribute should match 'date-time' format."
]
}{
"message": "Something went wrong. Please contact miso product team."
}User Upload API
Bulk API to insert User records. This API endpoint accepts POST requests with JSON data containing a list of User records wrapped in a dictionary.
POST /v1/users
{
"data": [user_1, user_2, user_3]
}
If a record with the same user_id already exists in the dataset, the existing record will
be replaced (no partial update is allowed at this time). We recommend limiting your calls to
around 100 records at a time to avoid memory issues or timeout risks.
Schema validation
This API validates the inserted records against the API schema. Any schema error will cause
the whole request to fail (status_code=422), and none of the records will be inserted. As
long as the request passes the schema validation, the API will return status_code=200, but
you should still check if there is any error occurring with individual records.
{
"errors": true,
"data": [
"data.0.user_id is invalid. The attribute was expected to be a `string`"
]
}
Response Format
The API will return a JSON object with a task_id that can be used to retrieve.
Example Successful Response
{
"data": {
"task_id": "{task_id}"
}
}
To check the exact response body of this task_id, make a GET request to the following endpoint:
GET /v1/users/_status/{task_id}
Replace {task_id} with the task_id returned from the response.
curl --request POST \
--url 'https://api.askmiso.com/v1/users?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"user_id": "user_1234",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "John Doe",
"profile_image": "<string>",
"age": 33,
"gender": "M",
"city": "Mountain View",
"state": "California",
"country": "US",
"group_id": "Northwind Corp",
"description": "Engineer from Northwind Corp",
"custom_attributes": {
"acquisition_channel": "Facebook Campaign 2020",
"declared_interests": [
"Drama",
"Romance"
]
}
}
]
}
'import requests
url = "https://api.askmiso.com/v1/users?api_key="
payload = { "data": [
{
"user_id": "user_1234",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "John Doe",
"profile_image": "<string>",
"age": 33,
"gender": "M",
"city": "Mountain View",
"state": "California",
"country": "US",
"group_id": "Northwind Corp",
"description": "Engineer from Northwind Corp",
"custom_attributes": {
"acquisition_channel": "Facebook Campaign 2020",
"declared_interests": ["Drama", "Romance"]
}
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: [
{
user_id: 'user_1234',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
name: 'John Doe',
profile_image: '<string>',
age: 33,
gender: 'M',
city: 'Mountain View',
state: 'California',
country: 'US',
group_id: 'Northwind Corp',
description: 'Engineer from Northwind Corp',
custom_attributes: {
acquisition_channel: 'Facebook Campaign 2020',
declared_interests: ['Drama', 'Romance']
}
}
]
})
};
fetch('https://api.askmiso.com/v1/users?api_key=', 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.askmiso.com/v1/users?api_key=",
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' => [
[
'user_id' => 'user_1234',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'name' => 'John Doe',
'profile_image' => '<string>',
'age' => 33,
'gender' => 'M',
'city' => 'Mountain View',
'state' => 'California',
'country' => 'US',
'group_id' => 'Northwind Corp',
'description' => 'Engineer from Northwind Corp',
'custom_attributes' => [
'acquisition_channel' => 'Facebook Campaign 2020',
'declared_interests' => [
'Drama',
'Romance'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.askmiso.com/v1/users?api_key="
payload := strings.NewReader("{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.askmiso.com/v1/users?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.askmiso.com/v1/users?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"user_id\": \"user_1234\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"John Doe\",\n \"profile_image\": \"<string>\",\n \"age\": 33,\n \"gender\": \"M\",\n \"city\": \"Mountain View\",\n \"state\": \"California\",\n \"country\": \"US\",\n \"group_id\": \"Northwind Corp\",\n \"description\": \"Engineer from Northwind Corp\",\n \"custom_attributes\": {\n \"acquisition_channel\": \"Facebook Campaign 2020\",\n \"declared_interests\": [\n \"Drama\",\n \"Romance\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "success",
"data": {
"task_id": "<string>"
}
}{
"message:": "Request timeout."
}{
"message": "invalid api key."
}{
"message": "Request is denied due to bot blocking. Please only access this API from a real browser or use Secret API Key instead."
}{
"errors": true,
"message": "None of the records are inserted, because at least one of them contain schema errors. Please see `data` field for details.",
"data": [
"data.0.user_id is invalid. The attribute expected to be of type 'string', but 'array' is given.",
"data.0.created_at is invalid. The attribute should match 'date-time' format."
]
}{
"message": "Something went wrong. Please contact miso product team."
}Authorizations
Your secret API key is used to access every Miso API endpoint. You should secure this key and only use it on a backend server. Never leave this key in your client-side JavaScript code. If the private key is compromised, you can revoke it in Dojo and get a new one.
Specify your secret key in the api_key query parameter. For example:
POST /v1/users?api_key=039c501ac8dfcac91c6f05601cee876e1cc07e17
Body
Show child attributes
Show child attributes