tasks

Attach a Gmail thread to the task [write]

Changed on

Reads one Gmail thread and keeps it in the task's files as plain text at email/<subject>-<thread id>.md: subject, participants, and every message with sender, recipients, time and text; attachments are listed by name and never copied. Every session of the task reads it at its next turn, and the task story shows it as file.changed by the caller with detail.email. Attaching the same thread again writes a new version only when it changed (200 instead of 201). Nothing is sent from Gmail. Same access rules as the search; 400 invalid_thread for something that is not a thread id or a Gmail address ending in one; 404 thread_not_found.

post/tasks/{id}/email-threads

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/tasks/{id}/email-threads
  • Auth
    HTTP bearer

Path parameters

idstring required

The task id: the id of its root session (sess_…)

Request body

threadstring required

A Gmail thread id, or a mail.google.com address ending in one

connection_idstring

Response

Already attached and unchanged; same body

Changes