archastro.platform.v1.resources.users

   1# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
   2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
   3# Content hash: 98807ba6a0d8
   4
   5from __future__ import annotations
   6
   7import builtins
   8from datetime import datetime
   9from typing import Any, Literal, Required, TypedDict
  10
  11from pydantic import BaseModel, Field
  12
  13from ...runtime.http_client import HttpClient, SyncHttpClient
  14from ...types.threads import Thread
  15from ...types.users import User, UserInvite
  16
  17
  18class UserThreadCreateInputThreadProfilePicture(TypedDict, total=False):
  19    data: str | None
  20    "Base64-encoded image bytes."
  21    filename: str | None
  22    "Original filename of the uploaded image, used for display and content-type inference."
  23    mime_type: str | None
  24    'MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`.'
  25
  26
  27class UserThreadCreateInputThreadSettings(TypedDict, total=False):
  28    agent_enabled: bool | None
  29    "Whether the AI agent is active for this thread. `true` enables AI responses; `false` disables them. Defaults to `true` when settings have not been explicitly configured."
  30
  31
  32class UserThreadCreateInputThread(TypedDict, total=False):
  33    create_legacy_agent: bool | None
  34    "When `true`, provisions a legacy chat agent alongside the thread. Only needed for integrations that depend on the pre-v2 agent model."
  35    description: str | None
  36    "Optional longer description of the thread's purpose. `null` if not provided."
  37    is_unlisted: bool | None
  38    "When `true`, the thread is hidden from the default thread list and accessible only by direct link or ID."
  39    key: str | None
  40    "Client-assigned unique key for idempotent creation or later lookup. Must be unique within the owning organization."
  41    metadata: dict[str, Any] | None
  42    "Arbitrary key-value pairs stored alongside the thread. Values must be strings or numbers."
  43    muted: bool | None
  44    "When `true`, push and in-app notifications for this thread are suppressed for the creating user."
  45    org_id: str | None
  46    "ID of the organization to create the thread under. Defaults to the authenticated user's primary organization when omitted."
  47    profile_picture: UserThreadCreateInputThreadProfilePicture | None
  48    "Optional profile image for the thread, provided as a base64-encoded payload."
  49    settings: UserThreadCreateInputThreadSettings | None
  50    "Configuration overrides for the thread, such as AI model selection and context window settings."
  51    title: str | None
  52    "Display name for the thread. `null` if omitted, which causes the thread to be untitled."
  53
  54
  55class UserThreadCreateInput(TypedDict, total=False):
  56    "Create a thread for a user"
  57
  58    skip_welcome_message: bool | None
  59    "When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`."
  60    thread: Required[UserThreadCreateInputThread]
  61    "Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields."
  62
  63
  64class UserInvitesInputInvite(TypedDict, total=False):
  65    metadata: dict[str, Any] | None
  66    "Arbitrary key-value metadata to attach to the invite. Returned as-is on the resulting invite object."
  67    persona_id: str | None
  68    "ID of the persona to associate with this invite (`per_...`). `null` if the invite is not bound to a persona."
  69    thread_id: str | None
  70    "ID of the thread to associate with this invite (`thr_...`). `null` if the invite is not bound to a thread."
  71
  72
  73class UserInvitesInput(TypedDict):
  74    "Create a user invite"
  75
  76    invite: UserInvitesInputInvite
  77    "Parameters for the new invite. See the UserInviteCreateParams schema for field details."
  78
  79
  80class UserProfileInputProfilePicture(TypedDict, total=False):
  81    data: str | None
  82    "Base64-encoded binary content of the image file."
  83    filename: str | None
  84    "Original filename of the image, used for storage metadata."
  85    mime_type: str | None
  86    'MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`.'
  87
  88
  89class UserProfileInput(TypedDict, total=False):
  90    "Update the current user's profile"
  91
  92    alias: str | None
  93    "Short display alias shown in place of the full name in compact UI contexts."
  94    full_name: str | None
  95    "Updated display name for the user."
  96    metadata: dict[str, Any] | None
  97    "Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it."
  98    profile_picture: UserProfileInputProfilePicture | None
  99    "New profile picture to upload as a base64-encoded image. Replaces any existing picture."
 100
 101
 102class UserThreadListResponseDataItemCreator(BaseModel):
 103    alias: str | None = Field(
 104        default=None, description="Short handle or alias for the user. `null` if not set."
 105    )
 106    app: str | None = Field(
 107        default=None,
 108        description="ID of the app this user (and their access token) is scoped to (`dap_...`). `null` if the user is not scoped to an app.",
 109    )
 110    app_name: str | None = Field(
 111        default=None,
 112        description="Display name of the user's app. `null` when the app association was not preloaded by the caller.",
 113    )
 114    email: str | None = Field(default=None, description="Email address of the user.")
 115    id: str = Field(..., description="User ID (`usr_...`).")
 116    is_system_user: bool | None = Field(
 117        default=None,
 118        description="`true` if this account is an internal system user rather than a human. System users are created automatically by the platform.",
 119    )
 120    metadata: dict[str, Any] | None = Field(
 121        default=None,
 122        description="Arbitrary key-value metadata attached to the user. Defaults to an empty object.",
 123    )
 124    name: str | None = Field(
 125        default=None,
 126        description="Full display name of the user. `null` if the user has not set a name.",
 127    )
 128    org: str | None = Field(
 129        default=None,
 130        description="ID of the organization this user belongs to (`org_...`). `null` if the user is not a member of any organization.",
 131    )
 132    org_name: str | None = Field(
 133        default=None,
 134        description="Display name of the user's organization. `null` when the user is not in an org, or when the org association was not preloaded by the caller.",
 135    )
 136    org_role: str | None = Field(
 137        default=None,
 138        description='Role of the user within their organization. One of `"admin"`, `"member"`, or `"viewer"`. `null` when the user is not a member of any organization.',
 139    )
 140    sandbox: str | None = Field(
 141        default=None,
 142        description="ID of the sandbox environment this user is scoped to (`sbx_...`). `null` for production users.",
 143    )
 144    sandbox_name: str | None = Field(
 145        default=None,
 146        description="Display name of the user's sandbox environment. `null` for production users, or when the sandbox association was not preloaded by the caller.",
 147    )
 148
 149
 150class UserThreadListResponseDataItemParentMessageActorsItemProfilePicture(BaseModel):
 151    file: str | None = Field(
 152        default=None,
 153        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
 154    )
 155    height: int | None = Field(
 156        default=None, description="Height of the image in pixels. `null` if not known."
 157    )
 158    media: str | None = Field(
 159        default=None,
 160        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
 161    )
 162    mime_type: str | None = Field(
 163        default=None,
 164        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
 165    )
 166    refresh_url: str | None = Field(
 167        default=None,
 168        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
 169    )
 170    url: str | None = Field(
 171        default=None,
 172        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
 173    )
 174    width: int | None = Field(
 175        default=None, description="Width of the image in pixels. `null` if not known."
 176    )
 177
 178
 179class UserThreadListResponseDataItemParentMessageActorsItem(BaseModel):
 180    alias: str | None = Field(
 181        default=None,
 182        description="Short handle or alias for the actor, used as an alternate display identifier. `null` if not configured.",
 183    )
 184    id: str | None = Field(
 185        default=None,
 186        description='Composite actor identifier. Format is `"user-<usr_...>"` for human users or `"agent-<agi_...>"` for agents.',
 187    )
 188    name: str | None = Field(
 189        default=None,
 190        description="Display name of the actor shown in the UI. `null` if no name is set.",
 191    )
 192    profile_picture: UserThreadListResponseDataItemParentMessageActorsItemProfilePicture | None = (
 193        Field(
 194            default=None,
 195            description="Profile picture for the actor. `null` if the actor has no profile picture.",
 196        )
 197    )
 198
 199
 200class UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource(BaseModel):
 201    file: str | None = Field(
 202        default=None,
 203        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
 204    )
 205    height: int | None = Field(
 206        default=None, description="Height of the image in pixels. `null` if not known."
 207    )
 208    media: str | None = Field(
 209        default=None,
 210        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
 211    )
 212    mime_type: str | None = Field(
 213        default=None,
 214        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
 215    )
 216    refresh_url: str | None = Field(
 217        default=None,
 218        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
 219    )
 220    url: str | None = Field(
 221        default=None,
 222        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
 223    )
 224    width: int | None = Field(
 225        default=None, description="Width of the image in pixels. `null` if not known."
 226    )
 227
 228
 229class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource(BaseModel):
 230    file: str | None = Field(
 231        default=None,
 232        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
 233    )
 234    height: int | None = Field(
 235        default=None, description="Height of the image in pixels. `null` if not known."
 236    )
 237    media: str | None = Field(
 238        default=None,
 239        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
 240    )
 241    mime_type: str | None = Field(
 242        default=None,
 243        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
 244    )
 245    refresh_url: str | None = Field(
 246        default=None,
 247        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
 248    )
 249    url: str | None = Field(
 250        default=None,
 251        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
 252    )
 253    width: int | None = Field(
 254        default=None, description="Width of the image in pixels. `null` if not known."
 255    )
 256
 257
 258class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem(BaseModel):
 259    content_type: str | None = Field(
 260        default=None,
 261        description='MIME type of this variant\'s file (e.g., `"image/jpeg"`, `"video/mp4"`). `null` if the file is not loaded.',
 262    )
 263    created_at: datetime | None = Field(
 264        default=None, description="When this variant was created (ISO 8601)."
 265    )
 266    file: str | None = Field(
 267        default=None,
 268        description="ID of the underlying storage file that backs this variant (`fil_...`).",
 269    )
 270    filename: str | None = Field(
 271        default=None,
 272        description="Original filename of the uploaded file for this variant. `null` if the file is not loaded.",
 273    )
 274    height: int | None = Field(
 275        default=None, description="Height of this variant in pixels. `null` if not recorded."
 276    )
 277    id: str = Field(..., description="Media variant ID (`mvr_...`).")
 278    image_source: (
 279        UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource | None
 280    ) = Field(
 281        default=None,
 282        description="Resolved image delivery metadata for this variant, including dimensions and CDN URL. `null` for non-image content types.",
 283    )
 284    updated_at: datetime | None = Field(
 285        default=None, description="When this variant was last updated (ISO 8601)."
 286    )
 287    url: str | None = Field(
 288        default=None,
 289        description="Signed download URL for this variant, resolved at request time. `null` if the file is unavailable.",
 290    )
 291    variant_key: str | None = Field(
 292        default=None,
 293        description='Identifier for this variant\'s processing tier. Common values include `"original"` (the unmodified upload) and `"thumbnail"` (a resized preview).',
 294    )
 295    width: int | None = Field(
 296        default=None, description="Width of this variant in pixels. `null` if not recorded."
 297    )
 298
 299
 300class UserThreadListResponseDataItemParentMessageAttachmentsItem(BaseModel):
 301    content_type: str | None = Field(
 302        default=None,
 303        description='MIME type of the attached file, e.g. `"image/png"` or `"application/pdf"`. Present on `file`, `artifact`, and `media` types. `null` otherwise.',
 304    )
 305    description: str | None = Field(
 306        default=None,
 307        description="Short description. The page meta-description for `scraped_link`, the artifact description for `artifact`, and the task description for `task` types. `null` on other types.",
 308    )
 309    filename: str | None = Field(
 310        default=None,
 311        description='Original filename of the attached file, e.g. `"report.pdf"`. Present on `file`, `artifact`, and `media` types. `null` otherwise.',
 312    )
 313    height: int | None = Field(
 314        default=None,
 315        description="Height in pixels of the media item. Present on `media` type only. `null` otherwise.",
 316    )
 317    id: str = Field(..., description="Unique identifier for this attachment within the message.")
 318    image_height: int | None = Field(
 319        default=None,
 320        description="Height in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise.",
 321    )
 322    image_source: UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource | None = (
 323        Field(
 324            default=None,
 325            description="Image source metadata for inline rendering. Present on `file`, `scraped_link`, `artifact`, and `media` types when the content is an image. `null` otherwise.",
 326        )
 327    )
 328    image_url: str | None = Field(
 329        default=None,
 330        description="URL of the preview image extracted from the scraped page. Present on `scraped_link` type only. `null` otherwise.",
 331    )
 332    image_width: int | None = Field(
 333        default=None,
 334        description="Width in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise.",
 335    )
 336    media_type: str | None = Field(
 337        default=None,
 338        description='The media category, e.g. `"video"` or `"audio"`. Present on `media` type only. `null` otherwise.',
 339    )
 340    name: str | None = Field(
 341        default=None,
 342        description="Display name of the media item. Present on `media` type only. `null` otherwise.",
 343    )
 344    object: dict[str, Any] | None = Field(
 345        default=None,
 346        description="The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. `null` on other types.",
 347    )
 348    title: str | None = Field(
 349        default=None,
 350        description="Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types.",
 351    )
 352    type: str = Field(
 353        ...,
 354        description='The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, or `"action"`. Determines which additional fields are present.',
 355    )
 356    url: str | None = Field(
 357        default=None,
 358        description="URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types.",
 359    )
 360    variants: (
 361        list[UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem] | None
 362    ) = Field(
 363        default=None,
 364        description="Array of available encoding variants for the media item (e.g. different resolutions). Present on `media` type only. `null` otherwise.",
 365    )
 366    version: int | None = Field(
 367        default=None,
 368        description="Version number of the attached artifact at the time of attachment. Present on `artifact` type only. `null` otherwise.",
 369    )
 370    width: int | None = Field(
 371        default=None,
 372        description="Width in pixels of the media item. Present on `media` type only. `null` otherwise.",
 373    )
 374
 375
 376class UserThreadListResponseDataItemParentMessageReactionsItem(BaseModel):
 377    payload: dict[str, Any] | None = Field(
 378        default=None,
 379        description='Type-specific reaction data. For `"emoji_reaction"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `" "`).',
 380    )
 381    type: str = Field(
 382        ...,
 383        description='Reaction type identifier. Currently always `"emoji_reaction"` for emoji-based reactions.',
 384    )
 385    user: str | None = Field(
 386        default=None, description="Public ID of the user who added the reaction (`usr_...`)."
 387    )
 388
 389
 390class UserThreadListResponseDataItemParentMessage(BaseModel):
 391    actors: list[UserThreadListResponseDataItemParentMessageActorsItem] | None = Field(
 392        default=None,
 393        description="Resolved actor descriptors for the message sender, combining identity and display metadata. Always contains exactly one entry.",
 394    )
 395    agent: str | None = Field(
 396        default=None,
 397        description="ID of the agent user that sent this message (`agi_...`). `null` for messages sent by human users.",
 398    )
 399    agent_mode: Literal["cli", "embedded"] | None = Field(
 400        default=None,
 401        description="Local agent execution mode for this message. One of `cli`, `embedded`, or `null` when the message was not created by a local agent execution path.",
 402    )
 403    attachments: list[UserThreadListResponseDataItemParentMessageAttachmentsItem] | None = Field(
 404        default=None,
 405        description="Files, links, tasks, media, artifacts, and actions attached to this message. Empty array if there are no attachments.",
 406    )
 407    branched_thread: str | None = Field(
 408        default=None,
 409        description="ID of the thread that was branched from this message (`thr_...`). `null` if this message has not spawned a branch thread.",
 410    )
 411    content: str | None = Field(
 412        default=None,
 413        description="Text content of the message. `null` for messages that contain only attachments.",
 414    )
 415    created_at: datetime | None = Field(
 416        default=None, description="When the message was posted (ISO 8601)."
 417    )
 418    has_replies: bool | None = Field(
 419        default=None,
 420        description="Whether this message has at least one reply. Only present when explicitly requested or computed by the server.",
 421    )
 422    id: str = Field(..., description="Message ID (`msg_...`).")
 423    idempotency_key: str | None = Field(
 424        default=None,
 425        description="Client-supplied idempotency key used to deduplicate message sends. `null` if the sender did not provide one.",
 426    )
 427    legacy_agent: str | None = Field(
 428        default=None,
 429        description="Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users.",
 430    )
 431    metadata: dict[str, Any] | None = Field(
 432        default=None,
 433        description="Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set.",
 434    )
 435    org: str | None = Field(
 436        default=None, description="ID of the organization that owns this message (`org_...`)."
 437    )
 438    reactions: list[UserThreadListResponseDataItemParentMessageReactionsItem] | None = Field(
 439        default=None,
 440        description="Emoji and other reactions added to this message by users. Empty array if no reactions have been added or the association is not preloaded.",
 441    )
 442    rendering_mode: str | None = Field(
 443        default=None,
 444        description='Display hint for how the message should be rendered. One of `"reply"`, `"direct"`, or `"inline"`. `null` for user-authored messages, which are always rendered as standard replies.',
 445    )
 446    replies: list[dict[str, Any]] | None = Field(
 447        default=None,
 448        description="Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message.",
 449    )
 450    replies_after_cursor: str | None = Field(
 451        default=None,
 452        description="Opaque pagination cursor to fetch replies posted after the current page. Only present when inline replies are included in the response.",
 453    )
 454    replies_before_cursor: str | None = Field(
 455        default=None,
 456        description="Opaque pagination cursor to fetch replies posted before the current page. Only present when inline replies are included in the response.",
 457    )
 458    reply_count: int | None = Field(
 459        default=None,
 460        description="Total number of direct replies to this message. Only present when explicitly requested or computed by the server.",
 461    )
 462    reply_to: dict[str, Any] | None = Field(
 463        default=None,
 464        description="The parent message this message is a reply to, expanded as a full message object when loaded. `null` if this is a top-level message or the association is not preloaded.",
 465    )
 466    sandbox: str | None = Field(
 467        default=None,
 468        description="ID of the developer sandbox this message belongs to (`dsb_...`). `null` for non-sandbox messages.",
 469    )
 470    team: str | None = Field(
 471        default=None,
 472        description="ID of the team this message is scoped to (`tem_...`). `null` if the message is not team-scoped.",
 473    )
 474    thread: str | None = Field(
 475        default=None,
 476        description="ID of the thread this message belongs to (`thr_...`). `null` for messages not yet associated with a thread.",
 477    )
 478    user: str | None = Field(
 479        default=None,
 480        description="The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents.",
 481    )
 482
 483
 484class UserThreadListResponseDataItemParticipantsItem(BaseModel):
 485    alias: str | None = Field(
 486        default=None, description="Short handle or alias for the user. `null` if not set."
 487    )
 488    app: str | None = Field(
 489        default=None,
 490        description="ID of the app this user (and their access token) is scoped to (`dap_...`). `null` if the user is not scoped to an app.",
 491    )
 492    app_name: str | None = Field(
 493        default=None,
 494        description="Display name of the user's app. `null` when the app association was not preloaded by the caller.",
 495    )
 496    email: str | None = Field(default=None, description="Email address of the user.")
 497    id: str = Field(..., description="User ID (`usr_...`).")
 498    is_system_user: bool | None = Field(
 499        default=None,
 500        description="`true` if this account is an internal system user rather than a human. System users are created automatically by the platform.",
 501    )
 502    metadata: dict[str, Any] | None = Field(
 503        default=None,
 504        description="Arbitrary key-value metadata attached to the user. Defaults to an empty object.",
 505    )
 506    name: str | None = Field(
 507        default=None,
 508        description="Full display name of the user. `null` if the user has not set a name.",
 509    )
 510    org: str | None = Field(
 511        default=None,
 512        description="ID of the organization this user belongs to (`org_...`). `null` if the user is not a member of any organization.",
 513    )
 514    org_name: str | None = Field(
 515        default=None,
 516        description="Display name of the user's organization. `null` when the user is not in an org, or when the org association was not preloaded by the caller.",
 517    )
 518    org_role: str | None = Field(
 519        default=None,
 520        description='Role of the user within their organization. One of `"admin"`, `"member"`, or `"viewer"`. `null` when the user is not a member of any organization.',
 521    )
 522    sandbox: str | None = Field(
 523        default=None,
 524        description="ID of the sandbox environment this user is scoped to (`sbx_...`). `null` for production users.",
 525    )
 526    sandbox_name: str | None = Field(
 527        default=None,
 528        description="Display name of the user's sandbox environment. `null` for production users, or when the sandbox association was not preloaded by the caller.",
 529    )
 530
 531
 532class UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem(BaseModel):
 533    actions: list[str] = Field(
 534        ...,
 535        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
 536    )
 537    principal: str | None = Field(
 538        default=None,
 539        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
 540    )
 541    principal_type: str = Field(
 542        ...,
 543        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
 544    )
 545
 546
 547class UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem(BaseModel):
 548    actions: list[str] = Field(
 549        ...,
 550        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
 551    )
 552    principal: str | None = Field(
 553        default=None,
 554        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
 555    )
 556    principal_type: str = Field(
 557        ...,
 558        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
 559    )
 560
 561
 562class UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem(BaseModel):
 563    principal: str | None = Field(
 564        default=None,
 565        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
 566    )
 567    principal_type: str = Field(
 568        ...,
 569        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
 570    )
 571
 572
 573class UserThreadListResponseDataItemParticipatingAgentsItemAcl(BaseModel):
 574    add: list[UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem] | None = Field(
 575        default=None,
 576        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
 577    )
 578    grants: list[UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem] | None = Field(
 579        default=None,
 580        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
 581    )
 582    remove: list[UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem] | None = Field(
 583        default=None,
 584        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
 585    )
 586
 587
 588class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionOrgLogo(BaseModel):
 589    file: str | None = Field(
 590        default=None,
 591        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
 592    )
 593    height: int | None = Field(
 594        default=None, description="Height of the image in pixels. `null` if not known."
 595    )
 596    media: str | None = Field(
 597        default=None,
 598        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
 599    )
 600    mime_type: str | None = Field(
 601        default=None,
 602        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
 603    )
 604    refresh_url: str | None = Field(
 605        default=None,
 606        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
 607    )
 608    url: str | None = Field(
 609        default=None,
 610        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
 611    )
 612    width: int | None = Field(
 613        default=None, description="Width of the image in pixels. `null` if not known."
 614    )
 615
 616
 617class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionTemplatesItem(
 618    BaseModel
 619):
 620    description: str | None = Field(
 621        default=None,
 622        description="Short prose blurb from the template body's `description:` field. `null` when the body doesn't set one. Used as the card subhead in the Library carousel.",
 623    )
 624    display_name: str | None = Field(
 625        default=None,
 626        description="Human-facing label from the template body's `display_name:` field. `null` when the body doesn't set one. Library carousels use this for the card title, falling back to a humanized `name`.",
 627    )
 628    id: str | None = Field(
 629        default=None,
 630        description="Template config ID (`cfg_...`). `null` for inline-only templates.",
 631    )
 632    kind: str = Field(
 633        ...,
 634        description="Template config kind, or `SolutionTemplateRef` / `SolutionTemplatePath` when unresolved.",
 635    )
 636    lookup_key: str | None = Field(
 637        default=None,
 638        description="Lookup key stamped on the template config at import time. `null` when no lookup key was assigned.",
 639    )
 640    name: str | None = Field(
 641        default=None,
 642        description="Canonical name from the template body. For `AgentTemplate` this doubles as the human-facing label; for `AgentToolTemplate` it's the LLM-facing tool function identifier (snake_case); for `AgentRoutineTemplate` it's the routine identifier (kebab-case). Clients rendering carousels should prefer `display_name` and fall back to humanizing `name`.",
 643    )
 644    readme_url: str | None = Field(
 645        default=None,
 646        description="Relative path to the public README endpoint with a signed token already embedded, scoped to this template's bundled markdown asset. `null` when the Solution body's `templates[].readme_path` is unset for this entry. Token expires in 1 hour refresh via `GET /api/v1/solutions/:solution`.",
 647    )
 648    virtual_path: str | None = Field(
 649        default=None,
 650        description="Stable virtual path assigned to the template config. `null` when no virtual path was set.",
 651    )
 652
 653
 654class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolution(BaseModel):
 655    category_keys: list[str] | None = Field(
 656        default=None,
 657        description="Category tag keys declared in the Solution body, used to group Solutions in the catalog. An empty array when the body declares none.",
 658    )
 659    created_at: datetime | None = Field(
 660        default=None, description="When the Solution config was first imported (ISO 8601)."
 661    )
 662    description: str | None = Field(
 663        default=None,
 664        description="Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one.",
 665    )
 666    id: str = Field(..., description="Solution config ID (`cfg_...`).")
 667    kind: str = Field(..., description='Resource type. Always `"Solution"`.')
 668    latest_solution: str | None = Field(
 669        default=None,
 670        description="When `upgrade_available` is `true`, the system-scope Solution config ID (`cfg_...`) that should be used as the upgrade source. `null` otherwise.",
 671    )
 672    latest_version: str | None = Field(
 673        default=None,
 674        description="When `upgrade_available` is `true`, the higher system-scope `solution_version` available to upgrade to. `null` otherwise.",
 675    )
 676    lookup_key: str | None = Field(
 677        default=None,
 678        description="The lookup key stored on the Solution config, if one was assigned during import. `null` when no lookup key was set.",
 679    )
 680    metadata: dict[str, Any] | None = Field(
 681        default=None,
 682        description="Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none.",
 683    )
 684    name: str | None = Field(
 685        default=None,
 686        description="Human-facing display name declared in the Solution body. `null` when the Solution body does not set one.",
 687    )
 688    org: str | None = Field(
 689        default=None,
 690        description="Organization ID (`org_...`) that owns this Solution config, when the Solution is scoped to a specific org. `null` for system-scope (app-level) Solutions.",
 691    )
 692    org_logo: (
 693        UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionOrgLogo | None
 694    ) = Field(
 695        default=None,
 696        description="Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. Carries the signed `url` plus a `refresh_url`. `null` when `org_slug` is `null` or the org has no logo.",
 697    )
 698    org_name: str | None = Field(
 699        default=None,
 700        description="Display name of the resolved `org`. Pairs with `org_slug` as the principal catalog category's label. `null` when `org_slug` is `null`.",
 701    )
 702    org_slug: str | None = Field(
 703        default=None,
 704        description="Resolved slug of the Solution body's `org` (the publishing organization), when set and it resolves to a real org visible to the viewer. When present this is the Solution's principal catalog category key clients group the Solution under this org ahead of `category_keys`. `null` when the body has no `org` or it doesn't resolve.",
 705    )
 706    owners: list[str] = Field(
 707        ...,
 708        description='Owner scopes this Solution appears under. Members: `"system"` (app-level system scope) and/or `"org"` (viewer\'s org scope).',
 709    )
 710    readme_url: str | None = Field(
 711        default=None,
 712        description="Relative path to the public README endpoint with a signed token already embedded. `null` when the Solution has no README. Token expires in 1 hour refresh via `GET /api/v1/solutions/:solution`.",
 713    )
 714    solution_id: str | None = Field(
 715        default=None,
 716        description="Stable UUID declared in the Solution body, used to identify the same logical Solution across multiple installed copies and owner scopes. `null` when the body omits it.",
 717    )
 718    solution_version: str | None = Field(
 719        default=None,
 720        description='Semver string declared in the Solution body (e.g. `"1.2.0"`). `null` when the body does not declare a version.',
 721    )
 722    tag_keys: list[str] | None = Field(
 723        default=None,
 724        description="Freeform tag keys declared in the Solution body. An empty array when the body declares none.",
 725    )
 726    template_kind: str | None = Field(
 727        default=None,
 728        description='Wrapped template kind `"AgentTemplate"`, `"AutomationTemplate"`, `"AgentRoutineTemplate"`, `"AgentToolTemplate"`, `"AgentComputerTemplate"`, or `"SolutionTemplateRef"` for ref-mode bundles.',
 729    )
 730    templates: list[
 731        UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionTemplatesItem
 732    ] = Field(
 733        ...,
 734        description="Template configs bundled by this Solution, in declaration order the first entry is the deployable template the Solution wraps; the rest are sibling templates the wrapped template references.",
 735    )
 736    updated_at: datetime | None = Field(
 737        default=None, description="When the Solution config was last modified (ISO 8601)."
 738    )
 739    upgrade_available: bool = Field(
 740        ...,
 741        description="`true` when this Solution is installed at the viewer's org scope and the app-level system scope carries a higher `solution_version`. Always `false` for system-only rows.",
 742    )
 743    virtual_path: str | None = Field(
 744        default=None,
 745        description="The stable virtual path assigned to this Solution config, used as the deduplication key when the same Solution appears under multiple owner scopes. `null` when unset.",
 746    )
 747
 748
 749class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionTemplate(BaseModel):
 750    created_at: datetime | None = Field(
 751        default=None, description="When this template config was created (ISO 8601)."
 752    )
 753    description: str | None = Field(
 754        default=None,
 755        description="Description of the template from the config body. `null` if the current version has no `description` field.",
 756    )
 757    display_name: str | None = Field(
 758        default=None,
 759        description="Human-readable display name from the config body. `null` if the current version has no `display_name` field.",
 760    )
 761    id: str = Field(..., description="Template config ID (`cfg_...`).")
 762    kind: str = Field(
 763        ..., description='Config kind identifier for this template (e.g. `"agent_tool_template"`).'
 764    )
 765    lookup_key: str | None = Field(
 766        default=None,
 767        description="Stable lookup key assigned to this template config. `null` if no lookup key is set.",
 768    )
 769    name: str | None = Field(
 770        default=None,
 771        description="Template name as stored in the config body. `null` if the current version has no `name` field.",
 772    )
 773    updated_at: datetime | None = Field(
 774        default=None, description="When this template config was last modified (ISO 8601)."
 775    )
 776    virtual_path: str | None = Field(
 777        default=None,
 778        description="Virtual filesystem path for this template config. `null` if not set.",
 779    )
 780
 781
 782class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolution(BaseModel):
 783    solution: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolution = Field(
 784        ...,
 785        description="Summary of the parent Solution, including `upgrade_available`, `latest_version`, and `latest_solution` when a newer system-scoped version is available for the agent's org-scoped Solution.",
 786    )
 787    template: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionTemplate = Field(
 788        ...,
 789        description="Summary of the AgentTemplate config (`cfg_...`) the agent was last provisioned or updated from.",
 790    )
 791
 792
 793class UserThreadListResponseDataItemParticipatingAgentsItem(BaseModel):
 794    acl: UserThreadListResponseDataItemParticipatingAgentsItemAcl | None = Field(
 795        default=None,
 796        description="Access control list for the agent. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions`. `null` when no ACL restrictions are applied and the agent is accessible to all members of its scope.",
 797    )
 798    app: str | None = Field(
 799        default=None, description="ID of the application that owns this agent (`dap_...`)."
 800    )
 801    created_at: datetime | None = Field(
 802        default=None, description="When the agent was created (ISO 8601)."
 803    )
 804    default_model: str | None = Field(
 805        default=None,
 806        description='Default LLM model identifier used by this agent when no model is specified at runtime (e.g. `"claude-3-7-sonnet-latest"`).',
 807    )
 808    email: str | None = Field(
 809        default=None,
 810        description="Email address provisioned for this agent. `null` if email delivery is not configured.",
 811    )
 812    id: str = Field(..., description="Agent ID (`agi_...`).")
 813    identity: str | None = Field(
 814        default=None,
 815        description="System-level identity prompt that shapes the agent's persona and behavior.",
 816    )
 817    last_applied_template_config: str | None = Field(
 818        default=None,
 819        description="ID of the AgentTemplate config (`cfg_...`) this agent was last provisioned or updated from. `null` for manually created agents.",
 820    )
 821    lookup_key: str | None = Field(
 822        default=None,
 823        description="Stable, user-defined identifier for this agent within the application. Unique per app.",
 824    )
 825    metadata: dict[str, Any] | None = Field(
 826        default=None,
 827        description="Arbitrary key-value metadata attached to the agent. Not interpreted by the platform.",
 828    )
 829    name: str | None = Field(
 830        default=None, description="Human-readable display name for the agent. `null` if not set."
 831    )
 832    org: str | None = Field(
 833        default=None,
 834        description="ID of the organization this agent belongs to (`org_...`). `null` if the agent is not org-scoped.",
 835    )
 836    org_name: str | None = Field(
 837        default=None,
 838        description="Display name of the organization this agent belongs to. `null` when the agent is not org-scoped or when the org association was not preloaded.",
 839    )
 840    originator: str | None = Field(
 841        default=None,
 842        description="Free-form label identifying the source or author that created this agent (e.g. a username or pipeline name).",
 843    )
 844    phone_number: str | None = Field(
 845        default=None,
 846        description="Phone number provisioned for this agent. `null` if SMS is not configured.",
 847    )
 848    sandbox: str | None = Field(
 849        default=None,
 850        description="ID of the sandbox environment this agent is scoped to (`dsb_...`). `null` in production deployments.",
 851    )
 852    source_solution: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolution | None = (
 853        Field(
 854            default=None,
 855            description="Source Solution and AgentTemplate summary for agents provisioned from a Solution. Includes `upgrade_available`, `latest_version`, and `latest_solution` so you can render an upgrade badge without a separate dry-run call. `null` for hand-built agents and agents whose tracked template or parent Solution has been deleted. Populated only on single-agent GET responses, never on list endpoints.",
 856        )
 857    )
 858    team: str | None = Field(
 859        default=None,
 860        description="ID of the team that owns this agent (`tem_...`). `null` if the agent is not team-scoped.",
 861    )
 862    template_upgrade_available: bool | None = Field(
 863        default=None,
 864        description="True when the agent's last-applied template version is behind the current version of its AgentTemplate config i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed only on list endpoints; `null` on single-agent GET.",
 865    )
 866    updated_at: datetime | None = Field(
 867        default=None, description="When the agent was last modified (ISO 8601)."
 868    )
 869    user: str | None = Field(
 870        default=None,
 871        description="ID of the user that owns this agent (`usr_...`). `null` if the agent is not user-scoped.",
 872    )
 873
 874
 875class UserThreadListResponseDataItemSettings(BaseModel):
 876    agent_enabled: bool | None = Field(
 877        default=None,
 878        description="Whether the AI agent is active for this thread. `true` enables AI responses; `false` disables them. Defaults to `true` when settings have not been explicitly configured.",
 879    )
 880
 881
 882class UserThreadListResponseDataItem(BaseModel):
 883    agent_user: str | None = Field(
 884        default=None,
 885        description="ID of the agent that owns this thread (`agt_...`). `null` for user-owned or team-owned threads.",
 886    )
 887    created_at: datetime | None = Field(
 888        default=None, description="When the thread was created (ISO 8601)."
 889    )
 890    creator: UserThreadListResponseDataItemCreator | None = Field(
 891        default=None,
 892        description="Expanded user object for the user who created this thread. Populated only when the association is loaded.",
 893    )
 894    description: str | None = Field(
 895        default=None,
 896        description="Optional description or purpose statement for the thread. `null` if not set.",
 897    )
 898    id: str = Field(..., description="Thread ID (`thr_...`).")
 899    is_channel: bool | None = Field(
 900        default=None,
 901        description="Whether this thread operates as a channel a multi-member broadcast-style conversation.",
 902    )
 903    is_default: bool | None = Field(
 904        default=None,
 905        description="Whether this is the default thread for its owner. Each user or team has at most one default thread.",
 906    )
 907    is_transient: bool | None = Field(
 908        default=None,
 909        description="Whether this thread is ephemeral and may be deleted automatically after a period of inactivity or when its TTL expires.",
 910    )
 911    is_unlisted: bool | None = Field(
 912        default=None,
 913        description="Whether this thread is hidden from public discovery. Unlisted threads are accessible only to direct participants.",
 914    )
 915    key: str | None = Field(
 916        default=None,
 917        description="Application-defined stable key that uniquely identifies the thread within its scope. Useful for idempotent creation. `null` if not set.",
 918    )
 919    last_activity: datetime | None = Field(
 920        default=None,
 921        description="When the last message or activity occurred in this thread. Present only when activity enrichment is requested.",
 922    )
 923    metadata: dict[str, Any] | None = Field(
 924        default=None,
 925        description="Arbitrary key-value metadata attached to the thread. Shape is application-defined; `null` if no metadata has been set.",
 926    )
 927    muted: bool | None = Field(
 928        default=None,
 929        description="Whether the authenticated user has muted notifications for this thread. `true` suppresses all notification delivery.",
 930    )
 931    org: str | None = Field(
 932        default=None,
 933        description="ID of the organization this thread belongs to (`org_...`). `null` for threads outside an org context.",
 934    )
 935    parent_message: UserThreadListResponseDataItemParentMessage | None = Field(
 936        default=None,
 937        description="The message that spawned this thread as a sub-thread. `null` for top-level threads.",
 938    )
 939    participant: list[str] | None = Field(
 940        default=None,
 941        description="Array of participant user IDs (`usr_...`) who are members of this thread.",
 942    )
 943    participants: list[UserThreadListResponseDataItemParticipantsItem] | None = Field(
 944        default=None,
 945        description="Expanded participant user objects for each member of this thread. Populated only when the association is loaded.",
 946    )
 947    participating_actor: list[str] | None = Field(
 948        default=None,
 949        description="Composite actor identifiers for all participants currently active in this thread. Present only when actor enrichment is requested.",
 950    )
 951    participating_agents: list[UserThreadListResponseDataItemParticipatingAgentsItem] | None = (
 952        Field(
 953            default=None,
 954            description="Expanded agent objects for all agents participating in this thread. Present only when agent enrichment is requested.",
 955        )
 956    )
 957    role: str | None = Field(
 958        default=None,
 959        description='The authenticated user\'s membership role in this thread, e.g. `"owner"`, `"member"`, or `"viewer"`. `null` if the user is not a member.',
 960    )
 961    sandbox: str | None = Field(
 962        default=None,
 963        description="ID of the developer sandbox this thread is scoped to (`sbx_...`). `null` for production threads.",
 964    )
 965    settings: UserThreadListResponseDataItemSettings | None = Field(
 966        default=None,
 967        description="Per-thread configuration settings controlling AI agent behavior for this thread.",
 968    )
 969    slug: str | None = Field(
 970        default=None,
 971        description="URL-safe slug for the thread, used in human-readable permalinks. `null` if not assigned.",
 972    )
 973    sub_threads: list[dict[str, Any]] | None = Field(
 974        default=None,
 975        description="Threads that are nested under this thread as replies to a parent message. Present only when sub-thread enrichment is requested.",
 976    )
 977    team: str | None = Field(
 978        default=None,
 979        description="ID of the team that owns this thread (`team_...`). `null` for user-owned or agent-owned threads.",
 980    )
 981    title: str | None = Field(
 982        default=None,
 983        description="Human-readable name of the thread. `null` if no title has been set.",
 984    )
 985    ttl: int | None = Field(
 986        default=None,
 987        description="Time-to-live in seconds after which the thread may be automatically cleaned up. `null` if the thread does not expire.",
 988    )
 989    unread_count: int | None = Field(
 990        default=None,
 991        description="Number of messages in this thread that the authenticated user has not yet read. Present only when read-state enrichment is requested.",
 992    )
 993    updated_at: datetime | None = Field(
 994        default=None, description="When the thread was last modified (ISO 8601)."
 995    )
 996    user: str | None = Field(
 997        default=None,
 998        description="ID of the user who owns this thread (`usr_...`). `null` for team-owned or agent-owned threads.",
 999    )
