Add a connector to your account
magic_transit.connectors.create(ConnectorCreateParams**kwargs) -> ConnectorCreateResponse
POST/accounts/{account_id}/magic/connectors
Add a connector to your account
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Add a connector to your account
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
connector = client.magic_transit.connectors.create(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
device={},
)
print(connector.id){
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"result": {
"id": "id",
"activated": true,
"interrupt_window_days_of_week": [
"Sunday"
],
"interrupt_window_duration_hours": 1,
"interrupt_window_embargo_dates": [
"string"
],
"interrupt_window_hour_of_day": 0,
"last_updated": "last_updated",
"notes": "notes",
"timezone": "timezone",
"device": {
"id": "id",
"serial_number": "serial_number"
},
"last_heartbeat": "last_heartbeat",
"last_seen_version": "last_seen_version",
"license_key": "license_key"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"result": {
"id": "id",
"activated": true,
"interrupt_window_days_of_week": [
"Sunday"
],
"interrupt_window_duration_hours": 1,
"interrupt_window_embargo_dates": [
"string"
],
"interrupt_window_hour_of_day": 0,
"last_updated": "last_updated",
"notes": "notes",
"timezone": "timezone",
"device": {
"id": "id",
"serial_number": "serial_number"
},
"last_heartbeat": "last_heartbeat",
"last_seen_version": "last_seen_version",
"license_key": "license_key"
},
"success": true
}