Accounts & Users: CRUD Account Types

The following are endpoints related to account types.

 

Create an account type

Used by super admin in order to create an account type.

Summary

  • Endpoint: /account_types
  • Method: POST
  • Required User Type: SA

Body Parameters

  • name - account type name
    • Required 
  • description - a description for this account type
    • Required
  • custom_params - a object of custom parameters for this account type

 

Response

A successful response will return an object containing information about the created account type.

 

Example

Request Body

{
"description": "My first account type",
"name": "Account Type 1"
}

Response Data

{
"description": "My first account type",
"account_type_id": "2645f51b-04e5-4909-8e4e-25564fb11415"
"api_basic_user": "dt_2645f51b-04e5-4909-8e4e-25564fb11415",
"name": "Account Type 1"
}
 

 

Retrieve account types

Used by super admin in order to get a list of all account types.

Summary

  • Endpoint: /account_types
  • Method: GET
  • Required User Type: None, this works for all users

Response

A successful response will return an array of objects where each of the objects contains information about a different account type.

 

Example

Request URL

/account_types

Response Data

[{
"description": "My first account type",
"account_type_id": "2645f51b-04e5-4909-8e4e-25564fb11415"
"api_basic_user": "dt_2645f51b-04e5-4909-8e4e-25564fb11415",
"name": "Account Type 1"
}]
 

 

Update an account type

Used by super admin in order to update an account type.

Summary

  • Endpoint: /account_types/{account_type_id}
  • Method: PATCH
  • Required User Type: SA

Path Parameters

  • account_type_id - ID of account type to update

Body Parameters

  • name - account type name
  • description - a description for this account type
  • custom_params - a object of custom parameters for this account type

Response

A successful response will return an object that contains information about the updated account type.

 

Example

Request URL

/account_types/2645f51b-04e5-4909-8e4e-25564fb11415

Request Body

{
"description": "My first account type",
"name": "Account Type 2"
}

Response Data

{
"description": "My first account type",
"account_type_id": "2645f51b-04e5-4909-8e4e-25564fb11415"
"api_basic_user": "dt_2645f51b-04e5-4909-8e4e-25564fb11415",
"name": "Account Type 1"
}
 

 

Delete an account type

Used by super admin in order to delete an account type. This operation will also remove all accounts' connections to this account type.

Summary

  • Endpoint: /account_types/{account_type_id}
  • Method: DELETE
  • Required User Type: SA

Path Parameters

  • account_type_id - ID of account type to update

Response

A successful response will return an empty HTTP 200 response

 

Example

Request URL

/account_types/2645f51b-04e5-4909-8e4e-25564fb11415