# タスクの依存関係の作成

`POST /api/task/{taskId}/depends-on/{predecessorTaskId}`

URL: https://repsona.com/ja/api/post-task-taskid-depends-on-predecessortaskid

2 つのタスクの間に、先行タスクとの依存関係を作ります。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `taskId` | path | integer | 必須 | タスクの ID です。 |
| `predecessorTaskId` | path | integer | 必須 | 先に終わらせる必要があるタスク (先行タスク) の ID です。 |

## リクエスト

```sh
curl -X POST "https://<space>.repsona.com/api/task/{taskId}/depends-on/{predecessorTaskId}" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## レスポンス

- 200: Dependency created or already existed
- 400: Invalid identifiers or self dependency
- 401: Authentication is required
- 404: Task not found

## レスポンスの例

```json
{
  "id": 27,
  "taskId": 100448,
  "predecessorTaskId": 100449,
  "updatedAt": 1793662651314
}
```
