> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# Create tasks

POST https://api.modulards.com/api/public/v1/site-tasks
Content-Type: application/json

Logs the same task on one to 50 websites at once, inside one transaction per website. A website the token cannot reach is skipped, not failed - reported under `meta.skipped` with `reason_code: PERMISSION_DENIED`; a task needs no connected website, so nothing else is skippable.

Body parameters:

* `sites` (integer array, required): exact website ids, 1 to 50.
* `title` (string, required): max 255 characters.
* `date` (string, required): `Y-m-d`, the calendar day the work happened.
* `content` (string, optional): HTML, purified server-side, max 2500 characters after tags are stripped.
* `time_spent` (number, optional): minutes spent, decimal allowed, minimum 0. Only ever a value the user gave - never estimate or invent it.
* `is_pending` (boolean, optional): defaults to `false` when omitted.
* `files` (array, optional): up to 4 entries, `[{uuid, name}]`. `uuid` must name a file already uploaded through the "Uploads" folder (or, on this create, that is the only source - there is no existing task yet); `name` is an optional display name, max 255 characters.

Answers **201** with the created `site-tasks` documents (one per website that was not skipped) and `meta.skipped`, or **200** with an empty `data` when every website was skipped. The answer carries no `files` include: read the task again (`Show task`) to see its attachments. The uploaded files are moved onto the **first** created task only; every other task receives its own copy a few seconds later, asynchronously - a failed copy move is reported in `meta.warnings`, never fails the call.

* **422**: `sites` missing, empty, over 50 ids, or containing an id that resolves to no row; `title` or `date` missing; an unknown or foreign `files.*.uuid`.
* **403**: a read-only token.
* **404**: the member lacks the `site-tasks.store` permission.

Reference: https://api.docs.modulards.com/modular-ds-public-api/site-tasks/create-tasks

## Authentication

- `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.

## Request

### Body (application/json)

This endpoint expects an object.

- `content` (string, optional)
- `date` (string, optional)
- `files` (list of object, optional)
  - `name` (string, optional)
  - `uuid` (string, optional)
- `is_pending` (boolean, optional)
- `sites` (list of double, optional)
- `time_spent` (double, optional)
- `title` (string, optional)

## Response

### 200

200 OK - every website was skipped

- `data` (list of any, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)
- `meta` (object, optional)
  - `skipped` (list of object, optional)
    - `message` (string, optional)
    - `reason_code` (string, optional)
    - `site_id` (double, optional)
    - `site_name` (any, optional, nullable)
    - `site_task_id` (any, optional, nullable)

### 201

201 Created - one task logged, one website skipped

- `data` (list of object, optional)
  - `attributes` (object, optional)
    - `content` (string, optional)
    - `created_at` (string, optional)
    - `date` (string, optional)
    - `is_pending` (boolean, optional)
    - `site_id` (double, optional)
    - `time_spent` (double, optional)
    - `title` (string, optional)
    - `updated_at` (string, optional)
  - `id` (string, optional)
  - `links` (object, optional)
    - `self` (string, optional)
  - `type` (string, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)
- `meta` (object, optional)
  - `skipped` (list of object, optional)
    - `message` (string, optional)
    - `reason_code` (string, optional)
    - `site_id` (double, optional)
    - `site_name` (any, optional, nullable)
    - `site_task_id` (any, optional, nullable)

## Examples

### 200 OK - every website was skipped

**Request**

```json
undefined
```

**Response**

```json
{
  "data": [],
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "This site is outside your reach.",
        "reason_code": "PERMISSION_DENIED",
        "site_id": 13,
        "site_name": null,
        "site_task_id": null
      }
    ]
  }
}
```

**SDK Code**

```python 200 OK - every website was skipped
import requests

url = "https://api.modulards.com/api/public/v1/site-tasks"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript 200 OK - every website was skipped
const url = 'https://api.modulards.com/api/public/v1/site-tasks';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 200 OK - every website was skipped
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/site-tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 200 OK - every website was skipped
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/site-tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 200 OK - every website was skipped
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/site-tasks")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 OK - every website was skipped
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/site-tasks', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 200 OK - every website was skipped
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/site-tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 200 OK - every website was skipped
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 201 Created - one task logged, one website skipped

**Request**

```json
undefined
```

**Response**

```json
{
  "data": [
    {
      "attributes": {
        "content": "<p>Renewed the certificate through the hosting panel.</p>",
        "created_at": "2026-09-17T09:00:00.000000Z",
        "date": "2026-09-17",
        "is_pending": false,
        "site_id": 12,
        "time_spent": 30,
        "title": "Renew the SSL certificate",
        "updated_at": "2026-09-17T09:00:00.000000Z"
      },
      "id": "501",
      "links": {
        "self": "{{base_url}}/api/public/v1/site-tasks/501"
      },
      "type": "site-tasks"
    }
  ],
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "This site is outside your reach.",
        "reason_code": "PERMISSION_DENIED",
        "site_id": 13,
        "site_name": null,
        "site_task_id": null
      }
    ]
  }
}
```

