> ## 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.

# Create an action from a prompt

> Creates or reuses work using target-and-shape identity. Captures prompt evidence from the 30-day rollup. generateBrief defaults to false; when true, reserves 2 content credits through the existing brief lifecycle. A failed brief request leaves the action saved and returns briefStatus failed. No content is published.



## OpenAPI

````yaml /openapi.json post /projects/{projectId}/actions/from-prompt
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/from-prompt:
    post:
      summary: Create an action from a prompt
      description: >-
        Creates or reuses work using target-and-shape identity. Captures prompt
        evidence from the 30-day rollup. generateBrief defaults to false; when
        true, reserves 2 content credits through the existing brief lifecycle. A
        failed brief request leaves the action saved and returns briefStatus
        failed. No content is published.
      operationId: createPromptAction
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - promptId
                - title
                - description
              properties:
                promptId:
                  type: string
                  format: uuid
                title:
                  type: string
                  minLength: 1
                  maxLength: 500
                description:
                  type: string
                  minLength: 1
                  maxLength: 10000
                targetUrl:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: >-
                    Optional HTTP(S) URL of the existing page to improve. Omit
                    for new content.
                acknowledgedHighStakes:
                  type: boolean
                  default: false
                  description: >-
                    Explicit customer acknowledgement required for a high-stakes
                    target page.
                generateBrief:
                  type: boolean
                  default: false
      responses:
        '200':
          description: Saved action and optional brief state
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      actionId:
                        type: string
                        format: uuid
                      reused:
                        type: boolean
                      briefStatus:
                        type:
                          - string
                          - 'null'
                      suggestionStatus:
                        type:
                          - string
                          - 'null'
        '400':
          description: Invalid input
        '404':
          description: Prompt not found in this project
        '409':
          description: Target page is locked or matching work must be restored
components:
  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.

````