Signup API Overview
The Signup API registers a new company and its first user on GNet core. It has two modes:- Dry mode (
"mode": "dry"): core validates the request and proposes a GNET ID. Core saves nothing. - Live mode (any other
modevalue, or nomode): core registers the company, or sends the registration to GRiDD for review.
Endpoint
POST https://core.grdd.net/api/company/register
Authentication
A token is optional. Core changes its behavior when the token has theADMIN
or GATEWAY role:
All other registrations go to GRiDD for review. See
What happens in live mode.
If you send a token, use
Authorization: Bearer <token>. See the
Core Operations overview.
Request body
Core removes spaces at the start and end of every string field before it validates the request.Required fields
Optional fields
Dry mode
Send"mode": "dry" to validate the body and get a proposed GNET ID.
Dry mode response (200)
griddidis a proposal, made fromname. If the proposed value is taken, core adds a short random suffix.- The proposal is not reserved. Live mode can assign a different GNET ID.
datais the validated request body.- Dry mode does not check for duplicate email addresses or phone numbers. Use the User Check API for that.
What happens in live mode
In live mode, core decides between direct registration and review. Core uses direct registration only whenselfSignup is true and one of these
conditions is true:
coTypeis"CO"and the caller has anADMINtoken.coTypeis"IO"and the caller has anADMINorGATEWAYtoken.coTypeis"IO"andinvitationIdis a pending GNet invitation.
Direct registration
- Core looks for an existing company with the same
mainEmailormainPhone. If it finds one, it returns409. - Core runs an automated check of the name, address, email, and phone. An
IOregistration from anADMINorGATEWAYcaller skips this check. - If the average score is above 50, core creates the company and the first user. If the score is 50 or lower, or the check fails, core sends the registration to review.
- After it creates an
IOcompany, core sends a welcome email tomainEmail.
Example live request
Responses
Check both the HTTP status and
success. Some non-error statuses (201, and
202 after a failed automated check) return "success": false, because core
did not create the company.200: company created
CO company, message is "Company created successfully".
username is the username of the first user. Core uses mainEmail in
lowercase. The first user is enabled and has the MANAGER role. The user can
sign in with this username and password through
POST /api/token.
202: submitted for review
201 and 202: sent to review after the automated check
In these cases
success is false and the body contains legacyStatus.
Error responses
If the review submission fails, core returns the status of the review service
with
"success": false and an error value.