Accounts API

The Accounts API allows you to manage details for your authorized accounts, as well as create and manage your sub-accounts.

Sub-accounts are separate account contexts that are managed and owned by your main account subscription. You can invite users to individual sub-accounts - giving them access to only the maps and content they need. Your API Keys will autaomtically work under the same roles, for any of your sub-accounts.

On this page, we'll explore the Acccounts API that let you programmatically manage your accounts and sub-accounts.

ENDPOINTS

POST /accounts/v1
GET /accounts/v1
PUT /accounts/v1
DELETE /accounts/v1
GET /catalogs/v1/sub-accounts
POST /accounts/v1/users
DELETE /accounts/v1/users/:user_id
GET /accounts/v1/users/:user_id

The account object

Properties

  • Name
    account_id
    Type
    string
    Description

    Unique identifier for the account.

  • Name
    account_name
    Type
    string
    Description

    The display name of the account.

  • Name
    account_type
    Type
    string
    Description

    Indicated the account type, based on its subscription and access level.

  • Name
    contact_info
    Type
    dict | null
    Description

    The optional contact info for the account.

  • Name
    is_active
    Type
    bool
    Description

    The flag determining if this account is active or inactive.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the account was last updated.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the account was created.

  • Name
    deleted_at
    Type
    timestamp | null
    Description

    An optional timestamp indicating when the account was created.

  • Name
    deleted_at
    Type
    timestamp | null
    Description

    An optional timestamp indicating when the account was last active.

The account object

{
  "account_id": "hSIhXnknjnlnBhNe8X1d8Et",
  "account_name": "Enterprise Business #1",
  "account_type": "enterprise",
  "contact_info": {
    "name": "John Smith",
    "email": "john.smith@enterprise.com",
    "phone": "+1 (555) 123-4567"
  },
  "is_active": true,
  "updated_at": 705103200,
  "created_at": 692233200,
  "deleted_at": 240324032,
  "last_active_at": 705103200
}

POST/accounts/v1

Create sub-account

This endpoint allows you to create a sub-account, under your account.

Required attributes

  • Name
    account_name
    Type
    string
    Description

    The name for the account.

  • Name
    account_name
    Type
    string
    Description

    The type for the account. Must be 'sub-account' for a sub-account that is authorizaed under your main account.

Optional attributes

  • Name
    contact_info
    Type
    string
    Description

    The contact information of the new account.

POST /accounts/v1

API KEY SCOPE
accounts:write
curl https://api.waygomaps.com/accounts/v1 \
    -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
    -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9" \
    -d '{
      "account_name": "New Sub Account",
      "account_type": "sub-account",
      "contact_info": "support@company.com"
    }'

Response

{
    "account_id": "3jfhhf99h293y4f93yyfe239y9eyf9eh",
    "account_name": "New Account Name",
    "account_type": "sub-account",
    "contact_info": null,
    is_active: true,
    "updated_at": 705103200,
    "created_at": 692233200,
    "deleted_at": 923740327,,
    "last_active_at": 692233200
}

GET/accounts/v1

Retrieve account details

This endpoint allows you to retrieve your account details by providing its Account ID.

GET /accounts/v1

API KEY SCOPE
accounts:read
curl https://api.waygomaps.com/accounts/v1 \
  -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
  -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9"

Response

{
    "account_id": "3jfhhf99h293y4f93yyfe239y9eyf9eh",
    "account_name": "New Account Name",
    "account_type": "sub-account",
    "contact_info": null,
    is_active: true,
    "updated_at": 705103200,
    "created_at": 692233200,
    "deleted_at": 923740327,,
    "last_active_at": 692233200
}

PUT/accounts/v1

Update account details

This endpoint allows you to perform an update on an account object.

Only the attributes included in the request will be updated in the Account object, ie. whichever attributes are not included in the request will not be changed.

Optional attributes

  • Name
    account_name
    Type
    string
    Description

    The name of the account.

  • Name
    contact_info
    Type
    dict
    Description

    The contact info for the Catalog.

