---
title: "Send a user query to the Story Writer Assistant"
method: POST
path: "/api/ai/story_writer"
tags: ["AI"]
---

# Send a user query to the Story Writer Assistant

`POST /api/ai/story_writer`

## Request

- Base URL: `https://api.atono.io`
- URL: `https://api.atono.io/api/ai/story_writer`
- Auth: API key in header `X-API-KEY`

## Request body

- RequestStoryWriterConversationCreationResource
  - `data` StoryWriterConversationCreationResource, required
    - `type` string, required
    - `attributes` StoryWriterConversationCreationResourceAttributes, required
      - `userMessage` string, required
      - `action` string, required
      - `arguments` string, required
    - `relationships` StoryWriterConversationCreationResourceRelationships, required
      - `story` SingleRelationshipUpdate, required
        - `data` ResourceIdentifier, required
          - `type` string, required: Identifies the type of the linked resource.
          - `id` string, required: The unique identifier of the linked resource.
      - `draft` BacklogItemCreationResource, required
        - `type` string, required
        - `attributes` BacklogItemCreationResourceBacklogItemAttributes, required
          - `title` string, required
          - `itemType` 'STORY' | 'BUG' | 'TASK' | 'VULNERABILITY' | 'EPIC', required
          - `position` integer, nullable, required
          - `content` ContentChunk[], nullable, required
            - `type` 'DISPLAY_HTML' | 'TEXT' | 'PERSONA', required: The type of content chunk. - `DISPLAY_HTML`: HTML-formatted content. - `TEXT`: Plain text content. - `PERSONA`: A persona for a user story.
            - `value` string, required: The content in this chunk.
          - `additionalContent` ContentChunk[], nullable, required
            - `type` 'DISPLAY_HTML' | 'TEXT' | 'PERSONA', required: The type of content chunk. - `DISPLAY_HTML`: HTML-formatted content. - `TEXT`: Plain text content. - `PERSONA`: A persona for a user story.
            - `value` string, required: The content in this chunk.
          - `backfillDate` string, date-time, nullable, required
          - `epicPosition` integer, nullable, required
          - `aiAgentName` string, nullable, required
        - `relationships` BacklogItemCreationResourceBacklogItemRelationships, required
          - `assignee` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `team` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `acceptanceCriteria` AcceptanceCriteriaCreationResource, required
            - `data` AcceptanceCriterionCreationResource[], required
              - …
          - `size` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `environments` MultipleRelationshipsUpdate, required
            - `data` ResourceIdentifier[], required
              - …
          - `workflowStep` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `productTheme` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `epic` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `linkedItems` MultipleRelationshipsUpdate, required
            - `data` ResourceIdentifier[], required
              - …
          - `timebox` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `sprint` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `impact` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `probability` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `reporter` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …
          - `duplicatedFrom` SingleRelationshipUpdate, required
            - `data` ResourceIdentifier, required
              - …

## Response `200`

postMessage 200 response

- SingleResourceBodyStoryWriterConversationResource
  - `data` StoryWriterConversationResource: The returned resource, based on the request.
    - `type` string, required
    - `id` string, uuid, required
    - `attributes` StoryWriterConversationResourceAttributes, required
      - `userMessage` string, required
      - `botMessage` string, required
      - `action` string, required
      - `arguments` string, required
      - `choices` string[], required
      - `suggestedTitle` string, required
      - `suggestedStory` StoryWriterConversationResultSuggestedStory, required
        - `text` string, required
        - `persona` string, required
      - `suggestedAcceptanceCriteria` StoryWriterConversationResultSuggestedAcceptanceCriterion[], required
        - `id` string, uuid, nullable
        - `description` string, required
        - `position` integer, required
        - `level` integer, required
      - `structuredQuestions` StoryWriterConversationResultStructuredQuestion[], required
        - `question` string, required
        - `multipleChoice` boolean, required
        - `answers` string[], required
      - `designNotesUpdate` string, required
      - `needsCompaction` boolean, required
      - `compactionStatus` StoryWriterConversationCompactionStatus, required
        - `totalTokenCount` integer, required
        - `reachedWarnThreshold` boolean, required
    - `relationships` StoryWriterConversationResourceRelationships, required
      - `story` SingleRelationship, required
        - `links` RelationshipLinks, required
          - `self` string, uri, nullable, required
          - `related` string, uri, nullable, required
        - `data` ResourceIdentifier, required
          - `type` string, required: Identifies the type of the linked resource.
          - `id` string, required: The unique identifier of the linked resource.
        - `meta` unknown, required
      - `referencedStories` MultipleRelationships, required
        - `links` RelationshipLinks, required
          - `self` string, uri, nullable, required
          - `related` string, uri, nullable, required
        - `data` ResourceIdentifier[], nullable, required
          - `type` string, required: Identifies the type of the linked resource.
          - `id` string, required: The unique identifier of the linked resource.
        - `meta` unknown, required
  - `errors` ProblemDetail[]: A list of errors returned with the response, if the request could not be completed. Each object includes details about a specific issue.
    - `id` string: A unique identifier for this specific error occurrence. Useful for debugging and support.
    - `links` object, nullable: Links related to the error. May include a URL to relevant documentation or support resources.
    - `status` integer: The HTTP status code associated with the error (e.g., 400, 404, 422).
    - `code` string: An internal code that identifies the type or category of the error.
    - `title` string: A short summary of the problem.
    - `source` ProblemSource: Identifies the part of the request that caused the error. Only one source is present per error.
      - `pointer` string, nullable: Specifies the path to the field in the request body that caused the error.
      - `parameter` string, nullable: Identifies a query parameter in the request URL that caused the error.
      - `header` string, nullable: Identifies the request header that caused the error.
    - `detail` string: Additional information about the error, intended to provide more context than the title.
    - `meta` unknown
  - `meta` unknown
  - `included` unknown[]: A list of related resources included in the response, either automatically by the API or in response to an include parameter in the request. Each item contains a full resource object (e.g., users, teams, acceptance criteria).
    - unknown
  - `links` unknown

---

[API](https://skmtc.dev/atono/apis/backend-api.md) · [All operations](https://skmtc.dev/atono/apis/backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/atono/apis/backend-api/revisions/78a57b1d8c3d?raw)