1000
1001
1002class UserThreadListResponse(BaseModel):
1003    """
1004    Successful response
1005    """
1006
1007    data: list[UserThreadListResponseDataItem] = Field(
1008        ...,
1009        description="Array of thread objects matching the requested filters and agent narrowings.",
1010    )
1011
1012
1013class UserArtifactsResponseDataItemImageSource(BaseModel):
1014    file: str | None = Field(
1015        default=None,
1016        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
1017    )
1018    height: int | None = Field(
1019        default=None, description="Height of the image in pixels. `null` if not known."
1020    )
1021    media: str | None = Field(
1022        default=None,
1023        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
1024    )
1025    mime_type: str | None = Field(
1026        default=None,
1027        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
1028    )
1029    refresh_url: str | None = Field(
1030        default=None,
1031        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
1032    )
1033    url: str | None = Field(
1034        default=None,
1035        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
1036    )
1037    width: int | None = Field(
1038        default=None, description="Width of the image in pixels. `null` if not known."
1039    )
1040
1041
1042class UserArtifactsResponseDataItem(BaseModel):
1043    agent: str | None = Field(
1044        default=None,
1045        description="ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced.",
1046    )
1047    content_type: str | None = Field(
1048        default=None,
1049        description='MIME type of the current version\'s file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached.',
1050    )
1051    created_at: datetime | None = Field(
1052        default=None, description="When the artifact was first created (ISO 8601)."
1053    )
1054    current_version: str | None = Field(
1055        default=None,
1056        description="ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published.",
1057    )
1058    description: str | None = Field(
1059        default=None,
1060        description="Optional longer description of the artifact's contents or purpose. `null` if not set.",
1061    )
1062    file: str | None = Field(
1063        default=None,
1064        description="Storage file ID for the current version (`fil_...`). `null` if no file is attached.",
1065    )
1066    file_name: str | None = Field(
1067        default=None,
1068        description='Original filename of the current version\'s file, e.g. `"output.csv"`. `null` if no file is attached.',
1069    )
1070    file_url: str | None = Field(
1071        default=None,
1072        description="Short-lived signed URL for downloading the current version's file. `null` if no file is attached.",
1073    )
1074    id: str = Field(..., description="Artifact ID (`art_...`).")
1075    image_source: UserArtifactsResponseDataItemImageSource | None = Field(
1076        default=None,
1077        description='Image source metadata for rendering the current version\'s file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise.',
1078    )
1079    name: str | None = Field(
1080        default=None,
1081        description='Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set.',
1082    )
1083    org: str | None = Field(
1084        default=None, description="ID of the organization this artifact belongs to (`org_...`)."
1085    )
1086    sandbox: str | None = Field(
1087        default=None,
1088        description="Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped.",
1089    )
1090    team: str | None = Field(
1091        default=None,
1092        description="ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped.",
1093    )
1094    thread: str | None = Field(
1095        default=None,
1096        description="ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped.",
1097    )
1098    updated_at: datetime | None = Field(
1099        default=None, description="When the artifact record was last modified (ISO 8601)."
1100    )
1101    user: str | None = Field(
1102        default=None,
1103        description="ID of the user who created this artifact (`usr_...`). `null` if not user-scoped.",
1104    )
1105    version: int | None = Field(
1106        default=None,
1107        description="Current version number of the artifact. Increments each time a new version is published.",
1108    )
1109
1110
1111class UserArtifactsResponse(BaseModel):
1112    """
1113    Successful response
1114    """
1115
1116    data: list[UserArtifactsResponseDataItem] = Field(
1117        ..., description="Array of artifact objects belonging to the user."
1118    )
1119
1120
1121class UserOrgsResponseDataItem(BaseModel):
1122    created_at: datetime | None = Field(
1123        default=None, description="When this organization was created (ISO 8601)."
1124    )
1125    description: str | None = Field(
1126        default=None,
1127        description="Short human-readable description of the organization. `null` if not set.",
1128    )
1129    domain: str | None = Field(
1130        default=None,
1131        description='Primary domain associated with the organization, e.g. `"acme.com"`. `null` if not configured.',
1132    )
1133    id: str = Field(..., description="Organization ID (`org_...`).")
1134    industry: str | None = Field(
1135        default=None,
1136        description='Industry category the organization belongs to, e.g. `"fintech"` or `"healthcare"`. `null` if not set.',
1137    )
1138    name: str | None = Field(
1139        default=None,
1140        description="Display name of the organization. `null` if the org has not set a name.",
1141    )
1142    onboarding_track: str | None = Field(
1143        default=None,
1144        description='The new-user experience track this org first completed. `"vendor"` for orgs that onboarded as service providers; `"customer"` for orgs that onboarded as buyers. `null` if onboarding was not tracked.',
1145    )
1146    sandbox: str | None = Field(
1147        default=None,
1148        description="ID of the sandbox environment scoped to this organization (`snd_...`). `null` for organizations in production mode.",
1149    )
1150    slug: str | None = Field(
1151        default=None,
1152        description="URL-safe identifier for the organization, used in vanity URLs and slug-based lookups.",
1153    )
1154    status: str | None = Field(
1155        default=None,
1156        description='Current lifecycle status of the organization, e.g. `"active"` or `"suspended"`. `null` if the status has not been set.',
1157    )
1158    updated_at: datetime | None = Field(
1159        default=None, description="When this organization was last modified (ISO 8601)."
1160    )
1161    website: str | None = Field(
1162        default=None, description="Public website URL for the organization. `null` if not set."
1163    )
1164
1165
1166class UserOrgsResponse(BaseModel):
1167    """
1168    Successful response
1169    """
1170
1171    data: list[UserOrgsResponseDataItem] = Field(
1172        ...,
1173        description="Array of organization objects the user belongs to. Contains at most one item.",
1174    )
1175
1176
1177class AsyncUserThreadResource:
1178    def __init__(self, http: HttpClient):
1179        self._http = http
1180
1181    async def list(
1182        self,
1183        user: str,
1184        *,
1185        agent: builtins.list[str] | None = None,
1186        filter: builtins.list[dict[str, Any]] | None = None,
1187    ) -> UserThreadListResponse:
1188        """
1189        List threads for a user
1190        Returns all threads visible to the specified user. The authenticated caller must
1191        have access to the target user's account; a 403 is returned otherwise.
1192        Pass one or more `agent` IDs to narrow results to threads where at least one of
1193        the listed agents is also a member useful for displaying every thread a user
1194        shares with a particular agent. Pass one or more `filter` objects to narrow
1195        results by thread metadata key/value pairs. Both narrowings may be combined in
1196        a single request.
1197        Results are returned as a flat array; no cursor-based pagination is applied.
1198
1199        Args:
1200            user: User ID (`usr_...`) whose threads should be listed.
1201            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1202            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1203
1204        Returns:
1205            Successful response
1206        """
1207        query: dict[str, object] = {}
1208        if agent is not None:
1209            query["agent"] = agent
1210        if filter is not None:
1211            query["filter"] = filter
1212        return await self._http.request(
1213            f"/api/v1/users/{user}/threads",
1214            query=query,
1215            response_type=UserThreadListResponse,
1216        )
1217
1218    async def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1219        """
1220        Create a thread for a user
1221        Creates a new thread owned by the specified user. The authenticated caller must
1222        have access to the target user's account; a 403 is returned otherwise.
1223        An automatic welcome message is sent into the thread upon creation unless
1224        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1225        the owning user and any members added at creation time.
1226
1227        Args:
1228            user: User ID (`usr_...`) whose threads should be listed.
1229            input: Request body.
1230            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1231            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1232
1233        Returns:
1234            The newly created thread object.
1235        """
1236        return await self._http.request(
1237            f"/api/v1/users/{user}/threads",
1238            method="POST",
1239            body=input,
1240            response_type=Thread,
1241        )
1242
1243
1244class AsyncUserResource:
1245    def __init__(self, http: HttpClient):
1246        self._http = http
1247        self.threads = AsyncUserThreadResource(http)
1248
1249    async def me(self) -> User:
1250        """
1251        Retrieve the current user
1252        Returns the user associated with the authenticated session or bearer
1253        token. This is the canonical way to resolve "who am I?" after
1254        authentication.
1255        The response includes the user's profile, notification settings, and
1256        profile picture, along with the app, organization, and sandbox the
1257        token is scoped to and their display names enough to establish full
1258        session context in a single call. Unauthenticated requests return 401.
1259
1260        Returns:
1261            The authenticated user object.
1262        """
1263        return await self._http.request("/api/v1/users/me", response_type=User)
1264
1265    async def get(self, user: str) -> User:
1266        """
1267        Retrieve a user by ID
1268        Returns the user identified by `user`. The authenticated user must share
1269        at least one team with the target user; requests for users outside any
1270        shared team are rejected with 403.
1271        A user may always retrieve their own profile with this endpoint. Use the
1272        `GET /users/me` endpoint as a convenience alias for retrieving the
1273        authenticated user without specifying an ID.
1274
1275        Args:
1276            user: User ID (`usr_...`) of the user to retrieve.
1277
1278        Returns:
1279            The requested user object.
1280        """
1281        return await self._http.request(f"/api/v1/users/{user}", response_type=User)
1282
1283    async def artifacts(self, user: str) -> UserArtifactsResponse:
1284        """
1285        List a user's artifacts
1286        Returns all artifacts owned by the specified user. Artifacts represent
1287        AI-generated or user-uploaded files associated with agent sessions,
1288        threads, or sandboxes such as images, documents, and code outputs.
1289        The authenticated user must be requesting their own artifacts or must
1290        have administrative access. Attempting to list artifacts for a user
1291        the caller is not authorized to access returns 403.
1292        Results are returned in a single page without cursor pagination. Each
1293        artifact in the response reflects the state of its current version,
1294        including a short-lived signed `file_url` for direct download.
1295
1296        Args:
1297            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1298
1299        Returns:
1300            Successful response
1301        """
1302        return await self._http.request(
1303            f"/api/v1/users/{user}/artifacts",
1304            response_type=UserArtifactsResponse,
1305        )
1306
1307    async def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1308        """
1309        Create a user invite
1310        Creates a new invite for the authenticated user. The invite can optionally be
1311        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1312        caller receives the new invite object at HTTP 201.
1313        The invite key is always generated server-side (192-bit URL-safe random
1314        string) and cannot be supplied by the caller.
1315        The path `:user` must match the authenticated user. If a `thread_id` is
1316        provided, the authenticated user must have permission to invite others to that
1317        thread; team threads are not supported and return an error. Supplying a
1318        `thread_id` that does not exist or that belongs to a different user returns
1319        an error. If a key collision occurs during creation the call returns a 409
1320        conflict simply retry to generate a new key.
1321
1322        Args:
1323            user: User ID (`usr_...`). Must match the authenticated user.
1324            input: Request body.
1325            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1326
1327        Returns:
1328            The newly created invite object.
1329        """
1330        return await self._http.request(
1331            f"/api/v1/users/{user}/invites",
1332            method="POST",
1333            body=input,
1334            response_type=UserInvite,
1335        )
1336
1337    async def orgs(self, user: str) -> UserOrgsResponse:
1338        """
1339        List organizations for a user
1340        Returns the organizations the specified user belongs to. A user can belong
1341        to at most one organization, so the `data` array contains either zero or one
1342        items.
1343        The authenticated viewer must have permission to inspect the target user.
1344        Returns an empty `data` array when the user has no organization membership.
1345
1346        Args:
1347            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1348
1349        Returns:
1350            Successful response
1351        """
1352        return await self._http.request(
1353            f"/api/v1/users/{user}/orgs",
1354            response_type=UserOrgsResponse,
1355        )
1356
1357    async def profile(self, user: str, input: UserProfileInput) -> User:
1358        """
1359        Update the current user's profile
1360        Updates one or more profile fields for the authenticated user. All
1361        fields are optional; omit any you do not want to change.
1362        When `profile_picture` is supplied, the image is uploaded and replaces
1363        the existing picture. The previous picture is deleted after the new one
1364        is stored. Image upload failures return 422 without modifying other
1365        profile fields.
1366
1367        Args:
1368            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1369            input: Request body.
1370            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1371            input.full_name: Updated display name for the user.
1372            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1373            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1374
1375        Returns:
1376            The user object with updated profile fields.
1377        """
1378        return await self._http.request(
1379            f"/api/v1/users/{user}/profile",
1380            method="PUT",
1381            body=input,
1382            response_type=User,
1383        )
1384
1385
1386class UserThreadResource:
1387    def __init__(self, http: SyncHttpClient):
1388        self._http = http
1389
1390    def list(
1391        self,
1392        user: str,
1393        *,
1394        agent: builtins.list[str] | None = None,
1395        filter: builtins.list[dict[str, Any]] | None = None,
1396    ) -> UserThreadListResponse:
1397        """
1398        List threads for a user
1399        Returns all threads visible to the specified user. The authenticated caller must
1400        have access to the target user's account; a 403 is returned otherwise.
1401        Pass one or more `agent` IDs to narrow results to threads where at least one of
1402        the listed agents is also a member useful for displaying every thread a user
1403        shares with a particular agent. Pass one or more `filter` objects to narrow
1404        results by thread metadata key/value pairs. Both narrowings may be combined in
1405        a single request.
1406        Results are returned as a flat array; no cursor-based pagination is applied.
1407
1408        Args:
1409            user: User ID (`usr_...`) whose threads should be listed.
1410            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1411            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1412
1413        Returns:
1414            Successful response
1415        """
1416        query: dict[str, object] = {}
1417        if agent is not None:
1418            query["agent"] = agent
1419        if filter is not None:
1420            query["filter"] = filter
1421        return self._http.request(
1422            f"/api/v1/users/{user}/threads",
1423            query=query,
1424            response_type=UserThreadListResponse,
1425        )
1426
1427    def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1428        """
1429        Create a thread for a user
1430        Creates a new thread owned by the specified user. The authenticated caller must
1431        have access to the target user's account; a 403 is returned otherwise.
1432        An automatic welcome message is sent into the thread upon creation unless
1433        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1434        the owning user and any members added at creation time.
1435
1436        Args:
1437            user: User ID (`usr_...`) whose threads should be listed.
1438            input: Request body.
1439            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1440            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1441
1442        Returns:
1443            The newly created thread object.
1444        """
1445        return self._http.request(
1446            f"/api/v1/users/{user}/threads",
1447            method="POST",
1448            body=input,
1449            response_type=Thread,
1450        )
1451
1452
1453class UserResource:
1454    def __init__(self, http: SyncHttpClient):
1455        self._http = http
1456        self.threads = UserThreadResource(http)
1457
1458    def me(self) -> User:
1459        """
1460        Retrieve the current user
1461        Returns the user associated with the authenticated session or bearer
1462        token. This is the canonical way to resolve "who am I?" after
1463        authentication.
1464        The response includes the user's profile, notification settings, and
1465        profile picture, along with the app, organization, and sandbox the
1466        token is scoped to and their display names enough to establish full
1467        session context in a single call. Unauthenticated requests return 401.
1468
1469        Returns:
1470            The authenticated user object.
1471        """
1472        return self._http.request("/api/v1/users/me", response_type=User)
1473
1474    def get(self, user: str) -> User:
1475        """
1476        Retrieve a user by ID
1477        Returns the user identified by `user`. The authenticated user must share
1478        at least one team with the target user; requests for users outside any
1479        shared team are rejected with 403.
1480        A user may always retrieve their own profile with this endpoint. Use the
1481        `GET /users/me` endpoint as a convenience alias for retrieving the
1482        authenticated user without specifying an ID.
1483
1484        Args:
1485            user: User ID (`usr_...`) of the user to retrieve.
1486
1487        Returns:
1488            The requested user object.
1489        """
1490        return self._http.request(f"/api/v1/users/{user}", response_type=User)
1491
1492    def artifacts(self, user: str) -> UserArtifactsResponse:
1493        """
1494        List a user's artifacts
1495        Returns all artifacts owned by the specified user. Artifacts represent
1496        AI-generated or user-uploaded files associated with agent sessions,
1497        threads, or sandboxes such as images, documents, and code outputs.
1498        The authenticated user must be requesting their own artifacts or must
1499        have administrative access. Attempting to list artifacts for a user
1500        the caller is not authorized to access returns 403.
1501        Results are returned in a single page without cursor pagination. Each
1502        artifact in the response reflects the state of its current version,
1503        including a short-lived signed `file_url` for direct download.
1504
1505        Args:
1506            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1507
1508        Returns:
1509            Successful response
1510        """
1511        return self._http.request(
1512            f"/api/v1/users/{user}/artifacts",
1513            response_type=UserArtifactsResponse,
1514        )
1515
1516    def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1517        """
1518        Create a user invite
1519        Creates a new invite for the authenticated user. The invite can optionally be
1520        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1521        caller receives the new invite object at HTTP 201.
1522        The invite key is always generated server-side (192-bit URL-safe random
1523        string) and cannot be supplied by the caller.
1524        The path `:user` must match the authenticated user. If a `thread_id` is
1525        provided, the authenticated user must have permission to invite others to that
1526        thread; team threads are not supported and return an error. Supplying a
1527        `thread_id` that does not exist or that belongs to a different user returns
1528        an error. If a key collision occurs during creation the call returns a 409
1529        conflict simply retry to generate a new key.
1530
1531        Args:
1532            user: User ID (`usr_...`). Must match the authenticated user.
1533            input: Request body.
1534            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1535
1536        Returns:
1537            The newly created invite object.
1538        """
1539        return self._http.request(
1540            f"/api/v1/users/{user}/invites",
1541            method="POST",
1542            body=input,
1543            response_type=UserInvite,
1544        )
1545
1546    def orgs(self, user: str) -> UserOrgsResponse:
1547        """
1548        List organizations for a user
1549        Returns the organizations the specified user belongs to. A user can belong
1550        to at most one organization, so the `data` array contains either zero or one
1551        items.
1552        The authenticated viewer must have permission to inspect the target user.
1553        Returns an empty `data` array when the user has no organization membership.
1554
1555        Args:
1556            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1557
1558        Returns:
1559            Successful response
1560        """
1561        return self._http.request(f"/api/v1/users/{user}/orgs", response_type=UserOrgsResponse)
1562
1563    def profile(self, user: str, input: UserProfileInput) -> User:
1564        """
1565        Update the current user's profile
1566        Updates one or more profile fields for the authenticated user. All
1567        fields are optional; omit any you do not want to change.
1568        When `profile_picture` is supplied, the image is uploaded and replaces
1569        the existing picture. The previous picture is deleted after the new one
1570        is stored. Image upload failures return 422 without modifying other
1571        profile fields.
1572
1573        Args:
1574            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1575            input: Request body.
1576            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1577            input.full_name: Updated display name for the user.
1578            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1579            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1580
1581        Returns:
1582            The user object with updated profile fields.
1583        """
1584        return self._http.request(
1585            f"/api/v1/users/{user}/profile",
1586            method="PUT",
1587            body=input,
1588            response_type=User,
1589        )
class UserThreadCreateInputThreadProfilePicture(typing.TypedDict):
19class UserThreadCreateInputThreadProfilePicture(TypedDict, total=False):
20    data: str | None
21    "Base64-encoded image bytes."
22    filename: str | None
23    "Original filename of the uploaded image, used for display and content-type inference."
24    mime_type: str | None
25    'MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`.'
data: str | None

