Create HID Org
Create a new HID org for your enterprise or partner account. Generates credentials and queues automation to finish HID setup.
name
string
Organization name
full_address
string
Full address
phone
string
Primary phone
first_name
string
Admin first name
last_name
string
Admin last name
Request
curl -X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d '{"name":"My Org","full_address":"1 Main St, NY NY","phone":"+1-555-0000","first_name":"Ada","last_name":"Lovelace"}' \
https://api.accessgrid.com/v1/console/hid/orgs
require 'accessgrid'
account_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid::Client.new(account_id, secret_key)
# Create HID org
org = client.console.hid.orgs.create(
name: 'My Org',
full_address: '1 Main St, NY NY',
phone: '+1-555-0000',
first_name: 'Ada',
last_name: 'Lovelace'
)
puts "Created org: #{org.name} (ID: #{org.id})"
puts "Slug: #{org.slug}"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const createOrg = async () => {
try {
// Create HID org
const org = await client.console.hid.orgs.create({
name: 'My Org',
fullAddress: '1 Main St, NY NY',
phone: '+1-555-0000',
firstName: 'Ada',
lastName: 'Lovelace'
});
console.log(`Created org: ${org.name} (ID: ${org.id})`);
console.log(`Slug: ${org.slug}`);
} catch (error) {
console.error('Error creating HID org:', error);
}
};
createOrg();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
# Create HID org
org = client.console.hid.orgs.create(
name='My Org',
full_address='1 Main St, NY NY',
phone='+1-555-0000',
first_name='Ada',
last_name='Lovelace'
)
print(f"Created org: {org.name} (ID: {org.id})")
print(f"Slug: {org.slug}")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
org, err := client.Console.HID.Orgs.Create(ctx, &accessgrid.CreateHIDOrgParams{
Name: "My Org",
FullAddress: "1 Main St, NY NY",
Phone: "+1-555-0000",
FirstName: "Ada",
LastName: "Lovelace",
})
if err != nil {
fmt.Printf("Error creating org: %v\n", err)
return
}
fmt.Printf("Created org: %s (ID: %s)\n", org.Name, org.ID)
fmt.Printf("Slug: %s\n", org.Slug)
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task CreateOrgAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
// Create HID org
var org = await client.Console.HID.Orgs.CreateAsync(new CreateHIDOrgRequest
{
Name = "My Org",
FullAddress = "1 Main St, NY NY",
Phone = "+1-555-0000",
FirstName = "Ada",
LastName = "Lovelace"
});
Console.WriteLine($"Created org: {org.Name} (ID: {org.Id})");
Console.WriteLine($"Slug: {org.Slug}");
}
public class CreateHIDOrgRequest
{
public string Name { get; set; }
public string FullAddress { get; set; }
public string Phone { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.HIDOrg;
import com.organization.accessgrid.model.CreateHIDOrgParams;
public class HIDOrgService {
private final AccessGridClient client;
public HIDOrgService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void createOrg() throws AccessGridException {
// Create HID org
CreateHIDOrgParams params = CreateHIDOrgParams.builder()
.name("My Org")
.fullAddress("1 Main St, NY NY")
.phone("+1-555-0000")
.firstName("Ada")
.lastName("Lovelace")
.build();
HIDOrg org = client.console().hid().orgs().create(params);
System.out.printf("Created org: %s (ID: %d)%n", org.getName(), org.getId());
System.out.printf("Slug: %s%n", org.getSlug());
}
}
Response
[
{
"id": "91c2a7e4f8b",
"name": "Acme Corporation",
"slug": "acme-corp",
"first_name": "John",
"last_name": "Doe",
"phone": "+1-415-555-0198",
"full_address": "123 Market Street, San Francisco, CA 94105, USA",
"status": "active",
"created_at": "2024-08-12T11:32:45Z"
},
{
"id": "b73d9f21a3c",
"name": "Globex Industries",
"slug": "globex-industries",
"first_name": "Jane",
"last_name": "Smith",
"phone": "+1-212-555-7744",
"full_address": "456 Madison Avenue, New York, NY 10022, USA",
"status": "pending",
"created_at": "2025-02-03T09:18:10Z"
}
]
List HID Orgs
List HID orgs created under the current enterprise or partner account.
Request
curl -X GET \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
https://api.accessgrid.com/v1/console/hid/orgs
require 'accessgrid'
account_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid::Client.new(account_id, secret_key)
# List all HID orgs
orgs = client.console.hid.orgs.list
# Print orgs
orgs.each do |org|
puts "Org ID: #{org.id}, Name: #{org.name}, Slug: #{org.slug}"
end
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const listOrgs = async () => {
try {
// List all HID orgs
const orgs = await client.console.hid.orgs.list();
// Print orgs
orgs.forEach(org => {
console.log(`Org ID: ${org.id}, Name: ${org.name}, Slug: ${org.slug}`);
});
} catch (error) {
console.error('Error listing HID orgs:', error);
}
};
listOrgs();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
# List all HID orgs
orgs = client.console.hid.orgs.list()
# Print orgs
for org in orgs:
print(f"Org ID: {org.id}, Name: {org.name}, Slug: {org.slug}")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
orgs, err := client.Console.HID.Orgs.List(ctx)
if err != nil {
fmt.Printf("Error listing orgs: %v\n", err)
return
}
for _, org := range orgs {
fmt.Printf("Org ID: %s, Name: %s, Slug: %s\n", org.ID, org.Name, org.Slug)
}
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task ListOrgsAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
// List all HID orgs
var orgs = await client.Console.HID.Orgs.ListAsync();
// Print orgs
foreach (var org in orgs)
{
Console.WriteLine($"Org ID: {org.Id}, Name: {org.Name}, Slug: {org.Slug}");
}
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.HIDOrg;
import java.util.List;
public class HIDOrgService {
private final AccessGridClient client;
public HIDOrgService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void listOrgs() throws AccessGridException {
// List all HID orgs
List<HIDOrg> orgs = client.console().hid().orgs().list();
// Print orgs
for (HIDOrg org : orgs) {
System.out.printf("Org ID: %d, Name: %s, Slug: %s%n",
org.getId(),
org.getName(),
org.getSlug());
}
}
}
Response
Empty
Finish HID Org Registration
Complete the HID org registration process after creating an org. This is a follow-up step to 'Create HID Org' and should be called once you receive the HID registration email with credentials. The email and password are provided by HID during their registration process.
string
Email address from the HID registration email
password
string
Temporary password from the HID registration email
Request
curl -X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"hid-password-123"}' \
https://api.accessgrid.com/v1/console/hid/orgs/activate
require 'accessgrid'
account_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid::Client.new(account_id, secret_key)
# Complete HID org registration with credentials from HID email
result = client.console.hid.orgs.activate(
email: '[email protected]',
password: 'hid-password-123'
)
puts "Completed registration for org: #{result.name}"
puts "Status: #{result.status}"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const completeRegistration = async () => {
try {
// Complete HID org registration with credentials from HID email
const result = await client.console.hid.orgs.activate({
email: '[email protected]',
password: 'hid-password-123'
});
console.log(`Completed registration for org: ${result.name}`);
console.log(`Status: ${result.status}`);
} catch (error) {
console.error('Error completing HID org registration:', error);
}
};
completeRegistration();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
# Complete HID org registration with credentials from HID email
result = client.console.hid.orgs.activate(
email='[email protected]',
password='hid-password-123'
)
print(f"Completed registration for org: {result.name}")
print(f"Status: {result.status}")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
result, err := client.Console.HID.Orgs.Activate(ctx, &accessgrid.CompleteHIDOrgParams{
Email: "[email protected]",
Password: "hid-password-123",
})
if err != nil {
fmt.Printf("Error completing registration: %v\n", err)
return
}
fmt.Printf("Completed registration for org: %s\n", result.Name)
fmt.Printf("Status: %s\n", result.Status)
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task CompleteRegistrationAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
// Complete HID org registration with credentials from HID email
var result = await client.Console.HID.Orgs.ActivateAsync(new CompleteHIDOrgRequest
{
Email = "[email protected]",
Password = "hid-password-123"
});
Console.WriteLine($"Completed registration for org: {result.Name}");
Console.WriteLine($"Status: {result.Status}");
}
public class CompleteHIDOrgRequest
{
public string Email { get; set; }
public string Password { get; set; }
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.HIDOrg;
import com.organization.accessgrid.model.CompleteHIDOrgParams;
public class HIDOrgService {
private final AccessGridClient client;
public HIDOrgService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void completeRegistration() throws AccessGridException {
// Complete HID org registration with credentials from HID email
CompleteHIDOrgParams params = CompleteHIDOrgParams.builder()
.email("[email protected]")
.password("hid-password-123")
.build();
HIDOrg result = client.console().hid().orgs().activate(params);
System.out.printf("Completed registration for org: %s%n", result.getName());
System.out.printf("Status: %s%n", result.getStatus());
}
}
<?php
require_once 'vendor/autoload.php';
use AccessGrid\Client;
$accountId = getenv('ACCOUNT_ID');
$secretKey = getenv('SECRET_KEY');
$client = new Client($accountId, $secretKey);
// Complete HID org registration with credentials from HID email
$result = $client->console->hid->orgs->activate([
'email' => '[email protected]',
'password' => 'hid-password-123'
]);
echo "Completed registration for org: {$result->name}\n";
echo "Status: {$result->status}\n";
?>
Response
Empty