Create organization
curl --request POST \
--url https://api.example.com/organizations \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
]
}
'import requests
url = "https://api.example.com/organizations"
payload = {
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
]
}
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({
name: '<string>',
document: '<string>',
contact: '<string>',
contactPhone: '<string>',
zip: '<string>',
address: '<string>',
city: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
partners: [{name: '<string>', document: '<string>'}]
})
};
fetch('https://api.example.com/organizations', 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.example.com/organizations",
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' => '<string>',
'document' => '<string>',
'contact' => '<string>',
'contactPhone' => '<string>',
'zip' => '<string>',
'address' => '<string>',
'city' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'partners' => [
[
'name' => '<string>',
'document' => '<string>'
]
]
]),
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.example.com/organizations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\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.example.com/organizations")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations")
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 \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"id": 123,
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "<string>",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": 123,
"message": "<string>",
"type": "<string>",
"attributes": {}
}organizations
Create organization
Creates the organization for the authenticated user; each user owns at most one.
POST
/
organizations
Create organization
curl --request POST \
--url https://api.example.com/organizations \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
]
}
'import requests
url = "https://api.example.com/organizations"
payload = {
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
]
}
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({
name: '<string>',
document: '<string>',
contact: '<string>',
contactPhone: '<string>',
zip: '<string>',
address: '<string>',
city: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
partners: [{name: '<string>', document: '<string>'}]
})
};
fetch('https://api.example.com/organizations', 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.example.com/organizations",
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' => '<string>',
'document' => '<string>',
'contact' => '<string>',
'contactPhone' => '<string>',
'zip' => '<string>',
'address' => '<string>',
'city' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'partners' => [
[
'name' => '<string>',
'document' => '<string>'
]
]
]),
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.example.com/organizations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\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.example.com/organizations")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations")
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 \"name\": \"<string>\",\n \"document\": \"<string>\",\n \"contact\": \"<string>\",\n \"contactPhone\": \"<string>\",\n \"zip\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"partners\": [\n {\n \"name\": \"<string>\",\n \"document\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"id": 123,
"name": "<string>",
"document": "<string>",
"contact": "<string>",
"contactPhone": "<string>",
"zip": "<string>",
"address": "<string>",
"city": "<string>",
"email": "<string>",
"phone": "<string>",
"partners": [
{
"name": "<string>",
"document": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": 123,
"message": "<string>",
"type": "<string>",
"attributes": {}
}Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Available options:
AC, AL, AP, AM, BA, CE, DF, ES, GO, MA, MT, MS, MG, PA, PB, PR, PE, PI, RJ, RN, RS, RO, RR, SC, SP, SE, TO Pattern:
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Minimum string length:
1Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
⌘I