---
title: "thread_activity | GraphQL API | Rolebase"
description: "Thread Activity, represents an activity or interaction within a thread. Activities include messages, polls, and references to other entities, forming the conversation content of a thread."
url: "https://rolebase.io/en/developers/graphql-api/thread_activity"
---

[Rolebase](/) ⟩[Developers](/en/developers) ⟩[GraphQL API](/en/developers/graphql-api)

# thread\_activity

Thread Activity, represents an activity or interaction within a thread. Activities include messages, polls, and references to other entities, forming the conversation content of a thread.

## Fields

Field

Type

Description

`id`

`uuid`

Unique identifier for the activity (auto-generated)

`threadId`

`uuid`

Reference to the parent thread

`userId`

`uuid`

Reference to the user who created the activity

`memberId`

`uuid`

Reference to the member who created the activity

`type`

`Thread_Activity_Type_Enum`

Type of activity: Message, Poll, Proposal, ProposalEvent, Thread, Meeting, Task, Decision, or MeetingNote

`data`

`JSON`

Activity content (format depends on type)

`createdAt`

`timestamptz`

When the activity was created (defaults to current timestamp)

`archivedAt`

`timestamptz`

When the activity was archived; null if active

`refThreadId`

`uuid`

Optional reference to another thread

`refMeetingId`

`uuid`

Optional reference to a meeting

`refTaskId`

`uuid`

Optional reference to a task

`refDecisionId`

`uuid`

Optional reference to a decision

## Activity Types

The `type` field accepts the following enum values:

*   **Message** — Text message or rich content
*   **Poll** — Poll for gathering opinions
*   **Proposal** — Governance proposal with prepared org chart changes
*   **ProposalEvent** — Proposal event (resolution, cancellation, vote reminder)
*   **Thread** — Reference to another thread
*   **Meeting** — Reference to a meeting
*   **Task** — Reference to a task
*   **Decision** — Reference to a decision
*   **MeetingNote** — Note created during a meeting

## Relationships

### Object Relationships

*   `thread` — The thread this activity belongs to
*   `user` — The user who created the activity
*   `refThread` — Optional referenced thread
*   `refMeeting` — Optional referenced meeting
*   `refTask` — Optional referenced task
*   `refDecision` — Optional referenced decision

### Array Relationships

*   `reactions` — Reactions to this activity (see [thread\_activity\_reaction](/en/developers/graphql-api/thread_activity_reaction))

## Query Examples

### List Thread Activities

```
query GetThreadActivities($threadId: uuid!) {  thread_activity(    where: { threadId: { _eq: $threadId } }    order_by: { createdAt: asc }  ) {    id    threadId    userId    createdAt    type    data    reactions {      id      shortcode      userId    }    refThread {      id      title    }    refMeeting {      id      title    }    refTask {      id      title    }    refDecision {      id      title    }  }}
```

## Mutation Examples

### Create a Thread Activity

```
mutation CreateThreadActivity {  insert_thread_activity_one(    object: {      threadId: "123e4567-e89b-12d3-a456-426614174000"      userId: "123e4567-e89b-12d3-a456-426614174001"      type: Message      data: { message: "Hello team!" }    }  ) {    id    type    data    createdAt  }}
```

### Update a Thread Activity

```
mutation UpdateThreadActivity {  update_thread_activity_by_pk(    pk_columns: { id: "123e4567-e89b-12d3-a456-426614174002" }    _set: { data: { message: "Updated message" } }  ) {    id    data    createdAt  }}
```

## Permissions

Thread activity access is controlled through Hasura permissions and row-level security:

*   **View** — Users can view activities in threads they have access to
*   **Create** — Users can create new activities in threads they have access to
*   **Update** — Users can update their own activities. MeetingNote activities can also be updated by users with access to the thread
*   **Delete** — Users can delete their own activities. Organization admins and owners can delete any activity

The `data` field structure varies based on the activity type. Activities are ordered chronologically within a thread and support reactions with aggregation. The reference fields allow activities to link to other entities for context.
