post
https://{host}/api/v2/organizations/sub
Create Sub Organization
Creates a new sub-organization under an existing organization or another sub-organization. This endpoint allows you to specify the sub-organization's name, address or contact details, a branding photo (displayed on emails and the signing page), and the sub-organization type. The organization_uuid must be provided to indicate the parent organization.
HTTP Method and URL
POST {{host}}/api/v2/organizations/sub?user_type=ENTERPRISE_API
Authentication Requirements
This endpoint requires authentication. Include a valid user-token in your request headers. Ensure your token has sufficient permissions to create sub-organizations.
Path and Query Parameters
user_type(query, required): Must be set toENTERPRISE_API.
Request Body
The request body must be sent as multipart/form-data with the following fields:
name(string, required): Name of the sub-organization.address(string, required): Address or contact details.photo(file, optional): Image file for branding (e.g., logo).sub_organization_type_name(string, required): Type of sub-organization (e.g., Department).organization_uuid(string, required): UUID of the parent organization.
Example Request
curl -X POST "{{host}}/api/v2/organizations/sub?user_type=ENTERPRISE_API" \
-H "Authorization: Bearer {USER-TOKEN}" \
-F "name=test" \
-F "address=address" \
-F "photo=@/path/to/logo.png" \
-F "sub_organization_type_name=Department" \
-F "organization_uuid=1"
Example Successful Response
{
"id": "12345",
"name": "test",
"address": "address",
"photo_url": "https://example.com/uploads/logo.png",
"sub_organization_type_name": "Department",
"organization_uuid": "1",
"created_at": "2024-06-01T12:00:00Z"
}Error Responses
400 Bad Request
{
"error": "Missing required parameter: organization_uuid"
}401 Unauthorized
{
"error": "Invalid or missing authentication token."
}Usage Notes
- All required fields must be provided; missing fields will result in a
400 Bad Requesterror. - The
photofield is optional but recommended for branding. - Ensure your authentication token is valid and has the necessary permissions.
- The endpoint only supports
multipart/form-datafor file uploads.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