**SDK Code**

```python 201 Created - one task logged, one website skipped
import requests

url = "https://api.modulards.com/api/public/v1/site-tasks"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript 201 Created - one task logged, one website skipped
const url = 'https://api.modulards.com/api/public/v1/site-tasks';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 201 Created - one task logged, one website skipped
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/site-tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 201 Created - one task logged, one website skipped
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/site-tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 201 Created - one task logged, one website skipped
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/site-tasks")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 201 Created - one task logged, one website skipped
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/site-tasks', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 201 Created - one task logged, one website skipped
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/site-tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 201 Created - one task logged, one website skipped
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create tasks

**Request**

```json
{
  "content": "Renewed the certificate through the hosting panel.",
  "date": "2026-09-17",
  "files": [
    {
      "name": "invoice.png",
      "uuid": "9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f"
    }
  ],
  "is_pending": false,
  "sites": [
    12,
    13
  ],
  "time_spent": 30,
  "title": "Renew the SSL certificate"
}
```

**Response**

```json
{
  "data": [],
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "This site is outside your reach.",
        "reason_code": "PERMISSION_DENIED",
        "site_id": 13,
        "site_name": null,
        "site_task_id": null
      }
    ]
  }
}
```

**SDK Code**

```python Create tasks
import requests

url = "https://api.modulards.com/api/public/v1/site-tasks"

payload = {
    "content": "Renewed the certificate through the hosting panel.",
    "date": "2026-09-17",
    "files": [
        {
            "name": "invoice.png",
            "uuid": "9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f"
        }
    ],
    "is_pending": False,
    "sites": [12, 13],
    "time_spent": 30,
    "title": "Renew the SSL certificate"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create tasks
const url = 'https://api.modulards.com/api/public/v1/site-tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"content":"Renewed the certificate through the hosting panel.","date":"2026-09-17","files":[{"name":"invoice.png","uuid":"9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f"}],"is_pending":false,"sites":[12,13],"time_spent":30,"title":"Renew the SSL certificate"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create tasks
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/site-tasks"

	payload := strings.NewReader("{\n  \"content\": \"Renewed the certificate through the hosting panel.\",\n  \"date\": \"2026-09-17\",\n  \"files\": [\n    {\n      \"name\": \"invoice.png\",\n      \"uuid\": \"9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f\"\n    }\n  ],\n  \"is_pending\": false,\n  \"sites\": [\n    12,\n    13\n  ],\n  \"time_spent\": 30,\n  \"title\": \"Renew the SSL certificate\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create tasks
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/site-tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"Renewed the certificate through the hosting panel.\",\n  \"date\": \"2026-09-17\",\n  \"files\": [\n    {\n      \"name\": \"invoice.png\",\n      \"uuid\": \"9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f\"\n    }\n  ],\n  \"is_pending\": false,\n  \"sites\": [\n    12,\n    13\n  ],\n  \"time_spent\": 30,\n  \"title\": \"Renew the SSL certificate\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create tasks
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/site-tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"Renewed the certificate through the hosting panel.\",\n  \"date\": \"2026-09-17\",\n  \"files\": [\n    {\n      \"name\": \"invoice.png\",\n      \"uuid\": \"9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f\"\n    }\n  ],\n  \"is_pending\": false,\n  \"sites\": [\n    12,\n    13\n  ],\n  \"time_spent\": 30,\n  \"title\": \"Renew the SSL certificate\"\n}")
  .asString();
```

```php Create tasks
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/site-tasks', [
  'body' => '{
  "content": "Renewed the certificate through the hosting panel.",
  "date": "2026-09-17",
  "files": [
    {
      "name": "invoice.png",
      "uuid": "9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f"
    }
  ],
  "is_pending": false,
  "sites": [
    12,
    13
  ],
  "time_spent": 30,
  "title": "Renew the SSL certificate"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create tasks
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/site-tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"Renewed the certificate through the hosting panel.\",\n  \"date\": \"2026-09-17\",\n  \"files\": [\n    {\n      \"name\": \"invoice.png\",\n      \"uuid\": \"9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f\"\n    }\n  ],\n  \"is_pending\": false,\n  \"sites\": [\n    12,\n    13\n  ],\n  \"time_spent\": 30,\n  \"title\": \"Renew the SSL certificate\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create tasks
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "content": "Renewed the certificate through the hosting panel.",
  "date": "2026-09-17",
  "files": [
    [
      "name": "invoice.png",
      "uuid": "9c6a0b1e-3f2d-4b7a-9e21-1a2b3c4d5e6f"
    ]
  ],
  "is_pending": false,
  "sites": [12, 13],
  "time_spent": 30,
  "title": "Renew the SSL certificate"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```