Skip to main content

Activity types

An activity type declares one kind of thing your product reports to k-ID, and how it's measured. Your product pushes records against declared types, and k-ID rejects records naming anything else. Declaring a type is a configuration change you make yourself, so adding a new kind of activity doesn't need a k-ID engineer.

For the concept, see Activity. For the API, see Activity ingestion.

Finding the activity tab

Open your product in the product editor and select the Activity tab. The tab holds this product's activity types, and its screentime settings when screentime is available to your organization.

To use Activity, please contact k-ID to have this capability enabled for your organization.

Declaring a type

  1. On the Activity tab, select Add Activity Type. A new entry is displayed, marked Action Required until you save it.

  2. Enter a Label. This is the human-readable name a trusted adult sees in Family Connect, so write it for a parent rather than for your codebase: Time in chat rather than chat_time_v2. Up to 128 characters.

  3. Choose a Metric Type. This fixes the shape of every value your product pushes for the type.

    Dropdown optionThe value your product pushes
    Duration (seconds){ "seconds": 1800 }
    Currency (minor units + ISO){ "amount": 999, "currency": "USD" }
    Count (integer){ "count": 7 }
    Gauge (float){ "number": 0.85 }
    Boolean{ "bool": true }
  4. Optionally add Allowed Attribute Keys. Each key you add here is one your product can attach to records of this type. Keys start with a lowercase letter and contain only lowercase letters, digits, and underscores, up to 64 characters, and up to 32 keys per type.

  5. Select Save.

caution

The metric type is permanent. It can't be changed after the type is created, because records already stored under the type were validated against it. If you need a different shape, create a new type.

Referencing a type from your product

Each activity type has a key, and the key is what your product sends in a record's type field.

k-ID generates the key, a UUID, when you add the type. You don't choose it and you can't edit it. Once the type is saved, a copy control is displayed next to the Label field: use it to copy the key, and paste that value into your integration.

tip

Copy the key from Compliance Studio every time rather than deriving it from the label or retyping it. It's a generated UUID, not a value to reconstruct.

One key is reserved: screentime_usage belongs to k-ID's screentime endpoints, which write usage segments under it. Your product never pushes records under that key.

Editing and deleting

You can change a type's label and its allowed attribute keys after it's created. Both take effect for records pushed after the change reaches the environment.

Removing an allowed attribute key starts rejecting records that carry it, with the reason attribute_key_not_allowed. Remove the key from your integration first, then from the type.

Deleting a type removes the declaration, so records pushed under that key start being rejected with the reason unknown_type. Stop pushing the type before you delete it.

Limits

LimitValue
Activity types per product50
Allowed attribute keys per type32
Label length128 characters
Attribute key length64 characters

Publishing your changes

Activity types follow the same path as the rest of your product configuration. A type you add is local until you push it, and each environment serves the configuration that was pushed to it. Push to test and verify with test API keys, then publish to live. See Testing and publishing.

A record naming a type that hasn't reached the environment your API key serves is rejected with unknown_type, which is the most common reason a new type seems not to work.