Organization API

Organization Access Control

Get the currently logged-in user's account list

Retrieves a list of account objects associated with the currently authenticated user. This is a GET operation. The response is a JSON array containing metadata for each account, such as organization name and ID.

Create a new account

Creates a new account (organization) using the provided account input object. This is a POST operation that accepts a JSON body and returns the created account object in JSON format.

post{hostname}/organizations
Body:
{
"organization_name": "SajMix inc # Type: string"
}

API Request Parameters

NameTypeRequired FieldDescription
organization_namestringTrueThe name of the organization

Update existing account

Updates details, such as organization name, for the specified existing account. This is a PUT operation that accepts a JSON body and returns the updated account object.

Body:
{
"id": "113 # Type: integer",
"organization_name": "SajMix inc # Type: string"
}

API Request Parameters

NameTypeRequired FieldDescription
idintegerTrueThe numeric ID of the of the Account
organization_namestringTrueThe name of the organization

Get existing account with account ID

Retrieves a specific account by its account ID. This is a GET operation. The JSON response contains the account metadata, such as ID and organization name.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the target account. Type: integer (int64). Must be included in the URL path. Required.

Delete account with ID

Deletes an organization account identified by its account ID. This is a DELETE operation. Returns HTTP 200 or 204 on successful deletion.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the target account. Type: integer (int64). Must be included in the URL path. Required.

Remove the currently logged-in user from an account

Removes the currently authenticated user from the specified organization. This is a GET operation. Returns HTTP 200 on successful removal.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account

Get the current user's current role within the specified account

Retrieves the role of the currently authenticated user within the specified organization. This is a GET operation. The response is a string indicating the user role.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account

Get an account's summary

Retrieves summary data for the specified organization account. This is a GET operation. The response is a JSON array containing summary metrics and statistics for the organization.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account

Get the list of users in an account

Retrieves a paginated list of users associated with the specified account ID. This is a GET operation. The JSON response containing user data and pagination metadata.

Path Query Arguments Example

{hostname}/organizations/{organization_id}/users?page_number=9&page_size=0&sort_ascending=false&sort_by=Jozhan

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account
page_numberintegerFalseThe page number to retrieve (starting from 0). Should be included in the query string. Optional.
page_sizeintegerFalseThe number of records to return per page. For example: 25. Should be included in the query string. Optional.
sort_ascendingbooleanFalseFlag indicating the sorted order of the result. True is ascending, while false is descending
sort_bystringFalseFlag indicating the property to which records should be sorted by

Add users to an account

Adds users to the specified organization account. This is a POST operation that accepts a JSON body and returns the updated account object.

post{hostname}/organizations/{organization_id}/users
Body:
{
"is_active": "true # Type: boolean",
"role": "CONTRIBUTOR # Type: string",
"user_ids": "14,31,33,43 # Type: array"
}

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account
is_activebooleanTrueThis flag determines if this user(s) accounts are activated
rolestringTrueThis is the role of a user(s) based on a particular account. Options: 'OWNER', 'ADMIN', 'CONTRIBUTOR', 'ACCOUNTING' & 'VIEWER'
user_idsarrayTrueThis is an array of user IDs (integers). Example: [14, 31, 33, 43]

Update account users

Updates user roles or access levels in the specified organization account. This is a PUT operation that accepts a JSON body and returns the updated account object.

Body:
{
"is_active": "true # Type: boolean",
"role": "CONTRIBUTOR # Type: string",
"user_ids": "14,31,33,43 # Type: array"
}

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account
is_activebooleanTrueThis flag determines if this user(s) accounts are activated
rolestringTrueThis is the role of a user(s) based on a particular account. Options: 'OWNER', 'ADMIN', 'CONTRIBUTOR', 'ACCOUNTING' & 'VIEWER'
user_idsarrayTrueThis is an array of user IDs (integers). Example: [14, 31, 33, 43]

Remove user from an account

Removes one or more users (identified by userIds) from the specified organization account. This is a DELETE operation. Returns HTTP 200 or 204 if successful.

API Request Parameters

NameTypeRequired FieldDescription
organization_idintegerTrueThe numeric ID of the of the account
user_idsstringTrueThis property is a comma-separated string of user IDs to be removes. Type: string. Must be included in the URL path. Required. Example: 23,63,34,31,78,68