Base64-encoded image bytes.

filename: str | None

Original filename of the uploaded image, used for display and content-type inference.

mime_type: str | None

MIME type of the image, e.g. "image/png" or "image/jpeg".

class UserThreadCreateInputThreadSettings(typing.TypedDict):
28class UserThreadCreateInputThreadSettings(TypedDict, total=False):
29    agent_enabled: bool | None
30    "Whether the AI agent is active for this thread. `true` enables AI responses; `false` disables them. Defaults to `true` when settings have not been explicitly configured."
agent_enabled: bool | None

Whether the AI agent is active for this thread. true enables AI responses; false disables them. Defaults to true when settings have not been explicitly configured.

class UserThreadCreateInputThread(typing.TypedDict):
33class UserThreadCreateInputThread(TypedDict, total=False):
34    create_legacy_agent: bool | None
35    "When `true`, provisions a legacy chat agent alongside the thread. Only needed for integrations that depend on the pre-v2 agent model."
36    description: str | None
37    "Optional longer description of the thread's purpose. `null` if not provided."
38    is_unlisted: bool | None
39    "When `true`, the thread is hidden from the default thread list and accessible only by direct link or ID."
40    key: str | None
41    "Client-assigned unique key for idempotent creation or later lookup. Must be unique within the owning organization."
42    metadata: dict[str, Any] | None
43    "Arbitrary key-value pairs stored alongside the thread. Values must be strings or numbers."
44    muted: bool | None
45    "When `true`, push and in-app notifications for this thread are suppressed for the creating user."
46    org_id: str | None
47    "ID of the organization to create the thread under. Defaults to the authenticated user's primary organization when omitted."
48    profile_picture: UserThreadCreateInputThreadProfilePicture | None
49    "Optional profile image for the thread, provided as a base64-encoded payload."
50    settings: UserThreadCreateInputThreadSettings | None
51    "Configuration overrides for the thread, such as AI model selection and context window settings."
52    title: str | None
53    "Display name for the thread. `null` if omitted, which causes the thread to be untitled."
create_legacy_agent: bool | None

When true, provisions a legacy chat agent alongside the thread. Only needed for integrations that depend on the pre-v2 agent model.

description: str | None

Optional longer description of the thread's purpose. null if not provided.

is_unlisted: bool | None

When true, the thread is hidden from the default thread list and accessible only by direct link or ID.

key: str | None

Client-assigned unique key for idempotent creation or later lookup. Must be unique within the owning organization.

metadata: dict[str, typing.Any] | None

Arbitrary key-value pairs stored alongside the thread. Values must be strings or numbers.

muted: bool | None

When true, push and in-app notifications for this thread are suppressed for the creating user.

org_id: str | None

ID of the organization to create the thread under. Defaults to the authenticated user's primary organization when omitted.

Optional profile image for the thread, provided as a base64-encoded payload.

Configuration overrides for the thread, such as AI model selection and context window settings.

title: str | None

Display name for the thread. null if omitted, which causes the thread to be untitled.

class UserThreadCreateInput(typing.TypedDict):
56class UserThreadCreateInput(TypedDict, total=False):
57    "Create a thread for a user"
58
59    skip_welcome_message: bool | None
60    "When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`."
61    thread: Required[UserThreadCreateInputThread]
62    "Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields."

Create a thread for a user

skip_welcome_message: bool | None

When true, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to false.

thread: Required[UserThreadCreateInputThread]

Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.

class UserInvitesInputInvite(typing.TypedDict):
65class UserInvitesInputInvite(TypedDict, total=False):
66    metadata: dict[str, Any] | None
67    "Arbitrary key-value metadata to attach to the invite. Returned as-is on the resulting invite object."
68    persona_id: str | None
69    "ID of the persona to associate with this invite (`per_...`). `null` if the invite is not bound to a persona."
70    thread_id: str | None
71    "ID of the thread to associate with this invite (`thr_...`). `null` if the invite is not bound to a thread."
metadata: dict[str, typing.Any] | None

