The Trackable Object
The trackable object is returned in the response of the Retrieve Activity API endpoint. It contains additional information about the underlying Storyblok object that the user changed.
Here is the schema of the trackable object:
For the majority of the trackable objects, such as:
- Approval
- AssetFolder
- Branch
- Collaborator
- ComponentGroup
- DatasourceEntryChild
- DatasourceEntry
- Datasource
- Discussion
- InternalTag
- Preset
- Release
- ScheduledContent
- Setting
- Space
- SpaceRole
- StoryScheduling
- Tags
- Task
- Template
- WorkflowStageChange
- WorkflowStage
- Workflow
A default trackable object is returned:
{ id: "", name: "unknown item", slug: "" };
For “Story,” the trackable object is:
{
id: story.id,
name: story.name,
slug: story.slug,
is_folder: true / false,
};
For “Comment,” the trackable object is:
{
id: "",
name: "unknown item",
slug: "",
story_id: comment.story_id,
story_name: comment.story.name,
};
For “Component,” the trackable object is:
{ id: "", name: "unknown item", slug: "", component_name: component.name };
For “Asset,” the trackable object is:
{ id: "", name: "unknown item", slug: "", asset_name: asset.filename }
For “AiLog” (AiLog tracks usage of AI features):
{
id: "story.id OR idea.id",
name: "story.name OR idea.name",
slug: "story.slug , empty for idea",
type: "Story OR Idea",
action: `string # one of "adjust_tone", "complete", "emojify", "extend", "fix_spelling_and_grammar", "prompt", "rephrase", "shorten", "simplify", "summarize", "tldr", "translate" represents the action name of the OpenAI request`,
usage: {
ai_tokens: "number # the AI tokens consumed",
monthly_ai_tokens: "number # the space monthly tokens",
remaining_ai_tokens: "number, # the space remaining monthly tokens",
text_request: "text # The API text message request",
text_response: "text # The Open AI text message response",
language: "string # language code used for the request"
},
total_ai_tokens: "number, # same value as for usage.ai_tokens (the AI tokens consumed)"
}
This type of activity has two custom ones: one when the user enables the AI text generator feature and the second when the user disables the feature. The trackable object for this scenario is:
{
"id": null,
"name": null,
"slug": null,
"type": null,
"action": "disable or enable",
"usage": {
"ai_tokens": 0,
"monthly_ai_tokens": 250000,
"remaining_ai_tokens": null,
"text_request": null,
"text_response": "AI Text Generator disabled / enabled"
},
"total_ai_tokens": 0
}