Create a sub-organization.
POST/print-mail/v1/sub_organizations
When creating a user through the API, the verifiedEmail field will automatically be set to true. However, if public signups are used, the email will need to be verified by the user.
Body ParametersJSON
Create a sub-organization.
curl https://api.postgrid.com/print-mail/v1/sub_organizations \
-H 'Content-Type: application/json' \
-H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
-d '{
"countryCode": "CA",
"email": "[email protected]",
"name": "Calvin",
"organizationName": "PostGrid",
"password": "very-strong-password"
}'{
"user": {
"id": "user_abc123def456ghi6789",
"pendingInvite": false,
"organization": "org_abc123def456ghi6789",
"email": "[email protected]",
"name": "Calvin",
"apiKeys": [
{
"value": "live_abcdefg"
},
{
"value": "test_abcdefg"
}
],
"verifiedEmail": true,
"roles": [
"role_abc123def456ghi6789"
]
},
"subOrganization": {
"usage": 0,
"limit": 500,
"spend": 0,
"name": "PostGrid",
"countryCode": "CA",
"id": "sub_org_abc123def456ghi6789",
"object": "sub_org",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}
}Returns Examples
{
"user": {
"id": "user_abc123def456ghi6789",
"pendingInvite": false,
"organization": "org_abc123def456ghi6789",
"email": "[email protected]",
"name": "Calvin",
"apiKeys": [
{
"value": "live_abcdefg"
},
{
"value": "test_abcdefg"
}
],
"verifiedEmail": true,
"roles": [
"role_abc123def456ghi6789"
]
},
"subOrganization": {
"usage": 0,
"limit": 500,
"spend": 0,
"name": "PostGrid",
"countryCode": "CA",
"id": "sub_org_abc123def456ghi6789",
"object": "sub_org",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}
}