Skip to content

Docs

draft_from_sources

Write a content item's original draft from its sources (fetched links, notes, transcripts and media transcripts added with add_source), in the workspace's voice: one channel-neutral post to adapt later (adapt_content). If the item already has a draft, the new one keeps its topic. Returns the text only; it saves nothing: write it with update_original, or suggest it with propose_edit. Fails with `insufficient_source` (nothing charged) when no source has text yet.

Write a content item's original draft from its sources (fetched links, notes, transcripts and media transcripts added with add_source), in the workspace's voice: one channel-neutral post to adapt later (adapt_content). If the item already has a draft, the new one keeps its topic. Returns the text only; it saves nothing: write it with update_original, or suggest it with propose_edit. Fails with insufficient_source (nothing charged) when no source has text yet.

Uses heyeveryone AI and costs 2 credits (2 credits per draft). Tell the person before calling it.

Access and cost

  • Kind: mutation
  • Scope: workspace
  • Actors: member, agent
  • Credits: 2 credits per draft.
  • Requires confirmation: false
  • Accepts idempotency key: true

Input schema

{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "pieceId": {
      "format": "uuid",
      "type": "string"
    },
    "instructions": {
      "maxLength": 2000,
      "type": "string"
    },
    "targetChars": {
      "maximum": 5000,
      "minimum": 100,
      "type": "integer"
    },
    "idempotencyKey": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "workspaceId",
    "pieceId"
  ],
  "type": "object"
}

Output schema

{
  "additionalProperties": false,
  "properties": {
    "text": {
      "type": "string"
    },
    "sourcesUsed": {
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "text",
    "sourcesUsed"
  ],
  "type": "object"
}

Errors

[
  "piece_not_found",
  "insufficient_source",
  "ai_generation_failed",
  "insufficient_credits",
  "plan_limit_reached",
  "idempotency_conflict"
]

Annotations

{
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Draft from sources"
}