PUT /accounts/v1

API KEY SCOPE
accounts:write
curl -X PUT https://api.waygomaps.com/accounts/v1 \
  -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
  -H "Waygo-Account: n39q9h0ph9324hf9h4vksh9h2f9h03hl" \
  -d account_name="Newest Account Name"

Response

{
    "account_id": "3jfhhf99h293y4f93yyfe239y9eyf9eh",
    "account_name": "Newest Account Name",
    "account_type": "sub-account",
    "contact_info": null,
    is_active: true,
    "updated_at": 705103200,
    "created_at": 692233200,
    "deleted_at": 923740327,,
    "last_active_at": 692233200
}

DELETE/accounts/v1

Delete an account

This endpoint allows you to delete a sub-account from your account, which will also delete all fino pertaining to your sub-account.

DELETE /accounts/v1

API KEY SCOPE
accounts:delete
curl -X DELETE https://api.waygomaps.com/accounts/v1 \
  -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
  -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9"

GET/accounts/v1/sub-accounts

List sub-accounts

This endpoint allows you to list the sub-accounts for your main account. By default, this endpoint returns 20 sub-accounts at a time.

GET /accounts/v1/sub-accounts

API KEY SCOPE
accounts:read
curl -X GET https://api.waygomaps.com/accounts/v1/sub-accounts \
  -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
  -H "Waygo-Account: n39q9h0ph9324hf9h4vksh9h2f9h03hl" \
  -d skip=0 \
  -d limit=20

Response

{
  "sub_accounts": [
    {
        "account_id": "3jfhhf99h293y4f93yyfe239y9eyf9eh",
        "account_name": "Newest Account Name",
        "account_type": "sub-account",
        "contact_info": null,
        "is_active": true,
        "num_maps": 12,
        "num_users": 3,
        "updated_at": 705103200,
        "created_at": 692233200,
        "deleted_at": 923740327,,
        "last_active_at": 692233200
    },
    // ...
  ],
  total: 58,
  skip: 0,
  limit: 20
}

POST/accounts/v1/users

Add user to account

With this endpoint, users have the ability to add any other users to one of their accounts or sub-accounts, with (a) given role(s).

Upon successful addition of a user to an account, that user will be notified by email that they have been added to the given account.

Required attributes

  • Name
    user_id
    Type
    string
    Description

    The email of the user to add to the account. This can be the email of a user with an existing profile, or an email for a new user profile.

  • Name
    role
    Type
    array
    Description

    A list of the Roles that the user takes on. Roles include Owner, Admin, Editor, Viewer

POST /accounts/v1/users

API KEY SCOPE
accounts:write
curl https://api.waygomaps.com/accounts/v1/users \
    -X POST \
    -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
    -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9" \
    -d '{
      "user_id": "john.smith@company.com",
      "role": ["Admin"]
    }'

Response

201 Created

DELETE/accounts/v1/users/:user_id

Remove user from account

This endpoint allows you to remove a user from the given account. This will completely revoke that user's access from the account.

DELETE /accounts/v1/users/:user_id

API KEY SCOPE
accounts:write
curl -X DELETE https://api.waygomaps.com/accounts/v1/users/john.smith@company.com \
    -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
    -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9"

Response

204 No Content

GET/accounts/v1/users/:user_id

Get account roles for user

This endpoint allows you to retrieve all the user-account roles for the user with the given User ID (email).

GET /accounts/v1/users/:user_id

API KEY SCOPE
accounts:read
curl https://api.waygomaps.com/accounts/v1/users/john.smith@company.com \
    -H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
    -H "Waygo-Account: n33f9h0fh9324hf9h439fh9h2f9h93h9"

Response

{
    "user_id": "john.smith@company.com",
    "accounts": [
        {
            "account_id": "n33f9h0fh9324hf9h439fh9h2f9h93h9",
            "account_name": "Newest Account Name",
            "account_type": "enterprise",
            "is_active": true,
            "roles": ["Admin"]
        },
        {
            // ...
        },
        // ...
    ]
}