Replace {subdomain}
in the endpoint below with your Vitally subdomain.
You can find your subdomain in the URL used to log into Vitally (i.e., https://yoursubdomain.vitally.io
Create/update an account
POST
https://{subdomain}.api.vitally.io/analytics/v1/account
This endpoint will create or update an account in Vitally based on the accountId
parameter.
Headers
Name | Type | Description |
Content-Type* | string | Set to |
Authorization* | string | Set to |
Request Body
Name | Type | Description |
accountId* | string | The unique ID of this account in your system |
traits | object | A JSON object containing the traits of this account. All account messages should specify, at minimum, a |
timestamp | string | Required if |
messageId | string | Required if |
organizationId | string | If you have organizations enabled, you may associate the account with an organization by providing organizationId |
200 When your account is created/updated, you'll receive
{"message":"Success."}
Example
An example curl
request describing Vitally would look like:
curl -X POST https://{subdomain}.api.vitally.io/analytics/v1/account \
-H "Authorization: Basic [your token]" \
-H "Content-Type: application/json" \
-d '{
"accountId": "123456",
"traits": {
"name": "Vitally",
"avatar": "http://logo.clearbit.com/vitally.io",
"status": "trialing",
"trialEndDate": "2018-06-01T00:00:00.000Z"
},
"messageId": "7ac1c682-a54b-4d0d-9f56-d6d3618f4915",
"timestamp": "2018-05-15T12:31:12.123Z"
}'
Special traits
Vitally has special logic to handle the following Account traits:
name
: defines the account's name in Vitallyavatar
: defines the account's avatar in Vitally