Stories

Create a story on a task

<b>Required scope: </b><code>stories:write</code>

Adds a story to a task. This endpoint currently only allows for comment stories to be created. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request.

Returns the full record for the new story added to the task.

post/tasks/{task_gid}/stories

Request

  • Base URL: https://app.asana.com/api/1.0
  • URL: https://app.asana.com/api/1.0/tasks/{task_gid}/stories
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.asana.com/-/oauth_authorize, token URL https://app.asana.com/-/oauth_token, scopes: stories:write)

Query parameters

opt_fieldsstring[]

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. Properties can include nested fields. To learn more, see the input/output options guide.

Request body

Example request

{
  "data": {
    "gid": "12345",
    "resource_type": "story",
    "created_at": "2012-02-22T02:06:58.147Z",
    "resource_subtype": "comment_added",
    "text": "This is a comment.",
    "html_text": "<body>This is a comment.</body>",
    "sticker_name": "dancing_unicorn"
  }
}

Response

Successfully created a new story.

Example response

{
  "data": {
    "gid": "12345",
    "resource_type": "story",
    "created_at": "2012-02-22T02:06:58.147Z",
    "resource_subtype": "comment_added",
    "text": "This is a comment.",
    "html_text": "<body>This is a comment.</body>",
    "sticker_name": "dancing_unicorn",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "type": "comment",
    "hearts": [
      {
        "gid": "12345",
        "user": {
          "gid": "12345",
          "resource_type": "user",
          "name": "Greg Sanchez"
        }
      }
    ],
    "num_hearts": 5,
    "likes": [
      {
        "gid": "12345",
        "user": {
          "gid": "12345",
          "resource_type": "user",
          "name": "Greg Sanchez"
        }
      }
    ],
    "num_likes": 5,
    "reaction_summary": [
      {
        "emoji_base": "👎",
        "variant": "👎🏼",
        "count": 1
      }
    ],
    "previews": [
      {
        "fallback": "Greg: Great! I like this idea.\\n\\nhttps//a_company.slack.com/archives/ABCDEFG/12345678",
        "footer": "Mar 17, 2019 1:25 PM",
        "header": "Asana for Slack",
        "header_link": "https://asana.comn/apps/slack",
        "html_text": "<body>Great! I like this idea.</body>",
        "text": "Great! I like this idea.",
        "title": "Greg",
        "title_link": "https://asana.slack.com/archives/ABCDEFG/12345678"
      }
    ],
    "old_name": "This was the old name",
    "new_name": "This is the new name",
    "old_dates": {
      "start_on": "2019-09-14",
      "due_at": "2019-09-15T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "new_dates": {
      "start_on": "2019-09-14",
      "due_at": "2019-09-15T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "old_resource_subtype": "default_task",
    "new_resource_subtype": "milestone",
    "story": {
      "gid": "12345",
      "resource_type": "story",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        "gid": "12345",
        "resource_type": "user",
        "name": "Greg Sanchez"
      },
      "resource_subtype": "comment_added",
      "text": "marked today"
    },
    "assignee": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "follower": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "old_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "new_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task",
      "resource_subtype": "default_task",
      "created_by": {
        "gid": "1111",
        "resource_type": "user"
      }
    },
    "project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "resource_subtype": "default_project"
    },
    "tag": {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy"
    },
    "custom_field": {
      "gid": "12345",
      "resource_type": "custom_field",
      "name": "Status",
      "enum_options": [
        {
          "gid": "12345",
          "resource_type": "enum_option",
          "name": "Low",
          "enabled": true,
          "color": "blue"
        }
      ],
      "enabled": true,
      "representation_type": "number",
      "id_prefix": "ID",
      "input_restrictions": [
        "task"
      ],
      "date_value": {
        "date": "2024-08-23",
        "date_time": "2024-08-23T22:00:00.000Z"
      },
      "enum_value": {
        "gid": "12345",
        "resource_type": "enum_option",
        "name": "Low",
        "enabled": true,
        "color": "blue"
      },
      "multi_enum_values": [
        {
          "gid": "12345",
          "resource_type": "enum_option",
          "name": "Low",
          "enabled": true,
          "color": "blue"
        }
      ],
      "number_value": 5.2,
      "text_value": "Some Value",
      "display_value": "blue"
    },
    "old_text_value": "This was the old text",
    "new_text_value": "This is the new text",
    "old_number_value": 1,
    "new_number_value": 2,
    "old_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "new_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "old_date_value": {
      "start_on": "2019-09-14",
      "due_at": "2019-09-15T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "new_date_value": {
      "start_on": "2019-09-14",
      "due_at": "2019-09-15T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "old_people_value": [
      {
        "gid": "12345",
        "resource_type": "user",
        "name": "Greg Sanchez"
      }
    ],
    "new_people_value": [
      {
        "gid": "12345",
        "resource_type": "user",
        "name": "Greg Sanchez"
      }
    ],
    "old_multi_enum_values": [
      {
        "gid": "12345",
        "resource_type": "enum_option",
        "name": "Low",
        "enabled": true,
        "color": "blue"
      }
    ],
    "new_multi_enum_values": [
      {
        "gid": "12345",
        "resource_type": "enum_option",
        "name": "Low",
        "enabled": true,
        "color": "blue"
      }
    ],
    "new_approval_status": "approved",
    "old_approval_status": "pending",
    "duplicate_of": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task",
      "resource_subtype": "default_task",
      "created_by": {
        "gid": "1111",
        "resource_type": "user"
      }
    },
    "duplicated_from": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task",
      "resource_subtype": "default_task",
      "created_by": {
        "gid": "1111",
        "resource_type": "user"
      }
    },
    "dependency": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task",
      "resource_subtype": "default_task",
      "created_by": {
        "gid": "1111",
        "resource_type": "user"
      }
    },
    "source": "web",
    "target": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task",
      "resource_subtype": "default_task",
      "created_by": {
        "gid": "1111",
        "resource_type": "user"
      }
    }
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.