> 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 connection plugin

POST https://api.modulards.com/api/public/v1/connection-plugins
Content-Type: application/json

Mints a single-use linking token and answers with a presigned download URL for a personalized Modular Connector plugin package: installing it on the website registers the connection with no credentials to enter. The token value itself never travels in the response.

**Body** (JSON):
- `team` (integer, required) - the team the new website joins once the plugin registers it.
- `preset_uptime`, `preset_malware_scan`, `preset_broken_link`, `preset_backup` (integer, nullable) - ids of global configurations to assign the website to as soon as it connects. Any left null is skipped.
- `expires_at` (string, nullable, date) - when the linking token itself expires. Defaults to 24 hours from now; sending a later date is capped at 7 days ahead.

Answers **200** (not a created resource, so no `Location`) with `meta.download_url` (the presigned plugin ZIP download, itself time-limited) and `meta.expires_at` (the linking token's own expiry).

Requires a full-access token (read-only tokens answer 403). A team or preset id that does not belong to your organization answers 404; other validation failures answer 422 with a JSON:API `errors` document.

Reference: https://api.docs.modulards.com/modular-ds-public-api/websites/create-connection-plugin

## 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.

- `expires_at` (any, optional, nullable)
- `preset_backup` (any, optional, nullable)
- `preset_broken_link` (any, optional, nullable)
- `preset_malware_scan` (any, optional, nullable)
- `preset_uptime` (any, optional, nullable)
- `team` (double, optional)

## Response

### 200

200 - Connector download issued

- `jsonapi` (object, optional)
  - `version` (string, optional)
- `meta` (object, optional)
  - `download_url` (string, optional)
  - `expires_at` (string, optional)

## Examples

### 200 - Connector download issued

**Request**

```json
undefined
```

**Response**

```json
{
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "download_url": "https://cdn.modulards.com/connector/download/9f8e7d6c5b4a3210-linking-token.zip",
    "expires_at": "2026-09-24T10:00:00.000000Z"
  }
}
```

**SDK Code**

```python 200 - Connector download issued
import requests

url = "https://api.modulards.com/api/public/v1/connection-plugins"

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

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

print(response.json())
```

```javascript 200 - Connector download issued
const url = 'https://api.modulards.com/api/public/v1/connection-plugins';
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 - Connector download issued
package main

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

func main() {

	url := "https://api.modulards.com/api/public/v1/connection-plugins"

	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 - Connector download issued
require 'uri'
require 'net/http'

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

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 - Connector download issued
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php 200 - Connector download issued
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp 200 - Connector download issued
using RestSharp;

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

```swift 200 - Connector download issued
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/connection-plugins")! 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 connection plugin

**Request**

```json
{
  "expires_at": null,
  "preset_backup": null,
  "preset_broken_link": null,
  "preset_malware_scan": null,
  "preset_uptime": null,
  "team": 1
}
```

**Response**

```json
{
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "download_url": "https://cdn.modulards.com/connector/download/9f8e7d6c5b4a3210-linking-token.zip",
    "expires_at": "2026-09-24T10:00:00.000000Z"
  }
}
```

**SDK Code**

```python Create connection plugin
import requests

url = "https://api.modulards.com/api/public/v1/connection-plugins"

payload = {
    "expires_at": None,
    "preset_backup": None,
    "preset_broken_link": None,
    "preset_malware_scan": None,
    "preset_uptime": None,
    "team": 1
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create connection plugin
const url = 'https://api.modulards.com/api/public/v1/connection-plugins';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"expires_at":null,"preset_backup":null,"preset_broken_link":null,"preset_malware_scan":null,"preset_uptime":null,"team":1}'
};

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

```go Create connection plugin
package main

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

func main() {

	url := "https://api.modulards.com/api/public/v1/connection-plugins"

	payload := strings.NewReader("{\n  \"expires_at\": null,\n  \"preset_backup\": null,\n  \"preset_broken_link\": null,\n  \"preset_malware_scan\": null,\n  \"preset_uptime\": null,\n  \"team\": 1\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 connection plugin
require 'uri'
require 'net/http'

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

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  \"expires_at\": null,\n  \"preset_backup\": null,\n  \"preset_broken_link\": null,\n  \"preset_malware_scan\": null,\n  \"preset_uptime\": null,\n  \"team\": 1\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/connection-plugins")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"expires_at\": null,\n  \"preset_backup\": null,\n  \"preset_broken_link\": null,\n  \"preset_malware_scan\": null,\n  \"preset_uptime\": null,\n  \"team\": 1\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/connection-plugins', [
  'body' => '{
  "expires_at": null,
  "preset_backup": null,
  "preset_broken_link": null,
  "preset_malware_scan": null,
  "preset_uptime": null,
  "team": 1
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create connection plugin
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/connection-plugins");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"expires_at\": null,\n  \"preset_backup\": null,\n  \"preset_broken_link\": null,\n  \"preset_malware_scan\": null,\n  \"preset_uptime\": null,\n  \"team\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create connection plugin
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "expires_at": ,
  "preset_backup": ,
  "preset_broken_link": ,
  "preset_malware_scan": ,
  "preset_uptime": ,
  "team": 1
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/connection-plugins")! 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()
```