Account API
Account API Reference
The Account API allows you to create, update, validate and share accounts in Domo. If you would like to manage a large number of accounts at scale from agencies or other 3rd party vendors that you currently manage individually through the Data Center in Domo, the Accounts API makes that possible.
*Note – The Accounts API will only return information for accounts you own or for accounts that have been shared with you in Domo.
The Account Object
Account Attributes
Property Name | Type | Description |
---|---|---|
id | String | The ID of the Account |
name | String | The name of the Account |
type | Object | The type of the Account |
valid | Boolean | Indicates if the Account needs to be re-authorized or not. |
Account's Type Attributes
Property Name | Type | Description |
---|---|---|
id | String | The ID of the Account Type |
name | String | The name of the Account Type |
_templates | Object | The Template that defines the properties required to create an Account of this type |
Account Type's Template Attributes
Property Name | Type | Description |
---|---|---|
title | String | The title of the Template |
contentType | String | The content-type header when sending the request to create an Account |
method | String | The HTTP method used when creating the Account |
properties | Array | The properties available to be sent when creating an Account |
name | String | The name of the Account Type |
_templates | Object | The Template that defines the properties required to create an Account of this type |
Account Share Attributes
Property Name | Type | Description |
---|---|---|
user | Object | The User to share the Account with. Only the User's id attribute is required. See the Users API for more information. |
List Accounts
Get a list of all Accounts for which the user has permissions.
Definition
GET https://api.domo.com/v1/accounts
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
limit | Number | Optional | The number of Accounts to return in the list. The default is 50 and the maximum is 500. |
offset | Number | Optional | The offset of Accounts to begin the list of Accounts within the response. |
Sample Request
See it in your language
See this sample request in Java.GET https://api.domo.com/v1/accounts/?offset=0&limit=1
Accept: application/json
Host: api.domo.com
Authorization: bearer <your-valid-oauth-access-token>
Returns
Returns all Accounts objects that meet argument criteria from original request.
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[{
"id": "88",
"name": "Leonhard Euler's Account",
"valid": true,
"type": {
"id": "xyz",
"properties": {}
}
}]
Retrieve an Account
Retrieves the details of an existing account.
Definition
https://api.domo.com/v1/accounts/{ACCOUNT_ID}
Sample Request
See it in your language
See this sample request in Java.GET https://api.domo.com/v1/accounts/88
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
Returns
Returns an Account object if a valid Account ID was provided. When requesting, the Account Type object will not contain any properties.
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"id": "88",
"name": "Leonhard Euler's Account",
"valid": true,
"type": {
"id": "xyz",
"properties": {}
}
}
Create an Account
When creating an Account, you must specify the Account Type properties. The Account Type properties are different, depending on the type of Account you are trying to create.
To retrieve which Account Type properties to specify, use the GET /v1/accounts/account-types/{ACCOUNT_TYPE_ID} endpoint.
Definition
POST https://api.domo.com/v1/accounts
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
name | String | Required | The name of the Account |
type | Object | Required | The Account Type object indicating the type of Account |
Sample Request
See it in your language
See this sample request in Java.POST https://api.domo.com/v1/accounts
Content-Type: application/json
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{
"name": "Leonhard Euler's XYZ Account",
"type": {
"id": "xyz",
"properties": {
"password": "cyclops",
"authenticateBy": "PASSWORD",
"url": "https://mathematicians.xyz.com",
"username": "leonhard.euler@mathematicians.com"
}
}
}
Returns
Returns an Account object when successful. The returned object will not contain any properties within the Account Type object .
Sample Response
HTTP/1.1 201 Created
Location: https://api.local.domo.com/v1/accounts/88
Content-Type: application/json;charset=UTF-8
{
"id": "88",
"name": "Leonhard Euler's Account",
"valid": true,
"type": {
"id": "xyz",
"properties": {}
}
}
Update an Account
Updates the specified Account’s metadata as well as the Account’s Type properties.
Definition
PATCH https://api.domo.com/v1/accounts/{ACCOUNT_ID}
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
account_id | String | Required | The ID of the Account |
name | String | Optional | The name of the Account |
type | Object | Optional | The Account Type's properties |
Sample Request
See it in your language
See this sample request in Java.PATCH https://api.domo.com/v1/accounts/88
Content-Type: application/json
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{
"name": "Leonhard Euler's Account",
"type": {
"id": "xyz",
"properties": {
"password": "mathematician",
"authenticateBy": "PASSWORD",
"url": "https://mathematicians.xyz.com",
"username": "leonhard.euler@mathematicians.com"
}
}
}
Returns
Returns the updated Account.
Sample Response
HTTP/1.1 200 OK
Location: https://api.local.domo.com/v1/accounts/88
Content-Type: application/json;charset=UTF-8
{
"id": "88",
"name": "Leonhard Euler's Account",
"valid": true,
"type": {
"id": "xyz",
"properties": {}
}
}
Delete an Account
Deletes an Account from your Domo instance.
Definition
DELETE https://api.domo.com/v1/accounts/{ACCOUNT_ID}
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
account_id | String | Required | The ID of the Account to delete |
Sample Request
See it in your language
See this sample request in Java.DELETE https://api.domo.com/v1/accounts/88
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
Sample Response
HTTP/1.1 204 No Content
List Account Types
Get a list of all Account Types for which the user has permissions.
Definition
GET https://api.domo.com/v1/account-types
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
limit | Number | Optional | The number of Account Types to return in the list. The default is 50 and the maximum is 500. |
offset | Number | Optional | The offset of the Account Types to begin list of Account Types within the response. |
Sample Request
See it in your language
See this sample request in Java.GET https://api.domo.com/v1/account-types/?offset=0&limit=1
Accept: application/json
Host: api.domo.com
Authorization: bearer <your-valid-oauth-access-token>
Returns
Returns all Account Type objects that meet argument criteria from original request.
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[{
"id": "basecamp",
"name": "Basecamp"
}]
Get Account Type
Retrieve the details of an account type. This includes information on the properties required to create an Account of this type.
Definition
GET https://api.domo.com/v1/account-types/{ACCOUNT_TYPE_ID}
Arguments
Property Name | Type | Required | Description |
---|---|---|---|
account_type_id | String | Required | The ID of the Account Type |
Sample Request
See it in your language
See this sample request in Java.GET https://api.domo.com/v1/account-types/xyz
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
Returns
Returns an Account Type object if valid Account Type ID was provided.
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"id": "xyz",
"name": "XYZ",
"_templates": {
"default": {
"title": "Create XYZ Account",
"contentType": "application/json",
"method": "post",
"key": "default",
"properties": [{
"name": "username",
"prompt": "Username",
"required": true
},
{
"name": "authenticateBy",
"prompt": "Authenticate By",
"regex": "{"options":["API Token","Password"]}",
"required": true
},
{
"name": "password",
"prompt": "Secret",
"required": true
},
{
"name": "endpoint",
"prompt": "XYZ URL",
"required": true
}
]
}
}
}