Register a new company.
curl --request POST \
--url https://core.grdd.dev/api/company/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Transportation",
"griddid": "acme-transportation",
"mainEmail": "dispatch@example.com",
"password": "YOUR_PASSWORD",
"confirmPassword": "YOUR_PASSWORD",
"mainPhone": "+15555550100",
"notes": "notes",
"address": "123 Main Street, Springfield",
"mode": "dry",
"coType": "IO"
}
'import requests
url = "https://core.grdd.dev/api/company/register"
payload = {
"name": "Acme Transportation",
"griddid": "acme-transportation",
"mainEmail": "dispatch@example.com",
"password": "YOUR_PASSWORD",
"confirmPassword": "YOUR_PASSWORD",
"mainPhone": "+15555550100",
"notes": "notes",
"address": "123 Main Street, Springfield",
"mode": "dry",
"coType": "IO"
}
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: 'Acme Transportation',
griddid: 'acme-transportation',
mainEmail: 'dispatch@example.com',
password: 'YOUR_PASSWORD',
confirmPassword: 'YOUR_PASSWORD',
mainPhone: '+15555550100',
notes: 'notes',
address: '123 Main Street, Springfield',
mode: 'dry',
coType: 'IO'
})
};
fetch('https://core.grdd.dev/api/company/register', 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://core.grdd.dev/api/company/register",
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' => 'Acme Transportation',
'griddid' => 'acme-transportation',
'mainEmail' => 'dispatch@example.com',
'password' => 'YOUR_PASSWORD',
'confirmPassword' => 'YOUR_PASSWORD',
'mainPhone' => '+15555550100',
'notes' => 'notes',
'address' => '123 Main Street, Springfield',
'mode' => 'dry',
'coType' => 'IO'
]),
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://core.grdd.dev/api/company/register"
payload := strings.NewReader("{\n \"name\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\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://core.grdd.dev/api/company/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.grdd.dev/api/company/register")
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\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\n}"
response = http.request(request)
puts response.read_bodycompany
Register a new company.
Register a company and its first user. In dry mode the route validates the data, proposes a griddid from name, and saves nothing. A griddid you send is used only for a direct registration (live mode). The token is optional. Callers with the ADMIN or GATEWAY role are treated as authenticated. Other callers are limited to 5 requests per hour per client address.
POST
/
api
/
company
/
register
Register a new company.
curl --request POST \
--url https://core.grdd.dev/api/company/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Transportation",
"griddid": "acme-transportation",
"mainEmail": "dispatch@example.com",
"password": "YOUR_PASSWORD",
"confirmPassword": "YOUR_PASSWORD",
"mainPhone": "+15555550100",
"notes": "notes",
"address": "123 Main Street, Springfield",
"mode": "dry",
"coType": "IO"
}
'import requests
url = "https://core.grdd.dev/api/company/register"
payload = {
"name": "Acme Transportation",
"griddid": "acme-transportation",
"mainEmail": "dispatch@example.com",
"password": "YOUR_PASSWORD",
"confirmPassword": "YOUR_PASSWORD",
"mainPhone": "+15555550100",
"notes": "notes",
"address": "123 Main Street, Springfield",
"mode": "dry",
"coType": "IO"
}
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: 'Acme Transportation',
griddid: 'acme-transportation',
mainEmail: 'dispatch@example.com',
password: 'YOUR_PASSWORD',
confirmPassword: 'YOUR_PASSWORD',
mainPhone: '+15555550100',
notes: 'notes',
address: '123 Main Street, Springfield',
mode: 'dry',
coType: 'IO'
})
};
fetch('https://core.grdd.dev/api/company/register', 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://core.grdd.dev/api/company/register",
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' => 'Acme Transportation',
'griddid' => 'acme-transportation',
'mainEmail' => 'dispatch@example.com',
'password' => 'YOUR_PASSWORD',
'confirmPassword' => 'YOUR_PASSWORD',
'mainPhone' => '+15555550100',
'notes' => 'notes',
'address' => '123 Main Street, Springfield',
'mode' => 'dry',
'coType' => 'IO'
]),
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://core.grdd.dev/api/company/register"
payload := strings.NewReader("{\n \"name\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\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://core.grdd.dev/api/company/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.grdd.dev/api/company/register")
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\": \"Acme Transportation\",\n \"griddid\": \"acme-transportation\",\n \"mainEmail\": \"dispatch@example.com\",\n \"password\": \"YOUR_PASSWORD\",\n \"confirmPassword\": \"YOUR_PASSWORD\",\n \"mainPhone\": \"+15555550100\",\n \"notes\": \"notes\",\n \"address\": \"123 Main Street, Springfield\",\n \"mode\": \"dry\",\n \"coType\": \"IO\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Body
application/json
Company registration data
Response
Success. In dry mode the body has the proposed griddid.