Analytics API - Organization

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 organization

POST https://{subdomain}.api.vitally.io/analytics/v1/organization

This endpoint will create or update an organization in Vitally based on the organizationId parameter. It is only supported for Vitally accounts that have organizations enabled.

Headers

NameTypeDescription

Content-Type*

string

Set to application/json

Authorization*

string

Set to Basic [YOUR_API_TOKEN]

Request Body

NameTypeDescription

organizationId*

string

The unique ID of this organization in your system

traits

object

A JSON object containing the traits of this organization.

timestamp

string

Required if messageId is not included. An ISO 8601 UTC date string - i.e. '2018-01-01T00:00:00Z' - for the time the message was sent. If timestamp is not included, it will default to the time the API server receives your message.

messageId

string

Required if timestamp is not included A unique ID for this message, used to de-duplicate messages. We recommend sending messageId, but if it is not included and timestamp is included, it will be set to a hash of the message.

{"message":"Success."}

Expand the POST box above for full specs

Example

An example curl request for creating an "IBM" organization would look like:

curl -X POST https://{subdomain}.api.vitally.io/analytics/v1/organization \
  -H "Authorization: Basic [your token]" \
  -H "Content-Type: application/json" \
  -d '{
  "organizationId": "123456",
  "traits": {
    "name": "IBM",
    "avatar": "http://logo.clearbit.com/ibm.com",
    "arr": 100000
  },
  "messageId": "7ac1c682-a54b-4d0d-9f56-d6d3618f4915",
  "timestamp": "2018-05-15T12:31:12.123Z"
}'

Special traits

Vitally has special logic to handle the following Organization traits:

  • name: defines the organization's name in Vitally

  • avatar: defines the organization's avatar in Vitally

Last updated