Arbitrary key-value metadata to attach to the invite. Returned as-is on the resulting invite object.

persona_id: str | None

ID of the persona to associate with this invite (per_...). null if the invite is not bound to a persona.

thread_id: str | None

ID of the thread to associate with this invite (thr_...). null if the invite is not bound to a thread.

class UserInvitesInput(typing.TypedDict):
74class UserInvitesInput(TypedDict):
75    "Create a user invite"
76
77    invite: UserInvitesInputInvite
78    "Parameters for the new invite. See the UserInviteCreateParams schema for field details."

Create a user invite

Parameters for the new invite. See the UserInviteCreateParams schema for field details.

class UserProfileInputProfilePicture(typing.TypedDict):
81class UserProfileInputProfilePicture(TypedDict, total=False):
82    data: str | None
83    "Base64-encoded binary content of the image file."
84    filename: str | None
85    "Original filename of the image, used for storage metadata."
86    mime_type: str | None
87    'MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`.'
data: str | None

Base64-encoded binary content of the image file.

filename: str | None

Original filename of the image, used for storage metadata.

mime_type: str | None

MIME type of the image, e.g. "image/png" or "image/jpeg".

class UserProfileInput(typing.TypedDict):
 90class UserProfileInput(TypedDict, total=False):
 91    "Update the current user's profile"
 92
 93    alias: str | None
 94    "Short display alias shown in place of the full name in compact UI contexts."
 95    full_name: str | None
 96    "Updated display name for the user."
 97    metadata: dict[str, Any] | None
 98    "Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it."
 99    profile_picture: UserProfileInputProfilePicture | None
100    "New profile picture to upload as a base64-encoded image. Replaces any existing picture."

Update the current user's profile

alias: str | None

Short display alias shown in place of the full name in compact UI contexts.

full_name: str | None

Updated display name for the user.

metadata: dict[str, typing.Any] | None

Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass null for a key to remove it.

profile_picture: UserProfileInputProfilePicture | None

New profile picture to upload as a base64-encoded image. Replaces any existing picture.

