curl --request POST \
--url https://api.twine.se/v1/org \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"admin": false,
"api_refresh_token_ttl": 7776000,
"assign_to": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"create_api_refresh_token": true,
"create_in": "parent",
"name": "Employee API Role"
}
],
"suppression_ends_at": "2026-05-01T00:00:00Z",
"suppression_reason": "onboarding",
"vat": "SE556677889901"
}
'import requests
url = "https://api.twine.se/v1/org"
payload = {
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"admin": False,
"api_refresh_token_ttl": 7776000,
"assign_to": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"create_api_refresh_token": True,
"create_in": "parent",
"name": "Employee API Role"
}
],
"suppression_ends_at": "2026-05-01T00:00:00Z",
"suppression_reason": "onboarding",
"vat": "SE556677889901"
}
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({
name: 'AcmeCorp Inc.',
owner_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
roles: [
{
admin: false,
api_refresh_token_ttl: 7776000,
assign_to: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
create_api_refresh_token: true,
create_in: 'parent',
name: 'Employee API Role'
}
],
suppression_ends_at: '2026-05-01T00:00:00Z',
suppression_reason: 'onboarding',
vat: 'SE556677889901'
})
};
fetch('https://api.twine.se/v1/org', 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.twine.se/v1/org",
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' => 'AcmeCorp Inc.',
'owner_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'roles' => [
[
'admin' => false,
'api_refresh_token_ttl' => 7776000,
'assign_to' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'create_api_refresh_token' => true,
'create_in' => 'parent',
'name' => 'Employee API Role'
]
],
'suppression_ends_at' => '2026-05-01T00:00:00Z',
'suppression_reason' => 'onboarding',
'vat' => 'SE556677889901'
]),
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://api.twine.se/v1/org"
payload := strings.NewReader("{\n \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\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://api.twine.se/v1/org")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org")
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 \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"custom_properties": [
{
"domain": "employee",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"property": "shoe_size",
"type": "enum",
"description": "The size of the employee's shoes",
"list": false,
"reference_domain": "employee"
}
],
"delete_protection": true,
"delete_protection_disabled_at": "2021-06-01T12:00:00Z",
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"name": "Admin Role",
"tokens": [
{
"exp": 1672531199,
"jti": "<string>",
"jwt": "s3cr3t-t0k3n",
"typ": "access"
}
]
}
],
"vat": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}Create organization
Create a new organization.
curl --request POST \
--url https://api.twine.se/v1/org \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"admin": false,
"api_refresh_token_ttl": 7776000,
"assign_to": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"create_api_refresh_token": true,
"create_in": "parent",
"name": "Employee API Role"
}
],
"suppression_ends_at": "2026-05-01T00:00:00Z",
"suppression_reason": "onboarding",
"vat": "SE556677889901"
}
'import requests
url = "https://api.twine.se/v1/org"
payload = {
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"admin": False,
"api_refresh_token_ttl": 7776000,
"assign_to": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"create_api_refresh_token": True,
"create_in": "parent",
"name": "Employee API Role"
}
],
"suppression_ends_at": "2026-05-01T00:00:00Z",
"suppression_reason": "onboarding",
"vat": "SE556677889901"
}
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({
name: 'AcmeCorp Inc.',
owner_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
roles: [
{
admin: false,
api_refresh_token_ttl: 7776000,
assign_to: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
create_api_refresh_token: true,
create_in: 'parent',
name: 'Employee API Role'
}
],
suppression_ends_at: '2026-05-01T00:00:00Z',
suppression_reason: 'onboarding',
vat: 'SE556677889901'
})
};
fetch('https://api.twine.se/v1/org', 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.twine.se/v1/org",
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' => 'AcmeCorp Inc.',
'owner_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'roles' => [
[
'admin' => false,
'api_refresh_token_ttl' => 7776000,
'assign_to' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'create_api_refresh_token' => true,
'create_in' => 'parent',
'name' => 'Employee API Role'
]
],
'suppression_ends_at' => '2026-05-01T00:00:00Z',
'suppression_reason' => 'onboarding',
'vat' => 'SE556677889901'
]),
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://api.twine.se/v1/org"
payload := strings.NewReader("{\n \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\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://api.twine.se/v1/org")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org")
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 \"name\": \"AcmeCorp Inc.\",\n \"owner_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"roles\": [\n {\n \"admin\": false,\n \"api_refresh_token_ttl\": 7776000,\n \"assign_to\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"create_api_refresh_token\": true,\n \"create_in\": \"parent\",\n \"name\": \"Employee API Role\"\n }\n ],\n \"suppression_ends_at\": \"2026-05-01T00:00:00Z\",\n \"suppression_reason\": \"onboarding\",\n \"vat\": \"SE556677889901\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"custom_properties": [
{
"domain": "employee",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"property": "shoe_size",
"type": "enum",
"description": "The size of the employee's shoes",
"list": false,
"reference_domain": "employee"
}
],
"delete_protection": true,
"delete_protection_disabled_at": "2021-06-01T12:00:00Z",
"name": "AcmeCorp Inc.",
"owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"roles": [
{
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"name": "Admin Role",
"tokens": [
{
"exp": 1672531199,
"jti": "<string>",
"jwt": "s3cr3t-t0k3n",
"typ": "access"
}
]
}
],
"vat": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}Authorizations
Bearer token for authentication
Body
Organization Create Request
Payload for creating an Organization in Twine.
The organization's name
"AcmeCorp Inc."
The UUID of the user who will own the organization in Twine. This user must exist in the same organization as the role being used to create the new organization.
"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
Roles to create in the new organization
Show child attributes
Show child attributes
If set, a breaker suppression is created for the new organization (scope :organization) ending at this timestamp. Auto-trip sources (error-rate, change-magnitude) are silenced for this org and its descendants until then. Useful for onboarding windows where signal noise is expected.
"2026-05-01T00:00:00Z"
Free-form reason recorded on the suppression row. Ignored if suppression_ends_at is not set.
"onboarding"
The organization's VAT number
"SE556677889901"
Response
Organization Response
A response object with a single organization
An object representing an organization in Twine. Please note that the primary key for organizations is org_id, not id.
Show child attributes
Show child attributes