---
title: "Apply SOW generation"
description: "Create or update a SOW with the generated task items and links"
---

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

Path: Test And Accept API › UserStories

`POST /user-stories/apply-sow-generation`

Create or update a SOW with the generated task items and links

## Authentication

- `bearerAuth`, http, header `Authorization`, format `tnda_ token`

## Request body

_Required._

- `projectId` (`userStories-applySowGeneration.projectId`; string, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `storyIds` (`userStories-applySowGeneration.storyIds`; array<string>, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `taskProposals` (`userStories-applySowGeneration.taskProposals`; array<object>, required)
  - `title` (`userStories-applySowGeneration.taskProposals.title`; string, required)
    - minLength 1
  - `description` (`userStories-applySowGeneration.taskProposals.description`; string, optional)
    - default `""`
  - `type` (`userStories-applySowGeneration.taskProposals.type`; string, optional)
    - one of `"requirement"`, `"task_item"`, `"milestone"`, `"deliverable"`; default `"task_item"`
  - `priority` (`userStories-applySowGeneration.taskProposals.priority`; string, optional)
    - one of `"low"`, `"medium"`, `"high"`, `"critical"`; default `"medium"`
  - `acceptanceCriteria` (`userStories-applySowGeneration.taskProposals.acceptanceCriteria`; array<string>, optional)
  - `linkedStepIds` (`userStories-applySowGeneration.taskProposals.linkedStepIds`; array<string>, optional)
    - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `stepMappings` (`userStories-applySowGeneration.stepMappings`; array<object>, required)
  - `stepId` (`userStories-applySowGeneration.stepMappings.stepId`; string, required)
    - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
  - `taskIndex` (`userStories-applySowGeneration.stepMappings.taskIndex`; integer, required)
    - min 0; max 9007199254740991
- `sowId` (`userStories-applySowGeneration.sowId`; string, optional)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `sowTitle` (`userStories-applySowGeneration.sowTitle`; string, optional)
  - minLength 1
- `sowDescription` (`userStories-applySowGeneration.sowDescription`; string, optional)

## Example request

```json
{
  "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
  "sowId": "fe04f5bb-ebd6-4987-816c-4f641b7fc60a",
  "sowTitle": "string",
  "sowDescription": "string",
  "storyIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "taskProposals": [
    {
      "title": "string",
      "description": "",
      "type": "requirement",
      "priority": "low",
      "acceptanceCriteria": [
        "string"
      ],
      "linkedStepIds": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ],
  "stepMappings": [
    {
      "stepId": "50e29fb7-490e-4a88-b2f4-2fde4d70423d",
      "taskIndex": 0
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.testandaccept.com/api/rest/user-stories/apply-sow-generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
  "sowId": "fe04f5bb-ebd6-4987-816c-4f641b7fc60a",
  "sowTitle": "string",
  "sowDescription": "string",
  "storyIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "taskProposals": [
    {
      "title": "string",
      "description": "",
      "type": "requirement",
      "priority": "low",
      "acceptanceCriteria": [
        "string"
      ],
      "linkedStepIds": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ],
  "stepMappings": [
    {
      "stepId": "50e29fb7-490e-4a88-b2f4-2fde4d70423d",
      "taskIndex": 0
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.testandaccept.com/api/rest/user-stories/apply-sow-generation';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    projectId: '5a8591dd-4039-49df-9202-96385ba3eff8',
    sowId: 'fe04f5bb-ebd6-4987-816c-4f641b7fc60a',
    sowTitle: 'string',
    sowDescription: 'string',
    storyIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
    taskProposals: [
      {
        title: 'string',
        description: '',
        type: 'requirement',
        priority: 'low',
        acceptanceCriteria: ['string'],
        linkedStepIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08']
      }
    ],
    stepMappings: [{stepId: '50e29fb7-490e-4a88-b2f4-2fde4d70423d', taskIndex: 0}]
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.testandaccept.com/api/rest/user-stories/apply-sow-generation"

payload = {
    "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
    "sowId": "fe04f5bb-ebd6-4987-816c-4f641b7fc60a",
    "sowTitle": "string",
    "sowDescription": "string",
    "storyIds": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
    "taskProposals": [
        {
            "title": "string",
            "description": "",
            "type": "requirement",
            "priority": "low",
            "acceptanceCriteria": ["string"],
            "linkedStepIds": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"]
        }
    ],
    "stepMappings": [
        {
            "stepId": "50e29fb7-490e-4a88-b2f4-2fde4d70423d",
            "taskIndex": 0
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful response

#### Example

```json
{
  "sowId": "fe04f5bb-ebd6-4987-816c-4f641b7fc60a",
  "taskItemIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "criterionIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "linkIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
```

- `sowId` (`userStories-applySowGeneration.response.200.sowId`; string, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `taskItemIds` (`userStories-applySowGeneration.response.200.taskItemIds`; array<string>, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `criterionIds` (`userStories-applySowGeneration.response.200.criterionIds`; array<string>, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `linkIds` (`userStories-applySowGeneration.response.200.linkIds`; array<string>, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`

### 400

Invalid input data

#### Example

```json
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
```

- `message` (`userStories-applySowGeneration.response.400.message`; string, required) — The error message
  - example `"Invalid input data"`
- `code` (`userStories-applySowGeneration.response.400.code`; string, required) — The error code
  - example `"BAD_REQUEST"`
- `issues` (`userStories-applySowGeneration.response.400.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`userStories-applySowGeneration.response.400.issues.message`; string, required)

### 401

Authorization not provided

#### Example

```json
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
```

- `message` (`userStories-applySowGeneration.response.401.message`; string, required) — The error message
  - example `"Authorization not provided"`
- `code` (`userStories-applySowGeneration.response.401.code`; string, required) — The error code
  - example `"UNAUTHORIZED"`
- `issues` (`userStories-applySowGeneration.response.401.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`userStories-applySowGeneration.response.401.issues.message`; string, required)

### 403

Insufficient access

#### Example

```json
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
```

- `message` (`userStories-applySowGeneration.response.403.message`; string, required) — The error message
  - example `"Insufficient access"`
- `code` (`userStories-applySowGeneration.response.403.code`; string, required) — The error code
  - example `"FORBIDDEN"`
- `issues` (`userStories-applySowGeneration.response.403.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`userStories-applySowGeneration.response.403.issues.message`; string, required)

### 500

Internal server error

#### Example

```json
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}
```

- `message` (`userStories-applySowGeneration.response.500.message`; string, required) — The error message
  - example `"Internal server error"`
- `code` (`userStories-applySowGeneration.response.500.code`; string, required) — The error code
  - example `"INTERNAL_SERVER_ERROR"`
- `issues` (`userStories-applySowGeneration.response.500.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`userStories-applySowGeneration.response.500.issues.message`; string, required)


Source: https://docs.testandaccept.com/reference/user-stories/apply-sow-generation/index.md
