Skip to main content

Accounts

accounts-me

GET /accounts/me

My account

Return current user account information. This is often used to validate authentication.

Parameters

NameInTypeRequiredDescription
x-api-keyheaderstringtrueAPI Authentication Key

Example responses

200 Response

{
"id": "string",
"name": "string",
"email": "user@example.com",
"phone": "string",
"is_active": true,
"is_suspended": true,
"last_login": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"billing": {
"parent_account": "string"
}
}

Responses

StatusMeaningDescriptionSchema
200OKA user objectAccountDetailsResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.get('https://data.autohost.ai/v1/accounts/me', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';

const headers = {
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/me', {
method: 'get',

headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-children

GET /accounts/children

Reseller accounts list

Paginated list of user accounts belonging to a reseller profile.

Parameters

NameInTypeRequiredDescription
fromquerynumberfalsePagination control
sizequerynumberfalseNumber of items to return
x-api-keyheaderstringtrueAPI Authentication Key

Example responses

200 Response

{
"from": 0,
"size": 0,
"total": 0,
"items": [
{
"id": "string",
"name": "string",
"email": "user@example.com",
"phone": "string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKA list of account objectsAccountChildrenResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.get('https://data.autohost.ai/v1/accounts/children', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';

const headers = {
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/children', {
method: 'get',

headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-keys

GET /accounts/keys

Reseller API keys

List of API keys for all accounts owned by a reseller.

Parameters

NameInTypeRequiredDescription
x-api-keyheaderstringtrueAPI Authentication Key

Example responses

200 Response

[
{
"user_id": "string",
"user_name": "string",
"value": "string"
}
]

Responses

StatusMeaningDescriptionSchema
200OKA list of account objectsAccountApiKeysResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.get('https://data.autohost.ai/v1/accounts/keys', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';

const headers = {
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/keys', {
method: 'get',

headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-register

POST /accounts/register

Reseller new account

Register a new account under a channel profile. This is used by resellers and channel partners to create Autohost user accounts.

Parameters

NameInTypeRequiredDescription
x-api-keyheaderstringfalseAPI Authentication Key
bodybodyAccountRegistrationRequestfalseJSON object with user account details

Body parameter

{
"name": "string",
"email": "user@example.com",
"phone": "string",
"password": "string",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
}
}

Example responses

200 Response

{
"id": "string",
"name": "string",
"email": "user@example.com",
"phone": "string",
"is_active": true,
"is_suspended": true,
"last_login": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"billing": {
"parent_account": "string"
}
}

Responses

StatusMeaningDescriptionSchema
200OKA user objectAccountDetailsResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.post('https://data.autohost.ai/v1/accounts/register', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';
const inputBody = {
"name": "string",
"email": "user@example.com",
"phone": "string",
"password": "string",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
}
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/register', {
method: 'post',
body: JSON.stringify(inputBody),
headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-update

PUT /accounts/{id}

Reseller update account

Update a channel account. This is used by resellers and channel partners to update Autohost user accounts.

Parameters

NameInTypeRequiredDescription
idpathstringtrueAutohost user ID
suspendedquerystringfalseSuspend or unsuspend the account
statusquerystringfalseEnable or disable the account
x-api-keyheaderstringfalseAPI Authentication Key
bodybodyAccountRegistrationRequestfalseJSON object with user account details

Enumerated Values

ParameterValue
suspendedtrue
suspendedfalse
statusactive
statusdisabled

Body parameter

{
"name": "string",
"email": "user@example.com",
"phone": "string",
"password": "string",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
}
}

Example responses

200 Response

{
"id": "string",
"name": "string",
"email": "user@example.com",
"phone": "string",
"is_active": true,
"is_suspended": true,
"last_login": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"billing": {
"parent_account": "string"
}
}

Responses

StatusMeaningDescriptionSchema
200OKUser account objectAccountDetailsResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.put('https://data.autohost.ai/v1/accounts/{id}', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';
const inputBody = {
"name": "string",
"email": "user@example.com",
"phone": "string",
"password": "string",
"company": {
"name": "string",
"email": "user@example.com",
"phone": "string"
}
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/{id}', {
method: 'put',
body: JSON.stringify(inputBody),
headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-signup

POST /accounts/signup

Reseller signup link

Generate a self-signup link for a given PMS. This is used by resellers and channel partners to create registration links they can send to their customers.

Parameters

NameInTypeRequiredDescription
pmsqueryQueryParamPMStruePMS integration name
redirectquerystringfalseURL to redirect to after signup
hidepwquerystringfalseHide password screen during user signup
x-api-keyheaderstringfalseAPI Authentication Key

Enumerated Values

ParameterValue
pmsapi
pmsapaleo
pmsbeds24
pmsbooking
pmscloudbeds
pmsguesty
pmshostaway
pmshostfully
pmsinforhms
pmsimpala
pmslavanda
pmsmyvr
pmsopera
pmssmartbnb
pmsstayntouch
pmsstreamline
pmstrackhs

Example responses

200 Response

{
"url": "http://example.com",
"expiry": "2019-08-24T14:15:22Z"
}

Responses

StatusMeaningDescriptionSchema
200OKA signup objectAccountSignupLinkResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}

params = {
'pms': 'api'
}

r = requests.post('https://data.autohost.ai/v1/accounts/signup', headers=headers, params=params)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';

const headers = {
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/signup', {
method: 'post',

headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-webhooks-create

POST /accounts/webhooks

Account create webhook

Register a new webhook. This is used by platforms such as Zapier to register webhooks.

Parameters

NameInTypeRequiredDescription
x-api-keyheaderstringtrueAPI Authentication Key
bodybodyAccountWebhooksRequestfalseJSON object with webhook details

Body parameter

{
"webhook_url": "http://example.com",
"webhook_key": "guest_portal_webhook_url"
}

Example responses

200 Response

{
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKWebhooks objectAccountWebhooksResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.post('https://data.autohost.ai/v1/accounts/webhooks', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';
const inputBody = {
"webhook_url": "http://example.com",
"webhook_key": "guest_portal_webhook_url"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/webhooks', {
method: 'post',
body: JSON.stringify(inputBody),
headers,
});
const responseJson = await response.json();
console.log(responseJson);

accounts-webhooks-delete

DELETE /accounts/webhooks

Account remove webhook

Delete an existing webhook. This is used by platforms such as Zapier to unregister webhooks.

Parameters

NameInTypeRequiredDescription
x-api-keyheaderstringtrueAPI Authentication Key
bodybodyAccountWebhooksRequestfalseJSON object with webhook details

Body parameter

{
"webhook_url": "http://example.com",
"webhook_key": "guest_portal_webhook_url"
}

Example responses

200 Response

{
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKWebhooks objectAccountWebhooksResponse
400Bad RequestAn error messageErrorResponse

Code samples

"""
Python Code Snippet
"""
import requests

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.delete('https://data.autohost.ai/v1/accounts/webhooks', headers=headers)

print(r.json())

/*
TypeScript Code Snippet
*/

import fetch from 'node-fetch';
const inputBody = {
"webhook_url": "http://example.com",
"webhook_key": "guest_portal_webhook_url"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-api-key':'string'
};

const response = await fetch('https://data.autohost.ai/v1/accounts/webhooks', {
method: 'delete',
body: JSON.stringify(inputBody),
headers,
});
const responseJson = await response.json();
console.log(responseJson);