Accounts
Accounts are passive entities that store quota information for resources consumed by associated profiles. An account is created for a user when they first sign up.
Objects
Account
| Path | JSON Type | Format | Description |
|---|---|---|---|
id | string | Version 4 UUID | The account ID |
created | string | ISO 8601 timestamp | The instant at which the account was created |
lastModified | string | ISO 8601 timestamp | The instant at which the account was last modified |
company | string | The name of the company associated with the account | |
ownerEmail | string | Email address | The email address of the owner profile |
ownerProfileId | string | The ID of the owner profile | |
maxWorkspaces | number | Unsigned integer | The maximum number of workspaces that can be created under the account |
maxRows | number | Unsigned integer | The maximum number of managed database rows available to the account |
minutesPerMonth | number | Unsigned integer | The number of pipeline run minutes available to the account per month |
minutesUsed | number | Unsigned integer | The number of pipeline run minutes used by the account per month |
maxClients | number | Unsigned integer | The number of API key clients available to the account |
Requests
View all accounts
GET /api/accounts
Returns all accounts the authenticated user profile is an owner of.
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts' -i -X GET
import requests
url = "https://app.meltano.com:443/api/accounts"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Account collection with HAL links.
Example response body
View an account
GET /api/accounts/{account-id}
Returns the account {account-id}.
Prerequisites
- Account
{account-id}must exist - The authenticated user profile must be an owner of the account
{account-id}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub' -i -X GET
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Account with HAL links.
Example response body
Initialise a new account
POST /api/accounts/new
Initialises a new account.
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/new' -i -X POST \
-H 'Content-Type: application/json'
import requests
url = "https://app.meltano.com:443/api/accounts/new"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Account with HAL links.
Example response body
Create an account
PUT /api/accounts/{account-id}
Creates the account {account-id}.
Prerequisites
- The
ownerEmailmust match the authenticated user profile's email address
Body
Account resource.
{
"company" : "Test Company",
"ownerEmail" : "sit+prod+2@meltano.com"
}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub' -i -X PUT \
-H 'Content-Type: application/json' \
-d '{
"company" : "Test Company",
"ownerEmail" : "sit+prod+2@meltano.com"
}'
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub"
data = {
"company" : "Test Company",
"ownerEmail" : "sit+prod+2@meltano.com"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
201 Created
Account with HAL links.
Example response body
Update an account
PUT /api/accounts/{account-id}
Updates the account {account-id}.
Prerequisites
- Account
{account-id}must exist - The authenticated user profile must be an owner of the account
{account-id}
Body
Account resource.
{
"company" : "Test Company (updated)",
"ownerEmail" : "sit+prod@meltano.com",
"maxWorkspaces" : 0,
"maxRows" : 0,
"minutesPerMonth" : 0,
"maxClients" : 0
}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub' -i -X PUT \
-H 'Content-Type: application/json' \
-d '{
"company" : "Test Company (updated)",
"ownerEmail" : "sit+prod@meltano.com",
"maxWorkspaces" : 0,
"maxRows" : 0,
"minutesPerMonth" : 0,
"maxClients" : 0
}'
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub"
data = {
"company" : "Test Company (updated)",
"ownerEmail" : "sit+prod@meltano.com",
"maxWorkspaces" : 0,
"maxRows" : 0,
"minutesPerMonth" : 0,
"maxClients" : 0
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
200 OK
Account with HAL links.
Example response body
View all account admins
GET /api/accounts/{account-id}/admins
Returns all admins of the account {account-id}.
Prerequisites
- The authenticated user profile must be an owner of the account
{account-id}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins' -i -X GET
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Profile collection with HAL links.
Example response body
Add an account admin
PUT /api/accounts/{account-id}/admins/{profile-id}
Adds the profile {profile-id} as an admin of the account {account-id}.
Prerequisites
- The authenticated user profile must be an owner of the account
{account-id} - Profile
{profile-id}must exist
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins/auth0%7C6a21dcb31409cf3514bdf167' -i -X PUT \
-H 'Content-Type: application/json'
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins/auth0%7C6a21dcb31409cf3514bdf167"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Account with HAL links.
Example response body
Remove an account admin
DELETE /api/accounts/{account-id}/admins/{profile-id}
Removes the profile {profile-id} as an admin of the account {account-id}.
Prerequisites
- The authenticated user profile must be an owner of the account
{account-id} - Profile
{profile-id}must be an admin of the account{account-id}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins/auth0%7C6a21dcb31409cf3514bdf167' -i -X DELETE
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub/admins/auth0%7C6a21dcb31409cf3514bdf167"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.
Set an account owner
PUT /api/accounts/{account-id}/owner/{profile-id}
Sets the profile {profile-id} as the primary owner of the account {account-id}.
Prerequisites
- The authenticated user profile must be an owner of the account
{account-id} - Profile
{profile-id}must be an admin of the account{account-id}
Examples
- cURL
- Python (requests)
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.meltano.com:443/api/accounts/wlsdb-zejub/owner/auth0%7C6a21dcb31409cf3514bdf167' -i -X PUT \
-H 'Content-Type: application/json'
import requests
url = "https://app.meltano.com:443/api/accounts/wlsdb-zejub/owner/auth0%7C6a21dcb31409cf3514bdf167"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Account with HAL links.
Example response body
Transfer a workspace
PUT /api/accounts/{account-id}/workspaces/{workspace-id}/transfer
Transfers the workspace {workspace-id} to the account {account-id}.
Prerequisites
- The user must be the owner of the account
{account-id}
Response
200 OK
Workspace with HAL links.