> For the complete documentation index, see [llms.txt](https://tolstoy.gitbook.io/tolstoy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tolstoy.gitbook.io/tolstoy/reference/project.md).

# Project

## Create

<mark style="color:green;">`POST`</mark> `https://api.gotolstoy.com/projects/`

This endpoint allows you to create new Tolstoy

#### Path Parameters

| Name    | Type   | Description                                                   |
| ------- | ------ | ------------------------------------------------------------- |
| project | object | Project details - { "project": { "name": "my new project" } } |

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization token - Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{ "id": "1242d2ad-8179-47d2-b6a1-ce0ee8cdc359", "tolstoy": "https://player.gotolstoy.com/wc9gat7q75fu8?sneakpeek" }
```

{% endtab %}
{% endtabs %}

## Create Step

<mark style="color:green;">`POST`</mark> `https://api.gotolstoy.com/projects/steps`

This endpoint allows you to create new Tolstoy's part

#### Path Parameters

| Name | Type   | Description                                                                                                                                                                                                                                                                                                                     |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| step | object | Part details - { "step": { "projectId": "f4828e6b-849f-4794-b3ec-c365f331506a", "description": "description", "answers": \[{ "next": "rqAvg", "text": "hey how are you?" }, { "next": "rqAvg", "text": "what is your age?" }], "videoId": "e899d07e-da6d-41f1-ba2f-e546e97c3a7e", "overlayText": "This is the overlay text" } } |

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization token - Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{"id":"7ea4e34c-8185-4f9f-a835-d1d3b05c54e6","name":"pHB58"}
```

{% endtab %}
{% endtabs %}

## Get Project

<mark style="color:blue;">`GET`</mark> `https://api.gotolstoy.com/projects/:id`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| Id   | string | Project id  |

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization token - Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{ "project" : { ... } }
```

{% endtab %}
{% endtabs %}

## Delete Project

<mark style="color:red;">`DELETE`</mark> `https://api.gotolstoy.com/projects/`

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization Token - Bearer Token |

#### Request Body

| Name      | Type   | Description               |
| --------- | ------ | ------------------------- |
| projectId | string | The project to be deleted |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## List Projects

<mark style="color:blue;">`GET`</mark> `https://api.gotolstoy.com/projects/`

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization Token - Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{ "projects": [...] }
```

{% endtab %}
{% endtabs %}

## Update Project

<mark style="color:orange;">`PUT`</mark> `https://api.gotolstoy.com/projects/{id}`

#### Path Parameters

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization Token - Bearer Token |

#### Request Body

| Name               | Type   | Description |
| ------------------ | ------ | ----------- |
| name               | string |             |
| emailNotifications | array  |             |
| stepsOrder         | array  |             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Update Step

<mark style="color:orange;">`PUT`</mark> `https://api.gotolstoy.com/projects/steps/{id}`

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization Token - Bearer Token |

#### Request Body

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| description | string |             |
| answers     | array  |             |
| videoId     | string |             |
| overlayText | string |             |
| answerTime  | number |             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Delete Step

<mark style="color:red;">`DELETE`</mark> `https://api.gotolstoy.com/projects/steps`

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization Token - Bearer Token |

#### Request Body

| Name   | Type   | Description            |
| ------ | ------ | ---------------------- |
| stepId | string | The step to be deleted |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