class UserThreadListResponseDataItemCreator(pydantic.main.BaseModel):
103class UserThreadListResponseDataItemCreator(BaseModel):
104    alias: str | None = Field(
105        default=None, description="Short handle or alias for the user. `null` if not set."
106    )
107    app: str | None = Field(
108        default=None,
109        description="ID of the app this user (and their access token) is scoped to (`dap_...`). `null` if the user is not scoped to an app.",
110    )
111    app_name: str | None = Field(
112        default=None,
113        description="Display name of the user's app. `null` when the app association was not preloaded by the caller.",
114    )
115    email: str | None = Field(default=None, description="Email address of the user.")
116    id: str = Field(..., description="User ID (`usr_...`).")
117    is_system_user: bool | None = Field(
118        default=None,
119        description="`true` if this account is an internal system user rather than a human. System users are created automatically by the platform.",
120    )
121    metadata: dict[str, Any] | None = Field(
122        default=None,
123        description="Arbitrary key-value metadata attached to the user. Defaults to an empty object.",
124    )
125    name: str | None = Field(
126        default=None,
127        description="Full display name of the user. `null` if the user has not set a name.",
128    )
129    org: str | None = Field(
130        default=None,
131        description="ID of the organization this user belongs to (`org_...`). `null` if the user is not a member of any organization.",
132    )
133    org_name: str | None = Field(
134        default=None,
135        description="Display name of the user's organization. `null` when the user is not in an org, or when the org association was not preloaded by the caller.",
136    )
137    org_role: str | None = Field(
138        default=None,
139        description='Role of the user within their organization. One of `"admin"`, `"member"`, or `"viewer"`. `null` when the user is not a member of any organization.',
140    )
141    sandbox: str | None = Field(
142        default=None,
143        description="ID of the sandbox environment this user is scoped to (`sbx_...`). `null` for production users.",
144    )
145    sandbox_name: str | None = Field(
146        default=None,
147        description="Display name of the user's sandbox environment. `null` for production users, or when the sandbox association was not preloaded by the caller.",
148    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
alias: str | None = None

Short handle or alias for the user. null if not set.

app: str | None = None

ID of the app this user (and their access token) is scoped to (dap_...). null if the user is not scoped to an app.

app_name: str | None = None

Display name of the user's app. null when the app association was not preloaded by the caller.

email: str | None = None

Email address of the user.

id: str = PydanticUndefined

User ID (usr_...).

is_system_user: bool | None = None

true if this account is an internal system user rather than a human. System users are created automatically by the platform.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata attached to the user. Defaults to an empty object.

name: str | None = None

Full display name of the user. null if the user has not set a name.

org: str | None = None

ID of the organization this user belongs to (org_...). null if the user is not a member of any organization.

org_name: str | None = None

Display name of the user's organization. null when the user is not in an org, or when the org association was not preloaded by the caller.

org_role: str | None = None

Role of the user within their organization. One of "admin", "member", or "viewer". null when the user is not a member of any organization.

sandbox: str | None = None

ID of the sandbox environment this user is scoped to (sbx_...). null for production users.

sandbox_name: str | None = None

Display name of the user's sandbox environment. null for production users, or when the sandbox association was not preloaded by the caller.

class UserThreadListResponseDataItemParentMessageActorsItemProfilePicture(pydantic.main.BaseModel):
151class UserThreadListResponseDataItemParentMessageActorsItemProfilePicture(BaseModel):
152    file: str | None = Field(
153        default=None,
154        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
155    )
156    height: int | None = Field(
157        default=None, description="Height of the image in pixels. `null` if not known."
158    )
159    media: str | None = Field(
160        default=None,
161        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
162    )
163    mime_type: str | None = Field(
164        default=None,
165        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
166    )
167    refresh_url: str | None = Field(
168        default=None,
169        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
170    )
171    url: str | None = Field(
172        default=None,
173        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
174    )
175    width: int | None = Field(
176        default=None, description="Width of the image in pixels. `null` if not known."
177    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
file: str | None = None

ID of the underlying storage file (fil_...). null when the image is not backed by a platform storage file.

height: int | None = None

Height of the image in pixels. null if not known.

media: str | None = None

ID of the associated media record (med_...). null when the image is not linked to a media entity.

mime_type: str | None = None

MIME type of the image, e.g. "image/png" or "image/jpeg". null if not known.

refresh_url: str | None = None

Endpoint URL you can call to obtain a fresh signed url when the current one has expired. null if the URL does not require refreshing.

url: str | None = None

Signed or public URL for downloading the image. May be time-limited; use refresh_url to obtain a new URL when this one expires.

width: int | None = None

Width of the image in pixels. null if not known.

class UserThreadListResponseDataItemParentMessageActorsItem(pydantic.main.BaseModel):
180class UserThreadListResponseDataItemParentMessageActorsItem(BaseModel):
181    alias: str | None = Field(
182        default=None,
183        description="Short handle or alias for the actor, used as an alternate display identifier. `null` if not configured.",
184    )
185    id: str | None = Field(
186        default=None,
187        description='Composite actor identifier. Format is `"user-<usr_...>"` for human users or `"agent-<agi_...>"` for agents.',
188    )
189    name: str | None = Field(
190        default=None,
191        description="Display name of the actor shown in the UI. `null` if no name is set.",
192    )
193    profile_picture: UserThreadListResponseDataItemParentMessageActorsItemProfilePicture | None = (
194        Field(
195            default=None,
196            description="Profile picture for the actor. `null` if the actor has no profile picture.",
197        )
198    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
alias: str | None = None

Short handle or alias for the actor, used as an alternate display identifier. null if not configured.

id: str | None = None

Composite actor identifier. Format is "user-<usr_...>" for human users or "agent-<agi_...>" for agents.

name: str | None = None

Display name of the actor shown in the UI. null if no name is set.

Profile picture for the actor. null if the actor has no profile picture.

class UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource(pydantic.main.BaseModel):
201class UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource(BaseModel):
202    file: str | None = Field(
203        default=None,
204        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
205    )
206    height: int | None = Field(
207        default=None, description="Height of the image in pixels. `null` if not known."
208    )
209    media: str | None = Field(
210        default=None,
211        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
212    )
213    mime_type: str | None = Field(
214        default=None,
215        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
216    )
217    refresh_url: str | None = Field(
218        default=None,
219        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
220    )
221    url: str | None = Field(
222        default=None,
223        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
224    )
225    width: int | None = Field(
226        default=None, description="Width of the image in pixels. `null` if not known."
227    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
file: str | None = None

ID of the underlying storage file (fil_...). null when the image is not backed by a platform storage file.

height: int | None = None

Height of the image in pixels. null if not known.

media: str | None = None

ID of the associated media record (med_...). null when the image is not linked to a media entity.

mime_type: str | None = None

MIME type of the image, e.g. "image/png" or "image/jpeg". null if not known.

refresh_url: str | None = None

Endpoint URL you can call to obtain a fresh signed url when the current one has expired. null if the URL does not require refreshing.

url: str | None = None

Signed or public URL for downloading the image. May be time-limited; use refresh_url to obtain a new URL when this one expires.

width: int | None = None

Width of the image in pixels. null if not known.

class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource(pydantic.main.BaseModel):
230class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource(BaseModel):
231    file: str | None = Field(
232        default=None,
233        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
234    )
235    height: int | None = Field(
236        default=None, description="Height of the image in pixels. `null` if not known."
237    )
238    media: str | None = Field(
239        default=None,
240        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
241    )
242    mime_type: str | None = Field(
243        default=None,
244        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
245    )
246    refresh_url: str | None = Field(
247        default=None,
248        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
249    )
250    url: str | None = Field(
251        default=None,
252        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
253    )
254    width: int | None = Field(
255        default=None, description="Width of the image in pixels. `null` if not known."
256    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
file: str | None = None

ID of the underlying storage file (fil_...). null when the image is not backed by a platform storage file.

height: int | None = None

Height of the image in pixels. null if not known.

media: str | None = None

ID of the associated media record (med_...). null when the image is not linked to a media entity.

mime_type: str | None = None

MIME type of the image, e.g. "image/png" or "image/jpeg". null if not known.

refresh_url: str | None = None

Endpoint URL you can call to obtain a fresh signed url when the current one has expired. null if the URL does not require refreshing.

url: str | None = None

Signed or public URL for downloading the image. May be time-limited; use refresh_url to obtain a new URL when this one expires.

width: int | None = None

Width of the image in pixels. null if not known.

class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem(pydantic.main.BaseModel):
259class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem(BaseModel):
260    content_type: str | None = Field(
261        default=None,
262        description='MIME type of this variant\'s file (e.g., `"image/jpeg"`, `"video/mp4"`). `null` if the file is not loaded.',
263    )
264    created_at: datetime | None = Field(
265        default=None, description="When this variant was created (ISO 8601)."
266    )
267    file: str | None = Field(
268        default=None,
269        description="ID of the underlying storage file that backs this variant (`fil_...`).",
270    )
271    filename: str | None = Field(
272        default=None,
273        description="Original filename of the uploaded file for this variant. `null` if the file is not loaded.",
274    )
275    height: int | None = Field(
276        default=None, description="Height of this variant in pixels. `null` if not recorded."
277    )
278    id: str = Field(..., description="Media variant ID (`mvr_...`).")
279    image_source: (
280        UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource | None
281    ) = Field(
282        default=None,
283        description="Resolved image delivery metadata for this variant, including dimensions and CDN URL. `null` for non-image content types.",
284    )
285    updated_at: datetime | None = Field(
286        default=None, description="When this variant was last updated (ISO 8601)."
287    )
288    url: str | None = Field(
289        default=None,
290        description="Signed download URL for this variant, resolved at request time. `null` if the file is unavailable.",
291    )
292    variant_key: str | None = Field(
293        default=None,
294        description='Identifier for this variant\'s processing tier. Common values include `"original"` (the unmodified upload) and `"thumbnail"` (a resized preview).',
295    )
296    width: int | None = Field(
297        default=None, description="Width of this variant in pixels. `null` if not recorded."
298    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
content_type: str | None = None

MIME type of this variant's file (e.g., "image/jpeg", "video/mp4"). null if the file is not loaded.

created_at: datetime.datetime | None = None

When this variant was created (ISO 8601).

file: str | None = None

ID of the underlying storage file that backs this variant (fil_...).

filename: str | None = None

Original filename of the uploaded file for this variant. null if the file is not loaded.

height: int | None = None

Height of this variant in pixels. null if not recorded.

id: str = PydanticUndefined

Media variant ID (mvr_...).

Resolved image delivery metadata for this variant, including dimensions and CDN URL. null for non-image content types.

updated_at: datetime.datetime | None = None

When this variant was last updated (ISO 8601).

url: str | None = None

Signed download URL for this variant, resolved at request time. null if the file is unavailable.

variant_key: str | None = None

Identifier for this variant's processing tier. Common values include "original" (the unmodified upload) and "thumbnail" (a resized preview).

width: int | None = None

Width of this variant in pixels. null if not recorded.

class UserThreadListResponseDataItemParentMessageAttachmentsItem(pydantic.main.BaseModel):
301class UserThreadListResponseDataItemParentMessageAttachmentsItem(BaseModel):
302    content_type: str | None = Field(
303        default=None,
304        description='MIME type of the attached file, e.g. `"image/png"` or `"application/pdf"`. Present on `file`, `artifact`, and `media` types. `null` otherwise.',
305    )
306    description: str | None = Field(
307        default=None,
308        description="Short description. The page meta-description for `scraped_link`, the artifact description for `artifact`, and the task description for `task` types. `null` on other types.",
309    )
310    filename: str | None = Field(
311        default=None,
312        description='Original filename of the attached file, e.g. `"report.pdf"`. Present on `file`, `artifact`, and `media` types. `null` otherwise.',
313    )
314    height: int | None = Field(
315        default=None,
316        description="Height in pixels of the media item. Present on `media` type only. `null` otherwise.",
317    )
318    id: str = Field(..., description="Unique identifier for this attachment within the message.")
319    image_height: int | None = Field(
320        default=None,
321        description="Height in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise.",
322    )
323    image_source: UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource | None = (
324        Field(
325            default=None,
326            description="Image source metadata for inline rendering. Present on `file`, `scraped_link`, `artifact`, and `media` types when the content is an image. `null` otherwise.",
327        )
328    )
329    image_url: str | None = Field(
330        default=None,
331        description="URL of the preview image extracted from the scraped page. Present on `scraped_link` type only. `null` otherwise.",
332    )
333    image_width: int | None = Field(
334        default=None,
335        description="Width in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise.",
336    )
337    media_type: str | None = Field(
338        default=None,
339        description='The media category, e.g. `"video"` or `"audio"`. Present on `media` type only. `null` otherwise.',
340    )
341    name: str | None = Field(
342        default=None,
343        description="Display name of the media item. Present on `media` type only. `null` otherwise.",
344    )
345    object: dict[str, Any] | None = Field(
346        default=None,
347        description="The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. `null` on other types.",
348    )
349    title: str | None = Field(
350        default=None,
351        description="Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types.",
352    )
353    type: str = Field(
354        ...,
355        description='The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, or `"action"`. Determines which additional fields are present.',
356    )
357    url: str | None = Field(
358        default=None,
359        description="URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types.",
360    )
361    variants: (
362        list[UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem] | None
363    ) = Field(
364        default=None,
365        description="Array of available encoding variants for the media item (e.g. different resolutions). Present on `media` type only. `null` otherwise.",
366    )
367    version: int | None = Field(
368        default=None,
369        description="Version number of the attached artifact at the time of attachment. Present on `artifact` type only. `null` otherwise.",
370    )
371    width: int | None = Field(
372        default=None,
373        description="Width in pixels of the media item. Present on `media` type only. `null` otherwise.",
374    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
content_type: str | None = None

MIME type of the attached file, e.g. "image/png" or "application/pdf". Present on file, artifact, and media types. null otherwise.

description: str | None = None

Short description. The page meta-description for scraped_link, the artifact description for artifact, and the task description for task types. null on other types.

filename: str | None = None

Original filename of the attached file, e.g. "report.pdf". Present on file, artifact, and media types. null otherwise.

height: int | None = None

Height in pixels of the media item. Present on media type only. null otherwise.

id: str = PydanticUndefined

Unique identifier for this attachment within the message.

image_height: int | None = None

Height in pixels of the scraped preview image. Present on scraped_link type only. null otherwise.

Image source metadata for inline rendering. Present on file, scraped_link, artifact, and media types when the content is an image. null otherwise.

image_url: str | None = None

URL of the preview image extracted from the scraped page. Present on scraped_link type only. null otherwise.

image_width: int | None = None

Width in pixels of the scraped preview image. Present on scraped_link type only. null otherwise.

media_type: str | None = None

The media category, e.g. "video" or "audio". Present on media type only. null otherwise.

name: str | None = None

Display name of the media item. Present on media type only. null otherwise.

object: dict[str, typing.Any] | None = None

The full embedded object payload. For task type, contains the task record. For action type, contains the action definition. null on other types.

title: str | None = None

Display title. The page title for scraped_link, the artifact name for artifact, and the task title for task types. null on other types.

type: str = PydanticUndefined

The attachment type. One of "file", "scraped_link", "artifact", "task", "media", or "action". Determines which additional fields are present.

url: str | None = None

URL to access the resource. A signed download URL for file and artifact types; the original URL for scraped_link; a media playback URL for media. null on task and action types.

Array of available encoding variants for the media item (e.g. different resolutions). Present on media type only. null otherwise.

version: int | None = None

Version number of the attached artifact at the time of attachment. Present on artifact type only. null otherwise.

width: int | None = None

Width in pixels of the media item. Present on media type only. null otherwise.

class UserThreadListResponseDataItemParentMessageReactionsItem(pydantic.main.BaseModel):
377class UserThreadListResponseDataItemParentMessageReactionsItem(BaseModel):
378    payload: dict[str, Any] | None = Field(
379        default=None,
380        description='Type-specific reaction data. For `"emoji_reaction"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `" "`).',
381    )
382    type: str = Field(
383        ...,
384        description='Reaction type identifier. Currently always `"emoji_reaction"` for emoji-based reactions.',
385    )
386    user: str | None = Field(
387        default=None, description="Public ID of the user who added the reaction (`usr_...`)."
388    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
payload: dict[str, typing.Any] | None = None

Type-specific reaction data. For "emoji_reaction" reactions, contains an emoji key with the Unicode emoji string (e.g., " ").

type: str = PydanticUndefined

Reaction type identifier. Currently always "emoji_reaction" for emoji-based reactions.

user: str | None = None

Public ID of the user who added the reaction (usr_...).

class UserThreadListResponseDataItemParentMessage(pydantic.main.BaseModel):
391class UserThreadListResponseDataItemParentMessage(BaseModel):
392    actors: list[UserThreadListResponseDataItemParentMessageActorsItem] | None = Field(
393        default=None,
394        description="Resolved actor descriptors for the message sender, combining identity and display metadata. Always contains exactly one entry.",
395    )
396    agent: str | None = Field(
397        default=None,
398        description="ID of the agent user that sent this message (`agi_...`). `null` for messages sent by human users.",
399    )
400    agent_mode: Literal["cli", "embedded"] | None = Field(
401        default=None,
402        description="Local agent execution mode for this message. One of `cli`, `embedded`, or `null` when the message was not created by a local agent execution path.",
403    )
404    attachments: list[UserThreadListResponseDataItemParentMessageAttachmentsItem] | None = Field(
405        default=None,
406        description="Files, links, tasks, media, artifacts, and actions attached to this message. Empty array if there are no attachments.",
407    )
408    branched_thread: str | None = Field(
409        default=None,
410        description="ID of the thread that was branched from this message (`thr_...`). `null` if this message has not spawned a branch thread.",
411    )
412    content: str | None = Field(
413        default=None,
414        description="Text content of the message. `null` for messages that contain only attachments.",
415    )
416    created_at: datetime | None = Field(
417        default=None, description="When the message was posted (ISO 8601)."
418    )
419    has_replies: bool | None = Field(
420        default=None,
421        description="Whether this message has at least one reply. Only present when explicitly requested or computed by the server.",
422    )
423    id: str = Field(..., description="Message ID (`msg_...`).")
424    idempotency_key: str | None = Field(
425        default=None,
426        description="Client-supplied idempotency key used to deduplicate message sends. `null` if the sender did not provide one.",
427    )
428    legacy_agent: str | None = Field(
429        default=None,
430        description="Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users.",
431    )
432    metadata: dict[str, Any] | None = Field(
433        default=None,
434        description="Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set.",
435    )
436    org: str | None = Field(
437        default=None, description="ID of the organization that owns this message (`org_...`)."
438    )
439    reactions: list[UserThreadListResponseDataItemParentMessageReactionsItem] | None = Field(
440        default=None,
441        description="Emoji and other reactions added to this message by users. Empty array if no reactions have been added or the association is not preloaded.",
442    )
443    rendering_mode: str | None = Field(
444        default=None,
445        description='Display hint for how the message should be rendered. One of `"reply"`, `"direct"`, or `"inline"`. `null` for user-authored messages, which are always rendered as standard replies.',
446    )
447    replies: list[dict[str, Any]] | None = Field(
448        default=None,
449        description="Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message.",
450    )
451    replies_after_cursor: str | None = Field(
452        default=None,
453        description="Opaque pagination cursor to fetch replies posted after the current page. Only present when inline replies are included in the response.",
454    )
455    replies_before_cursor: str | None = Field(
456        default=None,
457        description="Opaque pagination cursor to fetch replies posted before the current page. Only present when inline replies are included in the response.",
458    )
459    reply_count: int | None = Field(
460        default=None,
461        description="Total number of direct replies to this message. Only present when explicitly requested or computed by the server.",
462    )
463    reply_to: dict[str, Any] | None = Field(
464        default=None,
465        description="The parent message this message is a reply to, expanded as a full message object when loaded. `null` if this is a top-level message or the association is not preloaded.",
466    )
467    sandbox: str | None = Field(
468        default=None,
469        description="ID of the developer sandbox this message belongs to (`dsb_...`). `null` for non-sandbox messages.",
470    )
471    team: str | None = Field(
472        default=None,
473        description="ID of the team this message is scoped to (`tem_...`). `null` if the message is not team-scoped.",
474    )
475    thread: str | None = Field(
476        default=None,
477        description="ID of the thread this message belongs to (`thr_...`). `null` for messages not yet associated with a thread.",
478    )
479    user: str | None = Field(
480        default=None,
481        description="The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents.",
482    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Resolved actor descriptors for the message sender, combining identity and display metadata. Always contains exactly one entry.

agent: str | None = None

ID of the agent user that sent this message (agi_...). null for messages sent by human users.

agent_mode: Optional[Literal['cli', 'embedded']] = None

Local agent execution mode for this message. One of cli, embedded, or null when the message was not created by a local agent execution path.

Files, links, tasks, media, artifacts, and actions attached to this message. Empty array if there are no attachments.

branched_thread: str | None = None

ID of the thread that was branched from this message (thr_...). null if this message has not spawned a branch thread.

content: str | None = None

Text content of the message. null for messages that contain only attachments.

created_at: datetime.datetime | None = None

When the message was posted (ISO 8601).

has_replies: bool | None = None

Whether this message has at least one reply. Only present when explicitly requested or computed by the server.

id: str = PydanticUndefined

Message ID (msg_...).

idempotency_key: str | None = None

Client-supplied idempotency key used to deduplicate message sends. null if the sender did not provide one.

legacy_agent: str | None = None

Identifier of the legacy chat agent that sent this message, if applicable. null for messages sent by users or modern agent users.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set.

org: str | None = None

ID of the organization that owns this message (org_...).

Emoji and other reactions added to this message by users. Empty array if no reactions have been added or the association is not preloaded.

rendering_mode: str | None = None

Display hint for how the message should be rendered. One of "reply", "direct", or "inline". null for user-authored messages, which are always rendered as standard replies.

replies: list[dict[str, typing.Any]] | None = None

Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message.

replies_after_cursor: str | None = None

Opaque pagination cursor to fetch replies posted after the current page. Only present when inline replies are included in the response.

replies_before_cursor: str | None = None

Opaque pagination cursor to fetch replies posted before the current page. Only present when inline replies are included in the response.

reply_count: int | None = None

Total number of direct replies to this message. Only present when explicitly requested or computed by the server.

reply_to: dict[str, typing.Any] | None = None

The parent message this message is a reply to, expanded as a full message object when loaded. null if this is a top-level message or the association is not preloaded.

sandbox: str | None = None

ID of the developer sandbox this message belongs to (dsb_...). null for non-sandbox messages.

team: str | None = None

ID of the team this message is scoped to (tem_...). null if the message is not team-scoped.

thread: str | None = None

ID of the thread this message belongs to (thr_...). null for messages not yet associated with a thread.

user: str | None = None

The human user who sent this message. Returns a public ID string (usr_...) when the association is not preloaded, or an expanded user object when it is. null for messages sent by agents.

class UserThreadListResponseDataItemParticipantsItem(pydantic.main.BaseModel):
485class UserThreadListResponseDataItemParticipantsItem(BaseModel):
486    alias: str | None = Field(
487        default=None, description="Short handle or alias for the user. `null` if not set."
488    )
489    app: str | None = Field(
490        default=None,
491        description="ID of the app this user (and their access token) is scoped to (`dap_...`). `null` if the user is not scoped to an app.",
492    )
493    app_name: str | None = Field(
494        default=None,
495        description="Display name of the user's app. `null` when the app association was not preloaded by the caller.",
496    )
497    email: str | None = Field(default=None, description="Email address of the user.")
498    id: str = Field(..., description="User ID (`usr_...`).")
499    is_system_user: bool | None = Field(
500        default=None,
501        description="`true` if this account is an internal system user rather than a human. System users are created automatically by the platform.",
502    )
503    metadata: dict[str, Any] | None = Field(
504        default=None,
505        description="Arbitrary key-value metadata attached to the user. Defaults to an empty object.",
506    )
507    name: str | None = Field(
508        default=None,
509        description="Full display name of the user. `null` if the user has not set a name.",
510    )
511    org: str | None = Field(
512        default=None,
513        description="ID of the organization this user belongs to (`org_...`). `null` if the user is not a member of any organization.",
514    )
515    org_name: str | None = Field(
516        default=None,
517        description="Display name of the user's organization. `null` when the user is not in an org, or when the org association was not preloaded by the caller.",
518    )
519    org_role: str | None = Field(
520        default=None,
521        description='Role of the user within their organization. One of `"admin"`, `"member"`, or `"viewer"`. `null` when the user is not a member of any organization.',
522    )
523    sandbox: str | None = Field(
524        default=None,
525        description="ID of the sandbox environment this user is scoped to (`sbx_...`). `null` for production users.",
526    )
527    sandbox_name: str | None = Field(
528        default=None,
529        description="Display name of the user's sandbox environment. `null` for production users, or when the sandbox association was not preloaded by the caller.",
530    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
alias: str | None = None

Short handle or alias for the user. null if not set.

app: str | None = None

ID of the app this user (and their access token) is scoped to (dap_...). null if the user is not scoped to an app.

app_name: str | None = None

Display name of the user's app. null when the app association was not preloaded by the caller.

email: str | None = None

Email address of the user.

id: str = PydanticUndefined

User ID (usr_...).

is_system_user: bool | None = None

true if this account is an internal system user rather than a human. System users are created automatically by the platform.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata attached to the user. Defaults to an empty object.

name: str | None = None

Full display name of the user. null if the user has not set a name.

org: str | None = None

ID of the organization this user belongs to (org_...). null if the user is not a member of any organization.

org_name: str | None = None

Display name of the user's organization. null when the user is not in an org, or when the org association was not preloaded by the caller.

org_role: str | None = None

Role of the user within their organization. One of "admin", "member", or "viewer". null when the user is not a member of any organization.

sandbox: str | None = None

ID of the sandbox environment this user is scoped to (sbx_...). null for production users.

sandbox_name: str | None = None

Display name of the user's sandbox environment. null for production users, or when the sandbox association was not preloaded by the caller.

class UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem(pydantic.main.BaseModel):
533class UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem(BaseModel):
534    actions: list[str] = Field(
535        ...,
536        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
537    )
538    principal: str | None = Field(
539        default=None,
540        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
541    )
542    principal_type: str = Field(
543        ...,
544        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
545    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem(pydantic.main.BaseModel):
548class UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem(BaseModel):
549    actions: list[str] = Field(
550        ...,
551        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
552    )
553    principal: str | None = Field(
554        default=None,
555        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
556    )
557    principal_type: str = Field(
558        ...,
559        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
560    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem(pydantic.main.BaseModel):
563class UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem(BaseModel):
564    principal: str | None = Field(
565        default=None,
566        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
567    )
568    principal_type: str = Field(
569        ...,
570        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
571    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
principal: str | None = None

The identifier of the principal to remove. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role". Omit when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal to remove. One of "user", "team", "org", "org_role", "agent", or "everyone".

class UserThreadListResponseDataItemParticipatingAgentsItemAcl(pydantic.main.BaseModel):
574class UserThreadListResponseDataItemParticipatingAgentsItemAcl(BaseModel):
575    add: list[UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem] | None = Field(
576        default=None,
577        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
578    )
579    grants: list[UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem] | None = Field(
580        default=None,
581        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
582    )
583    remove: list[UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem] | None = Field(
584        default=None,
585        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
586    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Patch mode: grants to add or merge into the existing list. Cannot be combined with grants.

Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array ([]) to clear all grants. Cannot be combined with add or remove.

Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with grants.

class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionTemplatesItem(pydantic.main.BaseModel):
618class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionTemplatesItem(
619    BaseModel
620):
621    description: str | None = Field(
622        default=None,
623        description="Short prose blurb from the template body's `description:` field. `null` when the body doesn't set one. Used as the card subhead in the Library carousel.",
624    )
625    display_name: str | None = Field(
626        default=None,
627        description="Human-facing label from the template body's `display_name:` field. `null` when the body doesn't set one. Library carousels use this for the card title, falling back to a humanized `name`.",
628    )
629    id: str | None = Field(
630        default=None,
631        description="Template config ID (`cfg_...`). `null` for inline-only templates.",
632    )
633    kind: str = Field(
634        ...,
635        description="Template config kind, or `SolutionTemplateRef` / `SolutionTemplatePath` when unresolved.",
636    )
637    lookup_key: str | None = Field(
638        default=None,
639        description="Lookup key stamped on the template config at import time. `null` when no lookup key was assigned.",
640    )
641    name: str | None = Field(
642        default=None,
643        description="Canonical name from the template body. For `AgentTemplate` this doubles as the human-facing label; for `AgentToolTemplate` it's the LLM-facing tool function identifier (snake_case); for `AgentRoutineTemplate` it's the routine identifier (kebab-case). Clients rendering carousels should prefer `display_name` and fall back to humanizing `name`.",
644    )
645    readme_url: str | None = Field(
646        default=None,
647        description="Relative path to the public README endpoint with a signed token already embedded, scoped to this template's bundled markdown asset. `null` when the Solution body's `templates[].readme_path` is unset for this entry. Token expires in 1 hour refresh via `GET /api/v1/solutions/:solution`.",
648    )
649    virtual_path: str | None = Field(
650        default=None,
651        description="Stable virtual path assigned to the template config. `null` when no virtual path was set.",
652    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
description: str | None = None

Short prose blurb from the template body's description: field. null when the body doesn't set one. Used as the card subhead in the Library carousel.

display_name: str | None = None

Human-facing label from the template body's display_name: field. null when the body doesn't set one. Library carousels use this for the card title, falling back to a humanized name.

id: str | None = None

Template config ID (cfg_...). null for inline-only templates.

kind: str = PydanticUndefined

Template config kind, or SolutionTemplateRef / SolutionTemplatePath when unresolved.

lookup_key: str | None = None

Lookup key stamped on the template config at import time. null when no lookup key was assigned.

name: str | None = None

Canonical name from the template body. For AgentTemplate this doubles as the human-facing label; for AgentToolTemplate it's the LLM-facing tool function identifier (snake_case); for AgentRoutineTemplate it's the routine identifier (kebab-case). Clients rendering carousels should prefer display_name and fall back to humanizing name.

readme_url: str | None = None

Relative path to the public README endpoint with a signed token already embedded, scoped to this template's bundled markdown asset. null when the Solution body's templates[].readme_path is unset for this entry. Token expires in 1 hour refresh via GET /api/v1/solutions/:solution.

virtual_path: str | None = None

Stable virtual path assigned to the template config. null when no virtual path was set.

class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolution(pydantic.main.BaseModel):
655class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolution(BaseModel):
656    category_keys: list[str] | None = Field(
657        default=None,
658        description="Category tag keys declared in the Solution body, used to group Solutions in the catalog. An empty array when the body declares none.",
659    )
660    created_at: datetime | None = Field(
661        default=None, description="When the Solution config was first imported (ISO 8601)."
662    )
663    description: str | None = Field(
664        default=None,
665        description="Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one.",
666    )
667    id: str = Field(..., description="Solution config ID (`cfg_...`).")
668    kind: str = Field(..., description='Resource type. Always `"Solution"`.')
669    latest_solution: str | None = Field(
670        default=None,
671        description="When `upgrade_available` is `true`, the system-scope Solution config ID (`cfg_...`) that should be used as the upgrade source. `null` otherwise.",
672    )
673    latest_version: str | None = Field(
674        default=None,
675        description="When `upgrade_available` is `true`, the higher system-scope `solution_version` available to upgrade to. `null` otherwise.",
676    )
677    lookup_key: str | None = Field(
678        default=None,
679        description="The lookup key stored on the Solution config, if one was assigned during import. `null` when no lookup key was set.",
680    )
681    metadata: dict[str, Any] | None = Field(
682        default=None,
683        description="Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none.",
684    )
685    name: str | None = Field(
686        default=None,
687        description="Human-facing display name declared in the Solution body. `null` when the Solution body does not set one.",
688    )
689    org: str | None = Field(
690        default=None,
691        description="Organization ID (`org_...`) that owns this Solution config, when the Solution is scoped to a specific org. `null` for system-scope (app-level) Solutions.",
692    )
693    org_logo: (
694        UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionOrgLogo | None
695    ) = Field(
696        default=None,
697        description="Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. Carries the signed `url` plus a `refresh_url`. `null` when `org_slug` is `null` or the org has no logo.",
698    )
699    org_name: str | None = Field(
700        default=None,
701        description="Display name of the resolved `org`. Pairs with `org_slug` as the principal catalog category's label. `null` when `org_slug` is `null`.",
702    )
703    org_slug: str | None = Field(
704        default=None,
705        description="Resolved slug of the Solution body's `org` (the publishing organization), when set and it resolves to a real org visible to the viewer. When present this is the Solution's principal catalog category key clients group the Solution under this org ahead of `category_keys`. `null` when the body has no `org` or it doesn't resolve.",
706    )
707    owners: list[str] = Field(
708        ...,
709        description='Owner scopes this Solution appears under. Members: `"system"` (app-level system scope) and/or `"org"` (viewer\'s org scope).',
710    )
711    readme_url: str | None = Field(
712        default=None,
713        description="Relative path to the public README endpoint with a signed token already embedded. `null` when the Solution has no README. Token expires in 1 hour refresh via `GET /api/v1/solutions/:solution`.",
714    )
715    solution_id: str | None = Field(
716        default=None,
717        description="Stable UUID declared in the Solution body, used to identify the same logical Solution across multiple installed copies and owner scopes. `null` when the body omits it.",
718    )
719    solution_version: str | None = Field(
720        default=None,
721        description='Semver string declared in the Solution body (e.g. `"1.2.0"`). `null` when the body does not declare a version.',
722    )
723    tag_keys: list[str] | None = Field(
724        default=None,
725        description="Freeform tag keys declared in the Solution body. An empty array when the body declares none.",
726    )
727    template_kind: str | None = Field(
728        default=None,
729        description='Wrapped template kind `"AgentTemplate"`, `"AutomationTemplate"`, `"AgentRoutineTemplate"`, `"AgentToolTemplate"`, `"AgentComputerTemplate"`, or `"SolutionTemplateRef"` for ref-mode bundles.',
730    )
731    templates: list[
732        UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolutionTemplatesItem
733    ] = Field(
734        ...,
735        description="Template configs bundled by this Solution, in declaration order the first entry is the deployable template the Solution wraps; the rest are sibling templates the wrapped template references.",
736    )
737    updated_at: datetime | None = Field(
738        default=None, description="When the Solution config was last modified (ISO 8601)."
739    )
740    upgrade_available: bool = Field(
741        ...,
742        description="`true` when this Solution is installed at the viewer's org scope and the app-level system scope carries a higher `solution_version`. Always `false` for system-only rows.",
743    )
744    virtual_path: str | None = Field(
745        default=None,
746        description="The stable virtual path assigned to this Solution config, used as the deduplication key when the same Solution appears under multiple owner scopes. `null` when unset.",
747    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
category_keys: list[str] | None = None

Category tag keys declared in the Solution body, used to group Solutions in the catalog. An empty array when the body declares none.

created_at: datetime.datetime | None = None

When the Solution config was first imported (ISO 8601).

description: str | None = None

Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. null when the Solution body does not set one.

id: str = PydanticUndefined

Solution config ID (cfg_...).

kind: str = PydanticUndefined

Resource type. Always "Solution".

latest_solution: str | None = None

When upgrade_available is true, the system-scope Solution config ID (cfg_...) that should be used as the upgrade source. null otherwise.

latest_version: str | None = None

When upgrade_available is true, the higher system-scope solution_version available to upgrade to. null otherwise.

lookup_key: str | None = None

The lookup key stored on the Solution config, if one was assigned during import. null when no lookup key was set.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none.

name: str | None = None

Human-facing display name declared in the Solution body. null when the Solution body does not set one.

org: str | None = None

Organization ID (org_...) that owns this Solution config, when the Solution is scoped to a specific org. null for system-scope (app-level) Solutions.

org_name: str | None = None

Display name of the resolved org. Pairs with org_slug as the principal catalog category's label. null when org_slug is null.

org_slug: str | None = None

Resolved slug of the Solution body's org (the publishing organization), when set and it resolves to a real org visible to the viewer. When present this is the Solution's principal catalog category key clients group the Solution under this org ahead of category_keys. null when the body has no org or it doesn't resolve.

owners: list[str] = PydanticUndefined

Owner scopes this Solution appears under. Members: "system" (app-level system scope) and/or "org" (viewer's org scope).

readme_url: str | None = None

Relative path to the public README endpoint with a signed token already embedded. null when the Solution has no README. Token expires in 1 hour refresh via GET /api/v1/solutions/:solution.

solution_id: str | None = None

Stable UUID declared in the Solution body, used to identify the same logical Solution across multiple installed copies and owner scopes. null when the body omits it.

solution_version: str | None = None

Semver string declared in the Solution body (e.g. "1.2.0"). null when the body does not declare a version.

tag_keys: list[str] | None = None

Freeform tag keys declared in the Solution body. An empty array when the body declares none.

template_kind: str | None = None

Wrapped template kind "AgentTemplate", "AutomationTemplate", "AgentRoutineTemplate", "AgentToolTemplate", "AgentComputerTemplate", or "SolutionTemplateRef" for ref-mode bundles.

Template configs bundled by this Solution, in declaration order the first entry is the deployable template the Solution wraps; the rest are sibling templates the wrapped template references.

updated_at: datetime.datetime | None = None

When the Solution config was last modified (ISO 8601).

upgrade_available: bool = PydanticUndefined

true when this Solution is installed at the viewer's org scope and the app-level system scope carries a higher solution_version. Always false for system-only rows.

virtual_path: str | None = None

The stable virtual path assigned to this Solution config, used as the deduplication key when the same Solution appears under multiple owner scopes. null when unset.

class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionTemplate(pydantic.main.BaseModel):
750class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionTemplate(BaseModel):
751    created_at: datetime | None = Field(
752        default=None, description="When this template config was created (ISO 8601)."
753    )
754    description: str | None = Field(
755        default=None,
756        description="Description of the template from the config body. `null` if the current version has no `description` field.",
757    )
758    display_name: str | None = Field(
759        default=None,
760        description="Human-readable display name from the config body. `null` if the current version has no `display_name` field.",
761    )
762    id: str = Field(..., description="Template config ID (`cfg_...`).")
763    kind: str = Field(
764        ..., description='Config kind identifier for this template (e.g. `"agent_tool_template"`).'
765    )
766    lookup_key: str | None = Field(
767        default=None,
768        description="Stable lookup key assigned to this template config. `null` if no lookup key is set.",
769    )
770    name: str | None = Field(
771        default=None,
772        description="Template name as stored in the config body. `null` if the current version has no `name` field.",
773    )
774    updated_at: datetime | None = Field(
775        default=None, description="When this template config was last modified (ISO 8601)."
776    )
777    virtual_path: str | None = Field(
778        default=None,
779        description="Virtual filesystem path for this template config. `null` if not set.",
780    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
created_at: datetime.datetime | None = None

When this template config was created (ISO 8601).

description: str | None = None

Description of the template from the config body. null if the current version has no description field.

display_name: str | None = None

Human-readable display name from the config body. null if the current version has no display_name field.

id: str = PydanticUndefined

Template config ID (cfg_...).

kind: str = PydanticUndefined

Config kind identifier for this template (e.g. "agent_tool_template").

lookup_key: str | None = None

Stable lookup key assigned to this template config. null if no lookup key is set.

name: str | None = None

Template name as stored in the config body. null if the current version has no name field.

updated_at: datetime.datetime | None = None

When this template config was last modified (ISO 8601).

virtual_path: str | None = None

Virtual filesystem path for this template config. null if not set.

class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolution(pydantic.main.BaseModel):
783class UserThreadListResponseDataItemParticipatingAgentsItemSourceSolution(BaseModel):
784    solution: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionSolution = Field(
785        ...,
786        description="Summary of the parent Solution, including `upgrade_available`, `latest_version`, and `latest_solution` when a newer system-scoped version is available for the agent's org-scoped Solution.",
787    )
788    template: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolutionTemplate = Field(
789        ...,
790        description="Summary of the AgentTemplate config (`cfg_...`) the agent was last provisioned or updated from.",
791    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Summary of the parent Solution, including upgrade_available, latest_version, and latest_solution when a newer system-scoped version is available for the agent's org-scoped Solution.

Summary of the AgentTemplate config (cfg_...) the agent was last provisioned or updated from.

class UserThreadListResponseDataItemParticipatingAgentsItem(pydantic.main.BaseModel):
794class UserThreadListResponseDataItemParticipatingAgentsItem(BaseModel):
795    acl: UserThreadListResponseDataItemParticipatingAgentsItemAcl | None = Field(
796        default=None,
797        description="Access control list for the agent. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions`. `null` when no ACL restrictions are applied and the agent is accessible to all members of its scope.",
798    )
799    app: str | None = Field(
800        default=None, description="ID of the application that owns this agent (`dap_...`)."
801    )
802    created_at: datetime | None = Field(
803        default=None, description="When the agent was created (ISO 8601)."
804    )
805    default_model: str | None = Field(
806        default=None,
807        description='Default LLM model identifier used by this agent when no model is specified at runtime (e.g. `"claude-3-7-sonnet-latest"`).',
808    )
809    email: str | None = Field(
810        default=None,
811        description="Email address provisioned for this agent. `null` if email delivery is not configured.",
812    )
813    id: str = Field(..., description="Agent ID (`agi_...`).")
814    identity: str | None = Field(
815        default=None,
816        description="System-level identity prompt that shapes the agent's persona and behavior.",
817    )
818    last_applied_template_config: str | None = Field(
819        default=None,
820        description="ID of the AgentTemplate config (`cfg_...`) this agent was last provisioned or updated from. `null` for manually created agents.",
821    )
822    lookup_key: str | None = Field(
823        default=None,
824        description="Stable, user-defined identifier for this agent within the application. Unique per app.",
825    )
826    metadata: dict[str, Any] | None = Field(
827        default=None,
828        description="Arbitrary key-value metadata attached to the agent. Not interpreted by the platform.",
829    )
830    name: str | None = Field(
831        default=None, description="Human-readable display name for the agent. `null` if not set."
832    )
833    org: str | None = Field(
834        default=None,
835        description="ID of the organization this agent belongs to (`org_...`). `null` if the agent is not org-scoped.",
836    )
837    org_name: str | None = Field(
838        default=None,
839        description="Display name of the organization this agent belongs to. `null` when the agent is not org-scoped or when the org association was not preloaded.",
840    )
841    originator: str | None = Field(
842        default=None,
843        description="Free-form label identifying the source or author that created this agent (e.g. a username or pipeline name).",
844    )
845    phone_number: str | None = Field(
846        default=None,
847        description="Phone number provisioned for this agent. `null` if SMS is not configured.",
848    )
849    sandbox: str | None = Field(
850        default=None,
851        description="ID of the sandbox environment this agent is scoped to (`dsb_...`). `null` in production deployments.",
852    )
853    source_solution: UserThreadListResponseDataItemParticipatingAgentsItemSourceSolution | None = (
854        Field(
855            default=None,
856            description="Source Solution and AgentTemplate summary for agents provisioned from a Solution. Includes `upgrade_available`, `latest_version`, and `latest_solution` so you can render an upgrade badge without a separate dry-run call. `null` for hand-built agents and agents whose tracked template or parent Solution has been deleted. Populated only on single-agent GET responses, never on list endpoints.",
857        )
858    )
859    team: str | None = Field(
860        default=None,
861        description="ID of the team that owns this agent (`tem_...`). `null` if the agent is not team-scoped.",
862    )
863    template_upgrade_available: bool | None = Field(
864        default=None,
865        description="True when the agent's last-applied template version is behind the current version of its AgentTemplate config i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed only on list endpoints; `null` on single-agent GET.",
866    )
867    updated_at: datetime | None = Field(
868        default=None, description="When the agent was last modified (ISO 8601)."
869    )
870    user: str | None = Field(
871        default=None,
872        description="ID of the user that owns this agent (`usr_...`). `null` if the agent is not user-scoped.",
873    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Access control list for the agent. Contains a grants array where each entry specifies principal_type, principal, and actions. null when no ACL restrictions are applied and the agent is accessible to all members of its scope.

app: str | None = None

ID of the application that owns this agent (dap_...).

created_at: datetime.datetime | None = None

When the agent was created (ISO 8601).

default_model: str | None = None

Default LLM model identifier used by this agent when no model is specified at runtime (e.g. "claude-3-7-sonnet-latest").

email: str | None = None

Email address provisioned for this agent. null if email delivery is not configured.

id: str = PydanticUndefined

Agent ID (agi_...).

identity: str | None = None

System-level identity prompt that shapes the agent's persona and behavior.

last_applied_template_config: str | None = None

ID of the AgentTemplate config (cfg_...) this agent was last provisioned or updated from. null for manually created agents.

lookup_key: str | None = None

Stable, user-defined identifier for this agent within the application. Unique per app.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata attached to the agent. Not interpreted by the platform.

name: str | None = None

Human-readable display name for the agent. null if not set.

org: str | None = None

ID of the organization this agent belongs to (org_...). null if the agent is not org-scoped.

org_name: str | None = None

Display name of the organization this agent belongs to. null when the agent is not org-scoped or when the org association was not preloaded.

originator: str | None = None

Free-form label identifying the source or author that created this agent (e.g. a username or pipeline name).

phone_number: str | None = None

Phone number provisioned for this agent. null if SMS is not configured.

sandbox: str | None = None

ID of the sandbox environment this agent is scoped to (dsb_...). null in production deployments.

Source Solution and AgentTemplate summary for agents provisioned from a Solution. Includes upgrade_available, latest_version, and latest_solution so you can render an upgrade badge without a separate dry-run call. null for hand-built agents and agents whose tracked template or parent Solution has been deleted. Populated only on single-agent GET responses, never on list endpoints.

team: str | None = None

ID of the team that owns this agent (tem_...). null if the agent is not team-scoped.

template_upgrade_available: bool | None = None

True when the agent's last-applied template version is behind the current version of its AgentTemplate config i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed only on list endpoints; null on single-agent GET.

updated_at: datetime.datetime | None = None

When the agent was last modified (ISO 8601).

user: str | None = None

ID of the user that owns this agent (usr_...). null if the agent is not user-scoped.

class UserThreadListResponseDataItemSettings(pydantic.main.BaseModel):
876class UserThreadListResponseDataItemSettings(BaseModel):
877    agent_enabled: bool | None = Field(
878        default=None,
879        description="Whether the AI agent is active for this thread. `true` enables AI responses; `false` disables them. Defaults to `true` when settings have not been explicitly configured.",
880    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
agent_enabled: bool | None = None

Whether the AI agent is active for this thread. true enables AI responses; false disables them. Defaults to true when settings have not been explicitly configured.

class UserThreadListResponseDataItem(pydantic.main.BaseModel):
 883class UserThreadListResponseDataItem(BaseModel):
 884    agent_user: str | None = Field(
 885        default=None,
 886        description="ID of the agent that owns this thread (`agt_...`). `null` for user-owned or team-owned threads.",
 887    )
 888    created_at: datetime | None = Field(
 889        default=None, description="When the thread was created (ISO 8601)."
 890    )
 891    creator: UserThreadListResponseDataItemCreator | None = Field(
 892        default=None,
 893        description="Expanded user object for the user who created this thread. Populated only when the association is loaded.",
 894    )
 895    description: str | None = Field(
 896        default=None,
 897        description="Optional description or purpose statement for the thread. `null` if not set.",
 898    )
 899    id: str = Field(..., description="Thread ID (`thr_...`).")
 900    is_channel: bool | None = Field(
 901        default=None,
 902        description="Whether this thread operates as a channel a multi-member broadcast-style conversation.",
 903    )
 904    is_default: bool | None = Field(
 905        default=None,
 906        description="Whether this is the default thread for its owner. Each user or team has at most one default thread.",
 907    )
 908    is_transient: bool | None = Field(
 909        default=None,
 910        description="Whether this thread is ephemeral and may be deleted automatically after a period of inactivity or when its TTL expires.",
 911    )
 912    is_unlisted: bool | None = Field(
 913        default=None,
 914        description="Whether this thread is hidden from public discovery. Unlisted threads are accessible only to direct participants.",
 915    )
 916    key: str | None = Field(
 917        default=None,
 918        description="Application-defined stable key that uniquely identifies the thread within its scope. Useful for idempotent creation. `null` if not set.",
 919    )
 920    last_activity: datetime | None = Field(
 921        default=None,
 922        description="When the last message or activity occurred in this thread. Present only when activity enrichment is requested.",
 923    )
 924    metadata: dict[str, Any] | None = Field(
 925        default=None,
 926        description="Arbitrary key-value metadata attached to the thread. Shape is application-defined; `null` if no metadata has been set.",
 927    )
 928    muted: bool | None = Field(
 929        default=None,
 930        description="Whether the authenticated user has muted notifications for this thread. `true` suppresses all notification delivery.",
 931    )
 932    org: str | None = Field(
 933        default=None,
 934        description="ID of the organization this thread belongs to (`org_...`). `null` for threads outside an org context.",
 935    )
 936    parent_message: UserThreadListResponseDataItemParentMessage | None = Field(
 937        default=None,
 938        description="The message that spawned this thread as a sub-thread. `null` for top-level threads.",
 939    )
 940    participant: list[str] | None = Field(
 941        default=None,
 942        description="Array of participant user IDs (`usr_...`) who are members of this thread.",
 943    )
 944    participants: list[UserThreadListResponseDataItemParticipantsItem] | None = Field(
 945        default=None,
 946        description="Expanded participant user objects for each member of this thread. Populated only when the association is loaded.",
 947    )
 948    participating_actor: list[str] | None = Field(
 949        default=None,
 950        description="Composite actor identifiers for all participants currently active in this thread. Present only when actor enrichment is requested.",
 951    )
 952    participating_agents: list[UserThreadListResponseDataItemParticipatingAgentsItem] | None = (
 953        Field(
 954            default=None,
 955            description="Expanded agent objects for all agents participating in this thread. Present only when agent enrichment is requested.",
 956        )
 957    )
 958    role: str | None = Field(
 959        default=None,
 960        description='The authenticated user\'s membership role in this thread, e.g. `"owner"`, `"member"`, or `"viewer"`. `null` if the user is not a member.',
 961    )
 962    sandbox: str | None = Field(
 963        default=None,
 964        description="ID of the developer sandbox this thread is scoped to (`sbx_...`). `null` for production threads.",
 965    )
 966    settings: UserThreadListResponseDataItemSettings | None = Field(
 967        default=None,
 968        description="Per-thread configuration settings controlling AI agent behavior for this thread.",
 969    )
 970    slug: str | None = Field(
 971        default=None,
 972        description="URL-safe slug for the thread, used in human-readable permalinks. `null` if not assigned.",
 973    )
 974    sub_threads: list[dict[str, Any]] | None = Field(
 975        default=None,
 976        description="Threads that are nested under this thread as replies to a parent message. Present only when sub-thread enrichment is requested.",
 977    )
 978    team: str | None = Field(
 979        default=None,
 980        description="ID of the team that owns this thread (`team_...`). `null` for user-owned or agent-owned threads.",
 981    )
 982    title: str | None = Field(
 983        default=None,
 984        description="Human-readable name of the thread. `null` if no title has been set.",
 985    )
 986    ttl: int | None = Field(
 987        default=None,
 988        description="Time-to-live in seconds after which the thread may be automatically cleaned up. `null` if the thread does not expire.",
 989    )
 990    unread_count: int | None = Field(
 991        default=None,
 992        description="Number of messages in this thread that the authenticated user has not yet read. Present only when read-state enrichment is requested.",
 993    )
 994    updated_at: datetime | None = Field(
 995        default=None, description="When the thread was last modified (ISO 8601)."
 996    )
 997    user: str | None = Field(
 998        default=None,
 999        description="ID of the user who owns this thread (`usr_...`). `null` for team-owned or agent-owned threads.",
1000    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
agent_user: str | None = None

ID of the agent that owns this thread (agt_...). null for user-owned or team-owned threads.

created_at: datetime.datetime | None = None

When the thread was created (ISO 8601).

creator: UserThreadListResponseDataItemCreator | None = None

Expanded user object for the user who created this thread. Populated only when the association is loaded.

description: str | None = None

Optional description or purpose statement for the thread. null if not set.

id: str = PydanticUndefined

Thread ID (thr_...).

is_channel: bool | None = None

Whether this thread operates as a channel a multi-member broadcast-style conversation.

is_default: bool | None = None

Whether this is the default thread for its owner. Each user or team has at most one default thread.

is_transient: bool | None = None

Whether this thread is ephemeral and may be deleted automatically after a period of inactivity or when its TTL expires.

is_unlisted: bool | None = None

Whether this thread is hidden from public discovery. Unlisted threads are accessible only to direct participants.

key: str | None = None

Application-defined stable key that uniquely identifies the thread within its scope. Useful for idempotent creation. null if not set.

last_activity: datetime.datetime | None = None

When the last message or activity occurred in this thread. Present only when activity enrichment is requested.

metadata: dict[str, typing.Any] | None = None

Arbitrary key-value metadata attached to the thread. Shape is application-defined; null if no metadata has been set.

muted: bool | None = None

Whether the authenticated user has muted notifications for this thread. true suppresses all notification delivery.

org: str | None = None

ID of the organization this thread belongs to (org_...). null for threads outside an org context.

parent_message: UserThreadListResponseDataItemParentMessage | None = None

The message that spawned this thread as a sub-thread. null for top-level threads.

participant: list[str] | None = None

Array of participant user IDs (usr_...) who are members of this thread.

participants: list[UserThreadListResponseDataItemParticipantsItem] | None = None

Expanded participant user objects for each member of this thread. Populated only when the association is loaded.

participating_actor: list[str] | None = None

Composite actor identifiers for all participants currently active in this thread. Present only when actor enrichment is requested.

participating_agents: list[UserThreadListResponseDataItemParticipatingAgentsItem] | None = None

Expanded agent objects for all agents participating in this thread. Present only when agent enrichment is requested.

role: str | None = None

The authenticated user's membership role in this thread, e.g. "owner", "member", or "viewer". null if the user is not a member.

sandbox: str | None = None

ID of the developer sandbox this thread is scoped to (sbx_...). null for production threads.

settings: UserThreadListResponseDataItemSettings | None = None

Per-thread configuration settings controlling AI agent behavior for this thread.

slug: str | None = None

URL-safe slug for the thread, used in human-readable permalinks. null if not assigned.

sub_threads: list[dict[str, typing.Any]] | None = None

Threads that are nested under this thread as replies to a parent message. Present only when sub-thread enrichment is requested.

team: str | None = None

ID of the team that owns this thread (team_...). null for user-owned or agent-owned threads.

title: str | None = None

Human-readable name of the thread. null if no title has been set.

ttl: int | None = None

Time-to-live in seconds after which the thread may be automatically cleaned up. null if the thread does not expire.

unread_count: int | None = None

Number of messages in this thread that the authenticated user has not yet read. Present only when read-state enrichment is requested.

updated_at: datetime.datetime | None = None

When the thread was last modified (ISO 8601).

user: str | None = None

ID of the user who owns this thread (usr_...). null for team-owned or agent-owned threads.

class UserThreadListResponse(pydantic.main.BaseModel):
1003class UserThreadListResponse(BaseModel):
1004    """
1005    Successful response
1006    """
1007
1008    data: list[UserThreadListResponseDataItem] = Field(
1009        ...,
1010        description="Array of thread objects matching the requested filters and agent narrowings.",
1011    )

Successful response

data: list[UserThreadListResponseDataItem] = PydanticUndefined

Array of thread objects matching the requested filters and agent narrowings.

class UserArtifactsResponseDataItemImageSource(pydantic.main.BaseModel):
1014class UserArtifactsResponseDataItemImageSource(BaseModel):
1015    file: str | None = Field(
1016        default=None,
1017        description="ID of the underlying storage file (`fil_...`). `null` when the image is not backed by a platform storage file.",
1018    )
1019    height: int | None = Field(
1020        default=None, description="Height of the image in pixels. `null` if not known."
1021    )
1022    media: str | None = Field(
1023        default=None,
1024        description="ID of the associated media record (`med_...`). `null` when the image is not linked to a media entity.",
1025    )
1026    mime_type: str | None = Field(
1027        default=None,
1028        description='MIME type of the image, e.g. `"image/png"` or `"image/jpeg"`. `null` if not known.',
1029    )
1030    refresh_url: str | None = Field(
1031        default=None,
1032        description="Endpoint URL you can call to obtain a fresh signed `url` when the current one has expired. `null` if the URL does not require refreshing.",
1033    )
1034    url: str | None = Field(
1035        default=None,
1036        description="Signed or public URL for downloading the image. May be time-limited; use `refresh_url` to obtain a new URL when this one expires.",
1037    )
1038    width: int | None = Field(
1039        default=None, description="Width of the image in pixels. `null` if not known."
1040    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
file: str | None = None

ID of the underlying storage file (fil_...). null when the image is not backed by a platform storage file.

height: int | None = None

Height of the image in pixels. null if not known.

media: str | None = None

ID of the associated media record (med_...). null when the image is not linked to a media entity.

mime_type: str | None = None

MIME type of the image, e.g. "image/png" or "image/jpeg". null if not known.

refresh_url: str | None = None

Endpoint URL you can call to obtain a fresh signed url when the current one has expired. null if the URL does not require refreshing.

url: str | None = None

Signed or public URL for downloading the image. May be time-limited; use refresh_url to obtain a new URL when this one expires.

width: int | None = None

Width of the image in pixels. null if not known.

class UserArtifactsResponseDataItem(pydantic.main.BaseModel):
1043class UserArtifactsResponseDataItem(BaseModel):
1044    agent: str | None = Field(
1045        default=None,
1046        description="ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced.",
1047    )
1048    content_type: str | None = Field(
1049        default=None,
1050        description='MIME type of the current version\'s file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached.',
1051    )
1052    created_at: datetime | None = Field(
1053        default=None, description="When the artifact was first created (ISO 8601)."
1054    )
1055    current_version: str | None = Field(
1056        default=None,
1057        description="ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published.",
1058    )
1059    description: str | None = Field(
1060        default=None,
1061        description="Optional longer description of the artifact's contents or purpose. `null` if not set.",
1062    )
1063    file: str | None = Field(
1064        default=None,
1065        description="Storage file ID for the current version (`fil_...`). `null` if no file is attached.",
1066    )
1067    file_name: str | None = Field(
1068        default=None,
1069        description='Original filename of the current version\'s file, e.g. `"output.csv"`. `null` if no file is attached.',
1070    )
1071    file_url: str | None = Field(
1072        default=None,
1073        description="Short-lived signed URL for downloading the current version's file. `null` if no file is attached.",
1074    )
1075    id: str = Field(..., description="Artifact ID (`art_...`).")
1076    image_source: UserArtifactsResponseDataItemImageSource | None = Field(
1077        default=None,
1078        description='Image source metadata for rendering the current version\'s file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise.',
1079    )
1080    name: str | None = Field(
1081        default=None,
1082        description='Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set.',
1083    )
1084    org: str | None = Field(
1085        default=None, description="ID of the organization this artifact belongs to (`org_...`)."
1086    )
1087    sandbox: str | None = Field(
1088        default=None,
1089        description="Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped.",
1090    )
1091    team: str | None = Field(
1092        default=None,
1093        description="ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped.",
1094    )
1095    thread: str | None = Field(
1096        default=None,
1097        description="ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped.",
1098    )
1099    updated_at: datetime | None = Field(
1100        default=None, description="When the artifact record was last modified (ISO 8601)."
1101    )
1102    user: str | None = Field(
1103        default=None,
1104        description="ID of the user who created this artifact (`usr_...`). `null` if not user-scoped.",
1105    )
1106    version: int | None = Field(
1107        default=None,
1108        description="Current version number of the artifact. Increments each time a new version is published.",
1109    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
agent: str | None = None

ID of the agent that produced this artifact (agt_...). null if not agent-produced.

content_type: str | None = None

MIME type of the current version's file, e.g. "text/csv" or "image/png". null if no file is attached.

created_at: datetime.datetime | None = None

When the artifact was first created (ISO 8601).

current_version: str | None = None

ID of the current (latest published) artifact version (artv_...). null if no version has been published.

description: str | None = None

Optional longer description of the artifact's contents or purpose. null if not set.

file: str | None = None

Storage file ID for the current version (fil_...). null if no file is attached.

file_name: str | None = None

Original filename of the current version's file, e.g. "output.csv". null if no file is attached.

file_url: str | None = None

Short-lived signed URL for downloading the current version's file. null if no file is attached.

id: str = PydanticUndefined

Artifact ID (art_...).

image_source: UserArtifactsResponseDataItemImageSource | None = None

Image source metadata for rendering the current version's file inline. Present only when content_type starts with "image/". null otherwise.

name: str | None = None

Human-readable name for the artifact, e.g. "Q2 Report". null if not set.

org: str | None = None

ID of the organization this artifact belongs to (org_...).

sandbox: str | None = None

Identifier of the sandbox environment associated with this artifact. null if not sandbox-scoped.

team: str | None = None

ID of the team that owns this artifact (tea_...). null if not team-scoped.

thread: str | None = None

ID of the thread in which this artifact was created (thr_...). null if not thread-scoped.

updated_at: datetime.datetime | None = None

When the artifact record was last modified (ISO 8601).

user: str | None = None

ID of the user who created this artifact (usr_...). null if not user-scoped.

version: int | None = None

Current version number of the artifact. Increments each time a new version is published.

class UserArtifactsResponse(pydantic.main.BaseModel):
1112class UserArtifactsResponse(BaseModel):
1113    """
1114    Successful response
1115    """
1116
1117    data: list[UserArtifactsResponseDataItem] = Field(
1118        ..., description="Array of artifact objects belonging to the user."
1119    )

Successful response

data: list[UserArtifactsResponseDataItem] = PydanticUndefined

Array of artifact objects belonging to the user.

class UserOrgsResponseDataItem(pydantic.main.BaseModel):
1122class UserOrgsResponseDataItem(BaseModel):
1123    created_at: datetime | None = Field(
1124        default=None, description="When this organization was created (ISO 8601)."
1125    )
1126    description: str | None = Field(
1127        default=None,
1128        description="Short human-readable description of the organization. `null` if not set.",
1129    )
1130    domain: str | None = Field(
1131        default=None,
1132        description='Primary domain associated with the organization, e.g. `"acme.com"`. `null` if not configured.',
1133    )
1134    id: str = Field(..., description="Organization ID (`org_...`).")
1135    industry: str | None = Field(
1136        default=None,
1137        description='Industry category the organization belongs to, e.g. `"fintech"` or `"healthcare"`. `null` if not set.',
1138    )
1139    name: str | None = Field(
1140        default=None,
1141        description="Display name of the organization. `null` if the org has not set a name.",
1142    )
1143    onboarding_track: str | None = Field(
1144        default=None,
1145        description='The new-user experience track this org first completed. `"vendor"` for orgs that onboarded as service providers; `"customer"` for orgs that onboarded as buyers. `null` if onboarding was not tracked.',
1146    )
1147    sandbox: str | None = Field(
1148        default=None,
1149        description="ID of the sandbox environment scoped to this organization (`snd_...`). `null` for organizations in production mode.",
1150    )
1151    slug: str | None = Field(
1152        default=None,
1153        description="URL-safe identifier for the organization, used in vanity URLs and slug-based lookups.",
1154    )
1155    status: str | None = Field(
1156        default=None,
1157        description='Current lifecycle status of the organization, e.g. `"active"` or `"suspended"`. `null` if the status has not been set.',
1158    )
1159    updated_at: datetime | None = Field(
1160        default=None, description="When this organization was last modified (ISO 8601)."
1161    )
1162    website: str | None = Field(
1163        default=None, description="Public website URL for the organization. `null` if not set."
1164    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
created_at: datetime.datetime | None = None

When this organization was created (ISO 8601).

description: str | None = None

Short human-readable description of the organization. null if not set.

domain: str | None = None

Primary domain associated with the organization, e.g. "acme.com". null if not configured.

id: str = PydanticUndefined

Organization ID (org_...).

industry: str | None = None

Industry category the organization belongs to, e.g. "fintech" or "healthcare". null if not set.

name: str | None = None

Display name of the organization. null if the org has not set a name.

onboarding_track: str | None = None

The new-user experience track this org first completed. "vendor" for orgs that onboarded as service providers; "customer" for orgs that onboarded as buyers. null if onboarding was not tracked.

sandbox: str | None = None

ID of the sandbox environment scoped to this organization (snd_...). null for organizations in production mode.

slug: str | None = None

URL-safe identifier for the organization, used in vanity URLs and slug-based lookups.

status: str | None = None

Current lifecycle status of the organization, e.g. "active" or "suspended". null if the status has not been set.

updated_at: datetime.datetime | None = None

When this organization was last modified (ISO 8601).

website: str | None = None

Public website URL for the organization. null if not set.

class UserOrgsResponse(pydantic.main.BaseModel):
1167class UserOrgsResponse(BaseModel):
1168    """
1169    Successful response
1170    """
1171
1172    data: list[UserOrgsResponseDataItem] = Field(
1173        ...,
1174        description="Array of organization objects the user belongs to. Contains at most one item.",
1175    )

Successful response

data: list[UserOrgsResponseDataItem] = PydanticUndefined

Array of organization objects the user belongs to. Contains at most one item.

class AsyncUserThreadResource:
1178class AsyncUserThreadResource:
1179    def __init__(self, http: HttpClient):
1180        self._http = http
1181
1182    async def list(
1183        self,
1184        user: str,
1185        *,
1186        agent: builtins.list[str] | None = None,
1187        filter: builtins.list[dict[str, Any]] | None = None,
1188    ) -> UserThreadListResponse:
1189        """
1190        List threads for a user
1191        Returns all threads visible to the specified user. The authenticated caller must
1192        have access to the target user's account; a 403 is returned otherwise.
1193        Pass one or more `agent` IDs to narrow results to threads where at least one of
1194        the listed agents is also a member useful for displaying every thread a user
1195        shares with a particular agent. Pass one or more `filter` objects to narrow
1196        results by thread metadata key/value pairs. Both narrowings may be combined in
1197        a single request.
1198        Results are returned as a flat array; no cursor-based pagination is applied.
1199
1200        Args:
1201            user: User ID (`usr_...`) whose threads should be listed.
1202            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1203            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1204
1205        Returns:
1206            Successful response
1207        """
1208        query: dict[str, object] = {}
1209        if agent is not None:
1210            query["agent"] = agent
1211        if filter is not None:
1212            query["filter"] = filter
1213        return await self._http.request(
1214            f"/api/v1/users/{user}/threads",
1215            query=query,
1216            response_type=UserThreadListResponse,
1217        )
1218
1219    async def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1220        """
1221        Create a thread for a user
1222        Creates a new thread owned by the specified user. The authenticated caller must
1223        have access to the target user's account; a 403 is returned otherwise.
1224        An automatic welcome message is sent into the thread upon creation unless
1225        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1226        the owning user and any members added at creation time.
1227
1228        Args:
1229            user: User ID (`usr_...`) whose threads should be listed.
1230            input: Request body.
1231            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1232            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1233
1234        Returns:
1235            The newly created thread object.
1236        """
1237        return await self._http.request(
1238            f"/api/v1/users/{user}/threads",
1239            method="POST",
1240            body=input,
1241            response_type=Thread,
1242        )
AsyncUserThreadResource(http: archastro.platform.runtime.http_client.HttpClient)
1179    def __init__(self, http: HttpClient):
1180        self._http = http
async def list( self, user: str, *, agent: list[str] | None = None, filter: list[dict[str, typing.Any]] | None = None) -> UserThreadListResponse:
1182    async def list(
1183        self,
1184        user: str,
1185        *,
1186        agent: builtins.list[str] | None = None,
1187        filter: builtins.list[dict[str, Any]] | None = None,
1188    ) -> UserThreadListResponse:
1189        """
1190        List threads for a user
1191        Returns all threads visible to the specified user. The authenticated caller must
1192        have access to the target user's account; a 403 is returned otherwise.
1193        Pass one or more `agent` IDs to narrow results to threads where at least one of
1194        the listed agents is also a member useful for displaying every thread a user
1195        shares with a particular agent. Pass one or more `filter` objects to narrow
1196        results by thread metadata key/value pairs. Both narrowings may be combined in
1197        a single request.
1198        Results are returned as a flat array; no cursor-based pagination is applied.
1199
1200        Args:
1201            user: User ID (`usr_...`) whose threads should be listed.
1202            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1203            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1204
1205        Returns:
1206            Successful response
1207        """
1208        query: dict[str, object] = {}
1209        if agent is not None:
1210            query["agent"] = agent
1211        if filter is not None:
1212            query["filter"] = filter
1213        return await self._http.request(
1214            f"/api/v1/users/{user}/threads",
1215            query=query,
1216            response_type=UserThreadListResponse,
1217        )

List threads for a user Returns all threads visible to the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. Pass one or more agent IDs to narrow results to threads where at least one of the listed agents is also a member useful for displaying every thread a user shares with a particular agent. Pass one or more filter objects to narrow results by thread metadata key/value pairs. Both narrowings may be combined in a single request. Results are returned as a flat array; no cursor-based pagination is applied.

Arguments:
  • user: User ID (usr_...) whose threads should be listed.
  • agent: Array of agent user IDs (usr_...). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
  • filter: Array of metadata filter objects. Each filter matches threads whose metadata map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
Returns:

Successful response

async def create( self, user: str, input: UserThreadCreateInput) -> archastro.platform.types.threads.Thread:
1219    async def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1220        """
1221        Create a thread for a user
1222        Creates a new thread owned by the specified user. The authenticated caller must
1223        have access to the target user's account; a 403 is returned otherwise.
1224        An automatic welcome message is sent into the thread upon creation unless
1225        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1226        the owning user and any members added at creation time.
1227
1228        Args:
1229            user: User ID (`usr_...`) whose threads should be listed.
1230            input: Request body.
1231            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1232            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1233
1234        Returns:
1235            The newly created thread object.
1236        """
1237        return await self._http.request(
1238            f"/api/v1/users/{user}/threads",
1239            method="POST",
1240            body=input,
1241            response_type=Thread,
1242        )

Create a thread for a user Creates a new thread owned by the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. An automatic welcome message is sent into the thread upon creation unless skip_welcome_message is set to true. The thread is immediately visible to the owning user and any members added at creation time.

Arguments:
  • user: User ID (usr_...) whose threads should be listed.
  • input: Request body.
  • input.skip_welcome_message: When true, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to false.
  • input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
Returns:

The newly created thread object.

class AsyncUserResource:
1245class AsyncUserResource:
1246    def __init__(self, http: HttpClient):
1247        self._http = http
1248        self.threads = AsyncUserThreadResource(http)
1249
1250    async def me(self) -> User:
1251        """
1252        Retrieve the current user
1253        Returns the user associated with the authenticated session or bearer
1254        token. This is the canonical way to resolve "who am I?" after
1255        authentication.
1256        The response includes the user's profile, notification settings, and
1257        profile picture, along with the app, organization, and sandbox the
1258        token is scoped to and their display names enough to establish full
1259        session context in a single call. Unauthenticated requests return 401.
1260
1261        Returns:
1262            The authenticated user object.
1263        """
1264        return await self._http.request("/api/v1/users/me", response_type=User)
1265
1266    async def get(self, user: str) -> User:
1267        """
1268        Retrieve a user by ID
1269        Returns the user identified by `user`. The authenticated user must share
1270        at least one team with the target user; requests for users outside any
1271        shared team are rejected with 403.
1272        A user may always retrieve their own profile with this endpoint. Use the
1273        `GET /users/me` endpoint as a convenience alias for retrieving the
1274        authenticated user without specifying an ID.
1275
1276        Args:
1277            user: User ID (`usr_...`) of the user to retrieve.
1278
1279        Returns:
1280            The requested user object.
1281        """
1282        return await self._http.request(f"/api/v1/users/{user}", response_type=User)
1283
1284    async def artifacts(self, user: str) -> UserArtifactsResponse:
1285        """
1286        List a user's artifacts
1287        Returns all artifacts owned by the specified user. Artifacts represent
1288        AI-generated or user-uploaded files associated with agent sessions,
1289        threads, or sandboxes such as images, documents, and code outputs.
1290        The authenticated user must be requesting their own artifacts or must
1291        have administrative access. Attempting to list artifacts for a user
1292        the caller is not authorized to access returns 403.
1293        Results are returned in a single page without cursor pagination. Each
1294        artifact in the response reflects the state of its current version,
1295        including a short-lived signed `file_url` for direct download.
1296
1297        Args:
1298            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1299
1300        Returns:
1301            Successful response
1302        """
1303        return await self._http.request(
1304            f"/api/v1/users/{user}/artifacts",
1305            response_type=UserArtifactsResponse,
1306        )
1307
1308    async def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1309        """
1310        Create a user invite
1311        Creates a new invite for the authenticated user. The invite can optionally be
1312        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1313        caller receives the new invite object at HTTP 201.
1314        The invite key is always generated server-side (192-bit URL-safe random
1315        string) and cannot be supplied by the caller.
1316        The path `:user` must match the authenticated user. If a `thread_id` is
1317        provided, the authenticated user must have permission to invite others to that
1318        thread; team threads are not supported and return an error. Supplying a
1319        `thread_id` that does not exist or that belongs to a different user returns
1320        an error. If a key collision occurs during creation the call returns a 409
1321        conflict simply retry to generate a new key.
1322
1323        Args:
1324            user: User ID (`usr_...`). Must match the authenticated user.
1325            input: Request body.
1326            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1327
1328        Returns:
1329            The newly created invite object.
1330        """
1331        return await self._http.request(
1332            f"/api/v1/users/{user}/invites",
1333            method="POST",
1334            body=input,
1335            response_type=UserInvite,
1336        )
1337
1338    async def orgs(self, user: str) -> UserOrgsResponse:
1339        """
1340        List organizations for a user
1341        Returns the organizations the specified user belongs to. A user can belong
1342        to at most one organization, so the `data` array contains either zero or one
1343        items.
1344        The authenticated viewer must have permission to inspect the target user.
1345        Returns an empty `data` array when the user has no organization membership.
1346
1347        Args:
1348            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1349
1350        Returns:
1351            Successful response
1352        """
1353        return await self._http.request(
1354            f"/api/v1/users/{user}/orgs",
1355            response_type=UserOrgsResponse,
1356        )
1357
1358    async def profile(self, user: str, input: UserProfileInput) -> User:
1359        """
1360        Update the current user's profile
1361        Updates one or more profile fields for the authenticated user. All
1362        fields are optional; omit any you do not want to change.
1363        When `profile_picture` is supplied, the image is uploaded and replaces
1364        the existing picture. The previous picture is deleted after the new one
1365        is stored. Image upload failures return 422 without modifying other
1366        profile fields.
1367
1368        Args:
1369            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1370            input: Request body.
1371            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1372            input.full_name: Updated display name for the user.
1373            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1374            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1375
1376        Returns:
1377            The user object with updated profile fields.
1378        """
1379        return await self._http.request(
1380            f"/api/v1/users/{user}/profile",
1381            method="PUT",
1382            body=input,
1383            response_type=User,
1384        )
AsyncUserResource(http: archastro.platform.runtime.http_client.HttpClient)
1246    def __init__(self, http: HttpClient):
1247        self._http = http
1248        self.threads = AsyncUserThreadResource(http)
threads
async def me(self) -> archastro.platform.types.users.User:
1250    async def me(self) -> User:
1251        """
1252        Retrieve the current user
1253        Returns the user associated with the authenticated session or bearer
1254        token. This is the canonical way to resolve "who am I?" after
1255        authentication.
1256        The response includes the user's profile, notification settings, and
1257        profile picture, along with the app, organization, and sandbox the
1258        token is scoped to and their display names enough to establish full
1259        session context in a single call. Unauthenticated requests return 401.
1260
1261        Returns:
1262            The authenticated user object.
1263        """
1264        return await self._http.request("/api/v1/users/me", response_type=User)

Retrieve the current user Returns the user associated with the authenticated session or bearer token. This is the canonical way to resolve "who am I?" after authentication. The response includes the user's profile, notification settings, and profile picture, along with the app, organization, and sandbox the token is scoped to and their display names enough to establish full session context in a single call. Unauthenticated requests return 401.

Returns:

The authenticated user object.

async def get(self, user: str) -> archastro.platform.types.users.User:
1266    async def get(self, user: str) -> User:
1267        """
1268        Retrieve a user by ID
1269        Returns the user identified by `user`. The authenticated user must share
1270        at least one team with the target user; requests for users outside any
1271        shared team are rejected with 403.
1272        A user may always retrieve their own profile with this endpoint. Use the
1273        `GET /users/me` endpoint as a convenience alias for retrieving the
1274        authenticated user without specifying an ID.
1275
1276        Args:
1277            user: User ID (`usr_...`) of the user to retrieve.
1278
1279        Returns:
1280            The requested user object.
1281        """
1282        return await self._http.request(f"/api/v1/users/{user}", response_type=User)

Retrieve a user by ID Returns the user identified by user. The authenticated user must share at least one team with the target user; requests for users outside any shared team are rejected with 403. A user may always retrieve their own profile with this endpoint. Use the GET /users/me endpoint as a convenience alias for retrieving the authenticated user without specifying an ID.

Arguments:
  • user: User ID (usr_...) of the user to retrieve.
Returns:

The requested user object.

async def artifacts( self, user: str) -> UserArtifactsResponse:
1284    async def artifacts(self, user: str) -> UserArtifactsResponse:
1285        """
1286        List a user's artifacts
1287        Returns all artifacts owned by the specified user. Artifacts represent
1288        AI-generated or user-uploaded files associated with agent sessions,
1289        threads, or sandboxes such as images, documents, and code outputs.
1290        The authenticated user must be requesting their own artifacts or must
1291        have administrative access. Attempting to list artifacts for a user
1292        the caller is not authorized to access returns 403.
1293        Results are returned in a single page without cursor pagination. Each
1294        artifact in the response reflects the state of its current version,
1295        including a short-lived signed `file_url` for direct download.
1296
1297        Args:
1298            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1299
1300        Returns:
1301            Successful response
1302        """
1303        return await self._http.request(
1304            f"/api/v1/users/{user}/artifacts",
1305            response_type=UserArtifactsResponse,
1306        )

List a user's artifacts Returns all artifacts owned by the specified user. Artifacts represent AI-generated or user-uploaded files associated with agent sessions, threads, or sandboxes such as images, documents, and code outputs. The authenticated user must be requesting their own artifacts or must have administrative access. Attempting to list artifacts for a user the caller is not authorized to access returns 403. Results are returned in a single page without cursor pagination. Each artifact in the response reflects the state of its current version, including a short-lived signed file_url for direct download.

Arguments:
  • user: User ID (usr_...). The authenticated user must be this user or have access to their artifacts.
Returns:

Successful response

async def invites( self, user: str, input: UserInvitesInput) -> archastro.platform.types.users.UserInvite:
1308    async def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1309        """
1310        Create a user invite
1311        Creates a new invite for the authenticated user. The invite can optionally be
1312        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1313        caller receives the new invite object at HTTP 201.
1314        The invite key is always generated server-side (192-bit URL-safe random
1315        string) and cannot be supplied by the caller.
1316        The path `:user` must match the authenticated user. If a `thread_id` is
1317        provided, the authenticated user must have permission to invite others to that
1318        thread; team threads are not supported and return an error. Supplying a
1319        `thread_id` that does not exist or that belongs to a different user returns
1320        an error. If a key collision occurs during creation the call returns a 409
1321        conflict simply retry to generate a new key.
1322
1323        Args:
1324            user: User ID (`usr_...`). Must match the authenticated user.
1325            input: Request body.
1326            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1327
1328        Returns:
1329            The newly created invite object.
1330        """
1331        return await self._http.request(
1332            f"/api/v1/users/{user}/invites",
1333            method="POST",
1334            body=input,
1335            response_type=UserInvite,
1336        )

Create a user invite Creates a new invite for the authenticated user. The invite can optionally be scoped to a specific thread, a persona, or carry arbitrary metadata. The caller receives the new invite object at HTTP 201. The invite key is always generated server-side (192-bit URL-safe random string) and cannot be supplied by the caller. The path :user must match the authenticated user. If a thread_id is provided, the authenticated user must have permission to invite others to that thread; team threads are not supported and return an error. Supplying a thread_id that does not exist or that belongs to a different user returns an error. If a key collision occurs during creation the call returns a 409 conflict simply retry to generate a new key.

Arguments:
  • user: User ID (usr_...). Must match the authenticated user.
  • input: Request body.
  • input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
Returns:

The newly created invite object.

async def orgs( self, user: str) -> UserOrgsResponse:
1338    async def orgs(self, user: str) -> UserOrgsResponse:
1339        """
1340        List organizations for a user
1341        Returns the organizations the specified user belongs to. A user can belong
1342        to at most one organization, so the `data` array contains either zero or one
1343        items.
1344        The authenticated viewer must have permission to inspect the target user.
1345        Returns an empty `data` array when the user has no organization membership.
1346
1347        Args:
1348            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1349
1350        Returns:
1351            Successful response
1352        """
1353        return await self._http.request(
1354            f"/api/v1/users/{user}/orgs",
1355            response_type=UserOrgsResponse,
1356        )

List organizations for a user Returns the organizations the specified user belongs to. A user can belong to at most one organization, so the data array contains either zero or one items. The authenticated viewer must have permission to inspect the target user. Returns an empty data array when the user has no organization membership.

Arguments:
  • user: User ID (usr_...) whose organization membership you want to retrieve.
Returns:

Successful response

async def profile( self, user: str, input: UserProfileInput) -> archastro.platform.types.users.User:
1358    async def profile(self, user: str, input: UserProfileInput) -> User:
1359        """
1360        Update the current user's profile
1361        Updates one or more profile fields for the authenticated user. All
1362        fields are optional; omit any you do not want to change.
1363        When `profile_picture` is supplied, the image is uploaded and replaces
1364        the existing picture. The previous picture is deleted after the new one
1365        is stored. Image upload failures return 422 without modifying other
1366        profile fields.
1367
1368        Args:
1369            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1370            input: Request body.
1371            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1372            input.full_name: Updated display name for the user.
1373            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1374            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1375
1376        Returns:
1377            The user object with updated profile fields.
1378        """
1379        return await self._http.request(
1380            f"/api/v1/users/{user}/profile",
1381            method="PUT",
1382            body=input,
1383            response_type=User,
1384        )

Update the current user's profile Updates one or more profile fields for the authenticated user. All fields are optional; omit any you do not want to change. When profile_picture is supplied, the image is uploaded and replaces the existing picture. The previous picture is deleted after the new one is stored. Image upload failures return 422 without modifying other profile fields.

Arguments:
  • user: User ID (usr_...) or "me" for the authenticated user.
  • input: Request body.
  • input.alias: Short display alias shown in place of the full name in compact UI contexts.
  • input.full_name: Updated display name for the user.
  • input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass null for a key to remove it.
  • input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
Returns:

The user object with updated profile fields.

class UserThreadResource:
1387class UserThreadResource:
1388    def __init__(self, http: SyncHttpClient):
1389        self._http = http
1390
1391    def list(
1392        self,
1393        user: str,
1394        *,
1395        agent: builtins.list[str] | None = None,
1396        filter: builtins.list[dict[str, Any]] | None = None,
1397    ) -> UserThreadListResponse:
1398        """
1399        List threads for a user
1400        Returns all threads visible to the specified user. The authenticated caller must
1401        have access to the target user's account; a 403 is returned otherwise.
1402        Pass one or more `agent` IDs to narrow results to threads where at least one of
1403        the listed agents is also a member useful for displaying every thread a user
1404        shares with a particular agent. Pass one or more `filter` objects to narrow
1405        results by thread metadata key/value pairs. Both narrowings may be combined in
1406        a single request.
1407        Results are returned as a flat array; no cursor-based pagination is applied.
1408
1409        Args:
1410            user: User ID (`usr_...`) whose threads should be listed.
1411            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1412            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1413
1414        Returns:
1415            Successful response
1416        """
1417        query: dict[str, object] = {}
1418        if agent is not None:
1419            query["agent"] = agent
1420        if filter is not None:
1421            query["filter"] = filter
1422        return self._http.request(
1423            f"/api/v1/users/{user}/threads",
1424            query=query,
1425            response_type=UserThreadListResponse,
1426        )
1427
1428    def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1429        """
1430        Create a thread for a user
1431        Creates a new thread owned by the specified user. The authenticated caller must
1432        have access to the target user's account; a 403 is returned otherwise.
1433        An automatic welcome message is sent into the thread upon creation unless
1434        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1435        the owning user and any members added at creation time.
1436
1437        Args:
1438            user: User ID (`usr_...`) whose threads should be listed.
1439            input: Request body.
1440            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1441            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1442
1443        Returns:
1444            The newly created thread object.
1445        """
1446        return self._http.request(
1447            f"/api/v1/users/{user}/threads",
1448            method="POST",
1449            body=input,
1450            response_type=Thread,
1451        )
UserThreadResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
1388    def __init__(self, http: SyncHttpClient):
1389        self._http = http
def list( self, user: str, *, agent: list[str] | None = None, filter: list[dict[str, typing.Any]] | None = None) -> UserThreadListResponse:
1391    def list(
1392        self,
1393        user: str,
1394        *,
1395        agent: builtins.list[str] | None = None,
1396        filter: builtins.list[dict[str, Any]] | None = None,
1397    ) -> UserThreadListResponse:
1398        """
1399        List threads for a user
1400        Returns all threads visible to the specified user. The authenticated caller must
1401        have access to the target user's account; a 403 is returned otherwise.
1402        Pass one or more `agent` IDs to narrow results to threads where at least one of
1403        the listed agents is also a member useful for displaying every thread a user
1404        shares with a particular agent. Pass one or more `filter` objects to narrow
1405        results by thread metadata key/value pairs. Both narrowings may be combined in
1406        a single request.
1407        Results are returned as a flat array; no cursor-based pagination is applied.
1408
1409        Args:
1410            user: User ID (`usr_...`) whose threads should be listed.
1411            agent: Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
1412            filter: Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
1413
1414        Returns:
1415            Successful response
1416        """
1417        query: dict[str, object] = {}
1418        if agent is not None:
1419            query["agent"] = agent
1420        if filter is not None:
1421            query["filter"] = filter
1422        return self._http.request(
1423            f"/api/v1/users/{user}/threads",
1424            query=query,
1425            response_type=UserThreadListResponse,
1426        )

List threads for a user Returns all threads visible to the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. Pass one or more agent IDs to narrow results to threads where at least one of the listed agents is also a member useful for displaying every thread a user shares with a particular agent. Pass one or more filter objects to narrow results by thread metadata key/value pairs. Both narrowings may be combined in a single request. Results are returned as a flat array; no cursor-based pagination is applied.

Arguments:
  • user: User ID (usr_...) whose threads should be listed.
  • agent: Array of agent user IDs (usr_...). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
  • filter: Array of metadata filter objects. Each filter matches threads whose metadata map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
Returns:

Successful response

def create( self, user: str, input: UserThreadCreateInput) -> archastro.platform.types.threads.Thread:
1428    def create(self, user: str, input: UserThreadCreateInput) -> Thread:
1429        """
1430        Create a thread for a user
1431        Creates a new thread owned by the specified user. The authenticated caller must
1432        have access to the target user's account; a 403 is returned otherwise.
1433        An automatic welcome message is sent into the thread upon creation unless
1434        `skip_welcome_message` is set to `true`. The thread is immediately visible to
1435        the owning user and any members added at creation time.
1436
1437        Args:
1438            user: User ID (`usr_...`) whose threads should be listed.
1439            input: Request body.
1440            input.skip_welcome_message: When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
1441            input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
1442
1443        Returns:
1444            The newly created thread object.
1445        """
1446        return self._http.request(
1447            f"/api/v1/users/{user}/threads",
1448            method="POST",
1449            body=input,
1450            response_type=Thread,
1451        )

Create a thread for a user Creates a new thread owned by the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. An automatic welcome message is sent into the thread upon creation unless skip_welcome_message is set to true. The thread is immediately visible to the owning user and any members added at creation time.

Arguments:
  • user: User ID (usr_...) whose threads should be listed.
  • input: Request body.
  • input.skip_welcome_message: When true, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to false.
  • input.thread: Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
Returns:

The newly created thread object.

class UserResource:
1454class UserResource:
1455    def __init__(self, http: SyncHttpClient):
1456        self._http = http
1457        self.threads = UserThreadResource(http)
1458
1459    def me(self) -> User:
1460        """
1461        Retrieve the current user
1462        Returns the user associated with the authenticated session or bearer
1463        token. This is the canonical way to resolve "who am I?" after
1464        authentication.
1465        The response includes the user's profile, notification settings, and
1466        profile picture, along with the app, organization, and sandbox the
1467        token is scoped to and their display names enough to establish full
1468        session context in a single call. Unauthenticated requests return 401.
1469
1470        Returns:
1471            The authenticated user object.
1472        """
1473        return self._http.request("/api/v1/users/me", response_type=User)
1474
1475    def get(self, user: str) -> User:
1476        """
1477        Retrieve a user by ID
1478        Returns the user identified by `user`. The authenticated user must share
1479        at least one team with the target user; requests for users outside any
1480        shared team are rejected with 403.
1481        A user may always retrieve their own profile with this endpoint. Use the
1482        `GET /users/me` endpoint as a convenience alias for retrieving the
1483        authenticated user without specifying an ID.
1484
1485        Args:
1486            user: User ID (`usr_...`) of the user to retrieve.
1487
1488        Returns:
1489            The requested user object.
1490        """
1491        return self._http.request(f"/api/v1/users/{user}", response_type=User)
1492
1493    def artifacts(self, user: str) -> UserArtifactsResponse:
1494        """
1495        List a user's artifacts
1496        Returns all artifacts owned by the specified user. Artifacts represent
1497        AI-generated or user-uploaded files associated with agent sessions,
1498        threads, or sandboxes such as images, documents, and code outputs.
1499        The authenticated user must be requesting their own artifacts or must
1500        have administrative access. Attempting to list artifacts for a user
1501        the caller is not authorized to access returns 403.
1502        Results are returned in a single page without cursor pagination. Each
1503        artifact in the response reflects the state of its current version,
1504        including a short-lived signed `file_url` for direct download.
1505
1506        Args:
1507            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1508
1509        Returns:
1510            Successful response
1511        """
1512        return self._http.request(
1513            f"/api/v1/users/{user}/artifacts",
1514            response_type=UserArtifactsResponse,
1515        )
1516
1517    def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1518        """
1519        Create a user invite
1520        Creates a new invite for the authenticated user. The invite can optionally be
1521        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1522        caller receives the new invite object at HTTP 201.
1523        The invite key is always generated server-side (192-bit URL-safe random
1524        string) and cannot be supplied by the caller.
1525        The path `:user` must match the authenticated user. If a `thread_id` is
1526        provided, the authenticated user must have permission to invite others to that
1527        thread; team threads are not supported and return an error. Supplying a
1528        `thread_id` that does not exist or that belongs to a different user returns
1529        an error. If a key collision occurs during creation the call returns a 409
1530        conflict simply retry to generate a new key.
1531
1532        Args:
1533            user: User ID (`usr_...`). Must match the authenticated user.
1534            input: Request body.
1535            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1536
1537        Returns:
1538            The newly created invite object.
1539        """
1540        return self._http.request(
1541            f"/api/v1/users/{user}/invites",
1542            method="POST",
1543            body=input,
1544            response_type=UserInvite,
1545        )
1546
1547    def orgs(self, user: str) -> UserOrgsResponse:
1548        """
1549        List organizations for a user
1550        Returns the organizations the specified user belongs to. A user can belong
1551        to at most one organization, so the `data` array contains either zero or one
1552        items.
1553        The authenticated viewer must have permission to inspect the target user.
1554        Returns an empty `data` array when the user has no organization membership.
1555
1556        Args:
1557            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1558
1559        Returns:
1560            Successful response
1561        """
1562        return self._http.request(f"/api/v1/users/{user}/orgs", response_type=UserOrgsResponse)
1563
1564    def profile(self, user: str, input: UserProfileInput) -> User:
1565        """
1566        Update the current user's profile
1567        Updates one or more profile fields for the authenticated user. All
1568        fields are optional; omit any you do not want to change.
1569        When `profile_picture` is supplied, the image is uploaded and replaces
1570        the existing picture. The previous picture is deleted after the new one
1571        is stored. Image upload failures return 422 without modifying other
1572        profile fields.
1573
1574        Args:
1575            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1576            input: Request body.
1577            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1578            input.full_name: Updated display name for the user.
1579            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1580            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1581
1582        Returns:
1583            The user object with updated profile fields.
1584        """
1585        return self._http.request(
1586            f"/api/v1/users/{user}/profile",
1587            method="PUT",
1588            body=input,
1589            response_type=User,
1590        )
1455    def __init__(self, http: SyncHttpClient):
1456        self._http = http
1457        self.threads = UserThreadResource(http)
threads
def me(self) -> archastro.platform.types.users.User:
1459    def me(self) -> User:
1460        """
1461        Retrieve the current user
1462        Returns the user associated with the authenticated session or bearer
1463        token. This is the canonical way to resolve "who am I?" after
1464        authentication.
1465        The response includes the user's profile, notification settings, and
1466        profile picture, along with the app, organization, and sandbox the
1467        token is scoped to and their display names enough to establish full
1468        session context in a single call. Unauthenticated requests return 401.
1469
1470        Returns:
1471            The authenticated user object.
1472        """
1473        return self._http.request("/api/v1/users/me", response_type=User)

Retrieve the current user Returns the user associated with the authenticated session or bearer token. This is the canonical way to resolve "who am I?" after authentication. The response includes the user's profile, notification settings, and profile picture, along with the app, organization, and sandbox the token is scoped to and their display names enough to establish full session context in a single call. Unauthenticated requests return 401.

Returns:

The authenticated user object.

def get(self, user: str) -> archastro.platform.types.users.User:
1475    def get(self, user: str) -> User:
1476        """
1477        Retrieve a user by ID
1478        Returns the user identified by `user`. The authenticated user must share
1479        at least one team with the target user; requests for users outside any
1480        shared team are rejected with 403.
1481        A user may always retrieve their own profile with this endpoint. Use the
1482        `GET /users/me` endpoint as a convenience alias for retrieving the
1483        authenticated user without specifying an ID.
1484
1485        Args:
1486            user: User ID (`usr_...`) of the user to retrieve.
1487
1488        Returns:
1489            The requested user object.
1490        """
1491        return self._http.request(f"/api/v1/users/{user}", response_type=User)

Retrieve a user by ID Returns the user identified by user. The authenticated user must share at least one team with the target user; requests for users outside any shared team are rejected with 403. A user may always retrieve their own profile with this endpoint. Use the GET /users/me endpoint as a convenience alias for retrieving the authenticated user without specifying an ID.

Arguments:
  • user: User ID (usr_...) of the user to retrieve.
Returns:

The requested user object.

def artifacts( self, user: str) -> UserArtifactsResponse:
1493    def artifacts(self, user: str) -> UserArtifactsResponse:
1494        """
1495        List a user's artifacts
1496        Returns all artifacts owned by the specified user. Artifacts represent
1497        AI-generated or user-uploaded files associated with agent sessions,
1498        threads, or sandboxes such as images, documents, and code outputs.
1499        The authenticated user must be requesting their own artifacts or must
1500        have administrative access. Attempting to list artifacts for a user
1501        the caller is not authorized to access returns 403.
1502        Results are returned in a single page without cursor pagination. Each
1503        artifact in the response reflects the state of its current version,
1504        including a short-lived signed `file_url` for direct download.
1505
1506        Args:
1507            user: User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
1508
1509        Returns:
1510            Successful response
1511        """
1512        return self._http.request(
1513            f"/api/v1/users/{user}/artifacts",
1514            response_type=UserArtifactsResponse,
1515        )

List a user's artifacts Returns all artifacts owned by the specified user. Artifacts represent AI-generated or user-uploaded files associated with agent sessions, threads, or sandboxes such as images, documents, and code outputs. The authenticated user must be requesting their own artifacts or must have administrative access. Attempting to list artifacts for a user the caller is not authorized to access returns 403. Results are returned in a single page without cursor pagination. Each artifact in the response reflects the state of its current version, including a short-lived signed file_url for direct download.

Arguments:
  • user: User ID (usr_...). The authenticated user must be this user or have access to their artifacts.
Returns:

Successful response

def invites( self, user: str, input: UserInvitesInput) -> archastro.platform.types.users.UserInvite:
1517    def invites(self, user: str, input: UserInvitesInput) -> UserInvite:
1518        """
1519        Create a user invite
1520        Creates a new invite for the authenticated user. The invite can optionally be
1521        scoped to a specific thread, a persona, or carry arbitrary metadata. The
1522        caller receives the new invite object at HTTP 201.
1523        The invite key is always generated server-side (192-bit URL-safe random
1524        string) and cannot be supplied by the caller.
1525        The path `:user` must match the authenticated user. If a `thread_id` is
1526        provided, the authenticated user must have permission to invite others to that
1527        thread; team threads are not supported and return an error. Supplying a
1528        `thread_id` that does not exist or that belongs to a different user returns
1529        an error. If a key collision occurs during creation the call returns a 409
1530        conflict simply retry to generate a new key.
1531
1532        Args:
1533            user: User ID (`usr_...`). Must match the authenticated user.
1534            input: Request body.
1535            input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
1536
1537        Returns:
1538            The newly created invite object.
1539        """
1540        return self._http.request(
1541            f"/api/v1/users/{user}/invites",
1542            method="POST",
1543            body=input,
1544            response_type=UserInvite,
1545        )

Create a user invite Creates a new invite for the authenticated user. The invite can optionally be scoped to a specific thread, a persona, or carry arbitrary metadata. The caller receives the new invite object at HTTP 201. The invite key is always generated server-side (192-bit URL-safe random string) and cannot be supplied by the caller. The path :user must match the authenticated user. If a thread_id is provided, the authenticated user must have permission to invite others to that thread; team threads are not supported and return an error. Supplying a thread_id that does not exist or that belongs to a different user returns an error. If a key collision occurs during creation the call returns a 409 conflict simply retry to generate a new key.

Arguments:
  • user: User ID (usr_...). Must match the authenticated user.
  • input: Request body.
  • input.invite: Parameters for the new invite. See the UserInviteCreateParams schema for field details.
Returns:

The newly created invite object.

def orgs( self, user: str) -> UserOrgsResponse:
1547    def orgs(self, user: str) -> UserOrgsResponse:
1548        """
1549        List organizations for a user
1550        Returns the organizations the specified user belongs to. A user can belong
1551        to at most one organization, so the `data` array contains either zero or one
1552        items.
1553        The authenticated viewer must have permission to inspect the target user.
1554        Returns an empty `data` array when the user has no organization membership.
1555
1556        Args:
1557            user: User ID (`usr_...`) whose organization membership you want to retrieve.
1558
1559        Returns:
1560            Successful response
1561        """
1562        return self._http.request(f"/api/v1/users/{user}/orgs", response_type=UserOrgsResponse)

List organizations for a user Returns the organizations the specified user belongs to. A user can belong to at most one organization, so the data array contains either zero or one items. The authenticated viewer must have permission to inspect the target user. Returns an empty data array when the user has no organization membership.

Arguments:
  • user: User ID (usr_...) whose organization membership you want to retrieve.
Returns:

Successful response

def profile( self, user: str, input: UserProfileInput) -> archastro.platform.types.users.User:
1564    def profile(self, user: str, input: UserProfileInput) -> User:
1565        """
1566        Update the current user's profile
1567        Updates one or more profile fields for the authenticated user. All
1568        fields are optional; omit any you do not want to change.
1569        When `profile_picture` is supplied, the image is uploaded and replaces
1570        the existing picture. The previous picture is deleted after the new one
1571        is stored. Image upload failures return 422 without modifying other
1572        profile fields.
1573
1574        Args:
1575            user: User ID (`usr_...`) or `"me"` for the authenticated user.
1576            input: Request body.
1577            input.alias: Short display alias shown in place of the full name in compact UI contexts.
1578            input.full_name: Updated display name for the user.
1579            input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
1580            input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
1581
1582        Returns:
1583            The user object with updated profile fields.
1584        """
1585        return self._http.request(
1586            f"/api/v1/users/{user}/profile",
1587            method="PUT",
1588            body=input,
1589            response_type=User,
1590        )

Update the current user's profile Updates one or more profile fields for the authenticated user. All fields are optional; omit any you do not want to change. When profile_picture is supplied, the image is uploaded and replaces the existing picture. The previous picture is deleted after the new one is stored. Image upload failures return 422 without modifying other profile fields.

Arguments:
  • user: User ID (usr_...) or "me" for the authenticated user.
  • input: Request body.
  • input.alias: Short display alias shown in place of the full name in compact UI contexts.
  • input.full_name: Updated display name for the user.
  • input.metadata: Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass null for a key to remove it.
  • input.profile_picture: New profile picture to upload as a base64-encoded image. Replaces any existing picture.
Returns:

The user object with updated profile fields.