# Create/Update

## Create a schedule workflow

<mark style="color:green;">`POST`</mark> `https://api.couchdrop.io/manage/workflow/schedules`

&#x20;

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | String | API Access Token |

#### Request Body

| Name                         | Type              | Description                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                              | String            | If id is provided the existing workflow with this id will be updated.                                                                                                                                                                                                                                                                                                                |
| enabled                      | Boolean           | Enable or disable the workflow                                                                                                                                                                                                                                                                                                                                                       |
| name                         | String            | Workflow name in the system                                                                                                                                                                                                                                                                                                                                                          |
| conditions                   | JSON Array String | <p>Conditions that need to be met for this workflow to action upon.</p><p></p><p>E.g.</p><p>\[{ "condition\_type": "and", "filename\_pattern": "\*.bz2", "id": "98fe1b8c-8516-4dbc-be1f-0bdce1cc131b", "negate": false, "type": "filename\_matches" } ]</p>                                                                                                                          |
| actions                      | JSON Aray String  | <p>Action that will run on the files/folders that match the conditions.</p><p></p><p>E.g.</p><p>\[ { "actions": \[ { "email\_address": "<user1@couchdrop.io>", "id": "51856312-fa6c-469e-86da-0a3028611069", "type": "email" } ], "decompress\_to": "/myfolder/decompressed/", "decompress\_type": "bz2", "id": "1ce2e380-a4bc-4d05-a8e5-c47e76461419", "type": "decompress" } ]</p> |
| source\_path                 | String            | <p>Path for which this workflow should run. </p><p>E.g. /myfolder/compressed/</p>                                                                                                                                                                                                                                                                                                    |
| schedule\_config             | JSON String       | <p>Schedule configuration when the workflow should run in JSON format.</p><p>E.g.</p><p>{"interval":"daily","time":"15:14"}</p>                                                                                                                                                                                                                                                      |
| notification\_email\_address | String            | email address for notification emails                                                                                                                                                                                                                                                                                                                                                |
| notification\_email\_success | Boolean           | Send email on successful workflow execution                                                                                                                                                                                                                                                                                                                                          |
| notification\_email\_failure | Boolean           | Send email on failed workflow execution                                                                                                                                                                                                                                                                                                                                              |

{% tabs %}
{% tab title="200: OK Returns the new workflow in JSON format" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.couchdrop.io/administration/automations/scheduled-automations/create-update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
