skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
storage.googleapis.com1.1k installs

streak-draft-created

Notify Streak after creating a Gmail draft with the gws CLI. Run this immediately after every successful `gws gmail ... --draft` (send, reply, or reply-all) so Streak records the draft against the box. It POSTs the draftId, threadId, forUserEmail, and whether the draft was a reply to the box's draftCreated endpoint.

How do I install this agent skill?

npx skills add https://storage.googleapis.com --skill streak-draft-created
view source ↗

Is this agent skill safe to install?

No partner audit is available yet. Read the source before installing.

What does this agent skill do?

Notify Streak that a draft was created

Whenever you create a Gmail draft with gws (a new draft via gws gmail +send ... --draft, or a threaded reply via gws gmail +reply / +reply-all ... --draft), Streak does not learn about that draft on its own. You must tell it, by POSTing to the box's draftCreated endpoint. Do this once per draft, right after the gws command succeeds.

If you skip this step the draft still exists in the user's Gmail, but Streak has no record of it — the box timeline will be wrong and later sessions may not know the draft was already written.

When to run

Run this exactly once for each draft you successfully create, immediately after the gws command returns success. Do not run it if the gws command failed, and do not run it more than once for the same draft (that would create duplicate records).

Endpoint

POST https://$STREAK_API_HOST/api/v2/boxes/$BOX_KEY/draftCreated
Authorization: Bearer $STREAK_API_KEY
Content-Type: application/json

$STREAK_API_HOST, $STREAK_API_KEY, and $BOX_KEY are already set in your environment (in production $STREAK_API_HOST resolves to api.streak.com). Always use these variables rather than hardcoding the host, so the call works in both dev and production.

Request body

{
  "draftId": "r-12345678",
  "threadId": "19ab34cd56",
  "forUserEmail": "user@example.com",
  "isReply": false
}
FieldWhere it comes from
draftIdThe draft's id from the JSON that the gws draft command printed on success (Gmail draft ids look like r-…).
threadIdThe threadId of the draft's message, also from the gws output. For a reply this is the existing thread; for a new draft it is the thread Gmail created for it.
forUserEmailThe exact address you passed as --email=<address> to gws (the team member in whose mailbox the draft was created).
isReplyfalse for a new draft (gws gmail +send); true for a reply drafted with gws gmail +reply or +reply-all.

Getting draftId and threadId from the gws output

Capture the gws command's output and read the two ids from it. The gws-gmail-send / gws-gmail-reply skills document the exact output shape; the draft id and the message threadId are what you need. For example, if you saved the command's JSON output to draft.json:

DRAFT_ID=$(jq -r '.id' draft.json)
THREAD_ID=$(jq -r '.message.threadId // .threadId' draft.json)

Adapt the jq paths to the actual field names in the gws output if they differ — the goal is the Gmail draft id and its thread id.

Making the call

curl -sS -X POST \
  "https://$STREAK_API_HOST/api/v2/boxes/$BOX_KEY/draftCreated" \
  -H "Authorization: Bearer $STREAK_API_KEY" \
  -H "Content-Type: application/json" \
  --fail-with-body \
  -d "$(jq -nc \
        --arg draftId "$DRAFT_ID" \
        --arg threadId "$THREAD_ID" \
        --arg forUserEmail "user@example.com" \
        --argjson isReply false \
        '{draftId:$draftId, threadId:$threadId, forUserEmail:$forUserEmail, isReply:$isReply}')"

Building the body with jq -nc (rather than hand-writing the JSON string) avoids quoting mistakes and guarantees valid JSON. Set forUserEmail to the address you used for --email, and isReply to true for replies.

After the call

  • On success (2xx), the draft is recorded — note it in your final summary (e.g. "drafted a reply for user@example.com and notified Streak").
  • On failure, do not troubleshoot or retry in a loop. Include the HTTP status and response body in your final summary so it can be investigated, and continue with any other useful action. A failed notification does not undo the draft — never delete or re-create the draft to "fix" it.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/storage.googleapis.com/streak-draft-created">View streak-draft-created on skillZs</a>