Accounts
This section provides details on the account model used to manage service lines programmatically. Below are the properties that define an account.
The account model
The account model represents various attributes associated with an account, including identification details, contact information, and permissions.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the service line.
- Name
name
- Type
- string
- Description
The name of the account
- Name
email
- Type
- string
- Description
The email of the account
- Name
contact_person
- Type
- string
- Description
The contact person of the account
- Name
contact_number
- Type
- string | null
- Description
The contact number of the account
- Name
email
- Type
- string
- Description
The email of the account
- Name
account_id
- Type
- string
- Description
The account id issue by Polaris, starts with
acct_
- Name
region
- Type
- string
- Description
The region which the account is registered
- Name
iso_currency_code
- Type
- string
- Description
The ISO currency code of the account
- Name
can_generate_token
- Type
- boolean
- Description
If the account can generate access tokens
- Name
can_generate_token
- Type
- boolean
- Description
If the account can add users
- Name
created_at
- Type
- timestamp
- Description
Date of which the account is created
- Name
updated_at
- Type
- timestamp
- Description
Date of which the account is updated_at
List all accounts
This endpoint allows you to retrieve a paginated list of all your accounts. By default, a maximum of 50
accounts are shown per page.
Optional attributes
- Name
per_page
- Type
- integer
- Description
Limit the number of accounts returned.
- Name
page
- Type
- integer
- Description
The current page number of accounts
- Name
filter[account_id]
- Type
- string
- Description
Filter the accounts by account_id
- Name
filter[is_primary]
- Type
- string
- Description
Filter the primary accounts without the sub-accounts
- Name
filter[search]
- Type
- string
- Description
Filter the service line by search query.
Request
curl -G https://api.polaris.revlv.com/v1/accounts \
-H "Authorization: Bearer {token}" \
-H "Polaris-Account: {account_id}" \
-d per_page=50
Response
{
"data": [
{
"id": "63a42653-8ca2-3c73-bda7-5428f6527d0e",
"account_id": "acct_812312K",
"subscription_reference_id": "1231238021321",
"service_line_number": "AST-12398123-12312",
"address_reference_id": "1231203sfaslkjf12803",
"alias": "LEO-01-0001",
"nickname": "24823 Strosin Pass\nJeffton, UT 44815",
"start_at": "2024-06-07T23:36:17+00:00",
"end_at": null
},
{
"id": "97c50f61-3754-3a9c-a16d-c580677d5fed"
// ...
}
]
}
Retrieve an account
This endpoint allows you to retrieve a account by providing the account_id
.
Refer to the list at the top of this page to see which properties are included with Account object.
Request
curl https://api.polaris.revlv.com/v1/accounts/acct_TbaK4vpY18 \
-H "Authorization: Bearer {token}" \
-H "Polaris-Account: {account_id}" \
Response
{
"data": {
"id": "9c3bba01-70c3-49ce-8562-e890b7ead0e1",
"name": "Acme Inc",
"email": "acme@mail.com",
"contact_person": "John Doe",
"contact_number": null,
"account_id": "acct_TbaK4vpY18",
"type": null,
"region": null,
"is_primary": true,
"region_code": "PH",
"iso_currency_code": null,
"can_generate_token": true,
"can_add_users": false,
"created_at": "2024-06-07T15:36:16.000000Z",
"updated_at": "2024-06-07T15:36:16.000000Z"
}
}
Create an account
This endpoint allows you to create a new account under your primary account.
Required attributes
- Name
name
- Type
- string
- Description
The name of the account
- Name
email
- Type
- string
- Description
The email of the account
- Name
contact_person
- Type
- string
- Description
The contact person of the account
- Name
region_code
- Type
- string
- Description
The region which the account is registered
Optional attributes
- Name
can_generate_token
- Type
- boolean
- Description
If the account can generate access tokens
- Name
can_add_users
- Type
- boolean
- Description
If the account is allowed to invite users
- Name
invite_user
- Type
- boolean
- Description
If set to
true
this will automatically invite anAdministrator
type of user based on the account information provided.
Request
curl --request POST \
--url https://api.polaris.revlv.com/v1/accounts \
--header 'Authorization: Bearer {token}' \
--header 'Polaris-Account: {account_id}' \
--header 'Content-Type: application/json' \
--data '{
"name": "{name}",
"email": "{email}",
"contact_person": "{contact_person}",
"region": "{region}"
}'
Response
{
"data": {
"id": "9c3bba01-70c3-49ce-8562-e890b7ead0e1",
"name": "Acme Inc",
"email": "acme@mail.com",
"contact_person": "John Doe",
"contact_number": null,
"account_id": "acct_TbaK4vpY18",
"type": null,
"region": null,
"is_primary": true,
"region_code": "PH",
"iso_currency_code": null,
"can_generate_token": true,
"can_add_users": false,
"created_at": "2024-06-07T15:36:16.000000Z",
"updated_at": "2024-06-07T15:36:16.000000Z"
}
}
Update an account
This endpoint allows you to perform an update on an account.
Required attributes
- Name
name
- Type
- string
- Description
The name of the account
- Name
email
- Type
- string
- Description
The email of the account
- Name
contact_person
- Type
- string
- Description
The contact person of the account
- Name
region_code
- Type
- string
- Description
The region which the account is registered
Optional attributes
- Name
can_generate_token
- Type
- boolean
- Description
If the account can generate access tokens
- Name
can_add_users
- Type
- boolean
- Description
If the account is allowed to invite users
Request
curl --request PUT \
--url https://api.polaris.revlv.com/v1/accounts/{account_id} \
--header 'Authorization: Bearer {token}' \
--header 'Polaris-Account: {account_id}' \
--header 'Content-Type: application/json' \
--data '{
"name": "{name}",
"email": "{email}",
"contact_person": "{contact_person}",
"region": "{region}"
}'
Response
{
"data": {
"id": "9c3bba01-70c3-49ce-8562-e890b7ead0e1",
"name": "Acme Inc",
"email": "acme@mail.com",
"contact_person": "John Doe",
"contact_number": null,
"account_id": "acct_TbaK4vpY18",
"type": null,
"region": null,
"is_primary": true,
"region_code": "PH",
"iso_currency_code": null,
"can_generate_token": true,
"can_add_users": false,
"created_at": "2024-06-07T15:36:16.000000Z",
"updated_at": "2024-06-07T15:36:16.000000Z"
}
}