# Projects

## Overview of all projects

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

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: `API token` |

{% tabs %}
{% tab title="200 All of your projects" %}

```json
[
    {
        "id": 2,
        "name": "Project name",
        "company_id": 1,
        "deleted_at": null,
        "created_at": "2022-05-30T13:28:12.000000Z",
        "updated_at": "2022-05-30T13:28:12.000000Z"
    }
]
```

{% endtab %}
{% endtabs %}

## Details of project

<mark style="color:blue;">`GET`</mark> `https://cronly.app/api/projects/{id}`

#### Query Parameters

| Name                                 | Type    | Description                            |
| ------------------------------------ | ------- | -------------------------------------- |
| id<mark style="color:red;">\*</mark> | Integer | The ID of the project you want to view |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: `API token` |

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

```json
{
    "id": 2,
    "name": "Project name",
    "company_id": 1,
    "deleted_at": null,
    "created_at": "2022-05-30T13:28:12.000000Z",
    "updated_at": "2022-05-30T13:28:12.000000Z"
}
```

{% endtab %}

{% tab title="404: Not Found The project was not found" %}

```json
{
    "error": "Project not found"
}
```

{% endtab %}
{% endtabs %}

## Create a new project

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

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: `API token` |

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 The newly created project" %}

```json
{
    "name": "new project",
    "company_id": 1,
    "updated_at": "2022-05-31T19:50:29.000000Z",
    "created_at": "2022-05-31T19:50:29.000000Z",
    "id": 4
}
```

{% endtab %}
{% endtabs %}

## Delete a project

<mark style="color:red;">`DELETE`</mark> `https://cronly.app/api/projects/{id}`

#### Query Parameters

| Name                                 | Type    | Description                                |
| ------------------------------------ | ------- | ------------------------------------------ |
| id<mark style="color:red;">\*</mark> | Integer | The ID of the certificate you want to view |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: `API token` |

{% tabs %}
{% tab title="204: No Content The project has been deleted successfully" %}

```json
{
    "success": "Project deleted"
}
```

{% endtab %}

{% tab title="404: Not Found The project was not found" %}

```json
{
    "error": "Project not found"
}
```

{% endtab %}
{% endtabs %}
