Create a sub-organization.
print_mail.sub_organizations.update(SubOrganizationUpdateParams**kwargs) -> SubOrganizationUpdateResponse
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.
Parameters
Create a sub-organization.
import os
from postgrid import PostGrid
client = PostGrid(
print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"), # This is the default and can be omitted
)
sub_organization = client.print_mail.sub_organizations.update(
country_code="CA",
email="[email protected]",
name="Calvin",
organization_name="PostGrid",
password="very-strong-password",
phone_number="9059059059",
)
print(sub_organization.sub_organization){
"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"
}
}