Segments - Create
Create an empty static segment. Add contacts to it with the Manage contacts endpoint. A company can have up to 20 segments. Rate limit: 10 requests per second.
POST
/
api
/
segments
/
create
Segments - Create
curl --request POST \
--url https://getsimio.app/api/segments/create \
--header 'Content-Type: application/json' \
--header 'simio-api-key: <api-key>' \
--data '
{
"name": "VIP Customers"
}
'import requests
url = "https://getsimio.app/api/segments/create"
payload = { "name": "VIP Customers" }
headers = {
"simio-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'simio-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'VIP Customers'})
};
fetch('https://getsimio.app/api/segments/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://getsimio.app/api/segments/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([
'name' => 'VIP Customers'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"simio-api-key: <api-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://getsimio.app/api/segments/create"
payload := strings.NewReader("{\n \"name\": \"VIP Customers\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("simio-api-key", "<api-key>")
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://getsimio.app/api/segments/create")
.header("simio-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP Customers\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getsimio.app/api/segments/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["simio-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP Customers\"\n}"
response = http.request(request)
puts response.read_body{
"name": "VIP Customers",
"segment_id": 42
}{
"detail": "Invalid API key"
}{
"detail": "Invalid API key"
}{
"detail": "Invalid API key"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": "Rate limit exceeded: 10 per 1 second"
}Authorizations
Company API key, created in Settings > Integrations & developers > Credentials.
Body
application/json
Name of the segment to create.
Required string length:
1 - 255Example:
"VIP Customers"
⌘I
Segments - Create
curl --request POST \
--url https://getsimio.app/api/segments/create \
--header 'Content-Type: application/json' \
--header 'simio-api-key: <api-key>' \
--data '
{
"name": "VIP Customers"
}
'import requests
url = "https://getsimio.app/api/segments/create"
payload = { "name": "VIP Customers" }
headers = {
"simio-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'simio-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'VIP Customers'})
};
fetch('https://getsimio.app/api/segments/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://getsimio.app/api/segments/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([
'name' => 'VIP Customers'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"simio-api-key: <api-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://getsimio.app/api/segments/create"
payload := strings.NewReader("{\n \"name\": \"VIP Customers\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("simio-api-key", "<api-key>")
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://getsimio.app/api/segments/create")
.header("simio-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP Customers\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getsimio.app/api/segments/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["simio-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP Customers\"\n}"
response = http.request(request)
puts response.read_body{
"name": "VIP Customers",
"segment_id": 42
}{
"detail": "Invalid API key"
}{
"detail": "Invalid API key"
}{
"detail": "Invalid API key"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": "Rate limit exceeded: 10 per 1 second"
}