> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devtune.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get action content draft

> Returns an action's content draft for accounts with content drafts: the draft the action takes now, the models a run can use with their estimates, the run in flight, and the current draft with up to 10 earlier versions, each with its markdown, change list and fact check. Refused with 403 when content drafts are off, and 400 when actionId is not a UUID.



## OpenAPI

````yaml /openapi.json get /projects/{projectId}/actions/{actionId}/draft
openapi: 3.1.0
info:
  title: DevTune API
  version: 2.0.0
  description: >-
    API for programmatic access to your AI visibility data, webhook
    subscriptions, and automation workflows. Use this API to integrate DevTune
    data into CI/CD pipelines, BI tools, AI agents, and operational systems.
servers:
  - url: https://devtune.ai/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/actions/{actionId}/draft:
    get:
      summary: Get action content draft
      description: >-
        Returns an action's content draft for accounts with content drafts: the
        draft the action takes now, the models a run can use with their
        estimates, the run in flight, and the current draft with up to 10
        earlier versions, each with its markdown, change list and fact check.
        Refused with 403 when content drafts are off, and 400 when actionId is
        not a UUID.
      operationId: getActionContentDraft
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: actionId
          in: path
          required: true
          description: UUID of the action.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Action content draft
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ActionContentDraft'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
components:
  schemas:
    ActionContentDraft:
      type: object
      properties:
        actionId:
          type: string
          format: uuid
        draftKind:
          type:
            - string
            - 'null'
          enum:
            - page
            - section_edits
            - null
          description: >-
            The draft the action takes now: page for a create action,
            section_edits for a refresh. Null for an action that takes no draft.
        agentKey:
          type:
            - string
            - 'null'
          enum:
            - page-drafter
            - section-editor
            - null
        briefState:
          type:
            - string
            - 'null'
          enum:
            - ready
            - missing
            - in_progress
            - not_ready
            - outdated
            - null
          description: >-
            A draft is written from a ready brief only; not_ready covers a stale
            or failed brief, and outdated a ready brief written before the
            current brief format, which must be regenerated to draft.
        targetPage:
          type:
            - object
            - 'null'
          description: For section edits, the page edited.
          properties:
            url:
              type:
                - string
                - 'null'
            state:
              type: string
              enum:
                - ready
                - locked
                - no_target
            briefRecommendedUrl:
              type:
                - string
                - 'null'
              description: >-
                The page the ready brief recommends, when it differs from the
                action's own target, which is used.
          required:
            - url
            - state
            - briefRecommendedUrl
        models:
          type: array
          description: >-
            Models a draft run can use, with the per-run credit estimate from
            recent runs (null without enough history).
          items:
            type: object
            properties:
              id:
                type: string
              isDefault:
                type: boolean
              estimateCredits:
                type:
                  - number
                  - 'null'
            required:
              - id
              - isDefault
              - estimateCredits
        run:
          type:
            - object
            - 'null'
          description: >-
            The draft run in flight, or the last one that ended without a draft
            and was not followed by one.
          properties:
            id:
              type: string
              format: uuid
            state:
              type: string
              enum:
                - running
                - failed
            status:
              type: string
          required:
            - id
            - state
            - status
        current:
          oneOf:
            - $ref: '#/components/schemas/ContentDraftVersion'
            - type: 'null'
        versions:
          type: array
          description: >-
            Newest first: the current draft and up to 10 earlier versions, the
            same ones the action page lists.
          items:
            $ref: '#/components/schemas/ContentDraftVersion'
      required:
        - actionId
        - draftKind
        - agentKey
        - briefState
        - targetPage
        - models
        - run
        - current
        - versions
    Meta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        projectId:
          type: string
          format: uuid
    ContentDraftVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
        draftKind:
          type: string
          enum:
            - page
            - section_edits
          description: >-
            page: a whole new page written by the Page Drafter. section_edits: a
            change list for an existing page written by the Section Editor.
        title:
          type: string
        contentMarkdown:
          type:
            - string
            - 'null'
          description: >-
            The downloadable markdown: the page, or the change list rendered as
            markdown.
        changeList:
          type:
            - object
            - 'null'
          description: For section edits, the structured change list.
          properties:
            page:
              type: object
              properties:
                url:
                  type: string
                crawledAt:
                  type:
                    - string
                    - 'null'
                  format: date-time
                crawled:
                  type: boolean
                  description: >-
                    False when DevTune held no crawl of the page, so no current
                    text could be quoted.
              required:
                - url
                - crawledAt
                - crawled
            lockedPagesAvoided:
              type: array
              items:
                type: string
              description: >-
                Locked pages the action was steered away from; none of them is
                edited.
            changes:
              type: array
              items:
                type: object
                properties:
                  heading:
                    type: string
                  newSection:
                    type:
                      - object
                      - 'null'
                    description: >-
                      Set for a new section, with the existing heading it goes
                      after (null for the end of the page).
                    properties:
                      afterHeading:
                        type:
                          - string
                          - 'null'
                    required:
                      - afterHeading
                  currentText:
                    type: string
                  proposedText:
                    type: string
                  reason:
                    type: string
                required:
                  - heading
                  - newSection
                  - currentText
                  - proposedText
                  - reason
          required:
            - page
            - lockedPagesAvoided
            - changes
        status:
          type: string
          enum:
            - current
            - superseded
          description: >-
            current for the draft the action shows now; every other version,
            including the other agent's last draft from before the action
            changed between create and refresh, is superseded.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        briefId:
          type:
            - string
            - 'null'
          format: uuid
        briefGeneratedAt:
          type:
            - string
            - 'null'
          format: date-time
        runId:
          type:
            - string
            - 'null'
          format: uuid
        factCheck:
          oneOf:
            - $ref: '#/components/schemas/ContentDraftFactCheck'
            - type: 'null'
      required:
        - id
        - draftKind
        - title
        - contentMarkdown
        - changeList
        - status
        - createdAt
        - updatedAt
        - briefId
        - briefGeneratedAt
        - runId
        - factCheck
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        reason:
          type: string
          description: >-
            Why the request was refused, for an error with more than one cause,
            such as a refused content-draft start.
        status:
          type: integer
      required:
        - error
        - message
        - status
    ContentDraftFactCheck:
      type: object
      description: >-
        The draft's mandatory fact check. A product fact (a specific price,
        number, limit, date, integration or capability) on the brief's facts
        list counts as supported by that fact's source. Every other product fact
        is flagged and searched on the customer's own site: unsupported or
        contradicted when the site does not state it or says otherwise, else
        not_in_brief, with siteJudgment saying whether the site supports it. A
        claim about another product that an external fact on the brief's facts
        list provably contradicts is flagged contradicted_by_source, with that
        fact as the brief words it (which may paraphrase the source it cites). A
        sentence linking to one of the project's configured competitors is
        flagged competitor_link, with the link in linkUrl.
      properties:
        checkedAt:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - checked
            - partial
            - unavailable
          description: >-
            checked: every sentence was judged. partial: some searches or checks
            failed. unavailable: nothing was checked, so the facts are
            unverified.
        flags:
          type: array
          description: The sentences still flagged in the saved draft.
          items:
            type: object
            properties:
              claim:
                type: string
              reason:
                type: string
                enum:
                  - unsupported
                  - contradicted
                  - not_in_brief
                  - contradicted_by_source
                  - competitor_link
                description: >-
                  unsupported or contradicted by the customer's own site,
                  not_in_brief: a product fact the brief's facts list does not
                  state, whatever the site says, contradicted_by_source: a claim
                  about another product that an external fact on the brief's
                  facts list contradicts, proven against that fact's wording, or
                  competitor_link: the sentence links to one of the project's
                  configured competitors.
              linkUrl:
                type:
                  - string
                  - 'null'
                description: >-
                  For a competitor_link flag, the competitor URL the sentence
                  links to. Null otherwise.
              siteJudgment:
                type:
                  - string
                  - 'null'
                enum:
                  - supported
                  - stale
                  - unclear
                  - null
                description: >-
                  For a not_in_brief flag, what the site check found: supported
                  means the customer's site states it, so it can be added to the
                  brief's facts; stale means only dated pages state it, which
                  may no longer hold; unclear means the site was inconclusive.
                  Null otherwise, or when the site check did not judge it.
              evidenceUrls:
                type: array
                items:
                  type: string
                description: >-
                  The owned pages the sentence was judged against; for
                  contradicted_by_source, the source the brief's fact cites,
                  when it has a URL.
              quote:
                type:
                  - object
                  - 'null'
                description: >-
                  The passage that contradicts the sentence: quoted word for
                  word from the customer's site, or, for contradicted_by_source,
                  the brief's listed fact as the brief words it, which may
                  paraphrase the source it cites (url).
                properties:
                  text:
                    type: string
                  url:
                    type:
                      - string
                      - 'null'
                required:
                  - text
                  - url
              changeIndexes:
                type:
                  - array
                  - 'null'
                items:
                  type: integer
                  minimum: 0
                description: >-
                  For section edits, the changes whose proposed text states the
                  sentence.
            required:
              - claim
              - reason
              - siteJudgment
              - linkUrl
              - evidenceUrls
              - quote
              - changeIndexes
        flaggedBeforeFix:
          type:
            - integer
            - 'null'
          minimum: 0
          description: >-
            Flags the first check returned to the agent before its one fix pass;
            null when it did not run.
        flaggedAfterFix:
          type:
            - integer
            - 'null'
          minimum: 0
          description: >-
            Flags on the saved draft; null when its check did not run and no
            link to a competitor was found.
        coverage:
          type:
            - object
            - 'null'
          description: >-
            How much of the draft the check covered, in sentences. read counts
            the sentences the check reviewed as possible claims (questions and
            short fragments are not counted); the other counts split it. hasGap
            is false only when every sentence was judged and settled. Null when
            the check did not run or was saved before coverage was recorded.
          properties:
            read:
              type: integer
              minimum: 0
              description: >-
                Sentences the check reviewed as possible claims, including those
                marked [Needs source]. Questions and short fragments are not
                counted.
            checked:
              type: integer
              minimum: 0
              description: >-
                Settled: restated from the brief's facts list, or judged against
                the customer's site. Includes third-party claims the brief's
                facts support.
            unsettled:
              type: integer
              minimum: 0
              description: >-
                Judged but not settled: unclear, or supported only by dated
                pages.
            notChecked:
              type: integer
              minimum: 0
              description: Not checked because classification, search or the check failed.
            notVerified:
              type: integer
              minimum: 0
              description: >-
                Claims about a third party (another product, company, standard
                or source) that were read but not verified. Always 0 on a check
                saved before claim kinds were recorded, whose claims about other
                products are counted in setAside.
            setAside:
              type: integer
              minimum: 0
              description: >-
                Set aside as guidance, an example, a heading or an opinion, with
                nothing to verify. On a check saved before claim kinds were
                recorded, also claims about other products.
            needsSource:
              type: integer
              minimum: 0
              description: Marked [Needs source] in the draft.
            hasGap:
              type: boolean
          required:
            - read
            - checked
            - unsettled
            - notChecked
            - notVerified
            - setAside
            - needsSource
            - hasGap
      required:
        - checkedAt
        - status
        - flags
        - flaggedBeforeFix
        - flaggedAfterFix
        - coverage
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    X-RateLimit-Limit:
      description: Maximum requests per window
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in current window
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the window resets
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key with dtk_live_ prefix. Obtain it from API Keys in the account
        sidebar. New keys start with all supported scopes selected for the
        chosen project, and you can narrow them to specific read/write scopes as
        needed.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.