---
title: "API schemas: part 3"
description: "API input and response JSON Schema: CreateDataSourceConnectionRequest — SyncRunList. Fields, required properties and API constraints."
group: "Technical documentation"
order: 47
---

## Deployment addresses

- Documentation: https://ctx4.me/docs.md
- Agent index: https://ctx4.me/docs/agent-index.json
- Console and connections: https://console.ctx4.me/integrations
- MCP: https://ctx4.me/mcp
- HTTP API: https://ctx4.me/v1
- Composio base URL: https://ctx4.me/compat/context4/v1
- OpenAPI: https://ctx4.me/docs/openapi.json
- HTTP/MCP inventory: https://ctx4.me/docs/api-index.json
- Composio routes: https://ctx4.me/docs/compat-routes.json
- Connectors: https://ctx4.me/docs/connectors.json


# API schemas: part 3

Exact field names, required, enum, nullable and constraints are preserved from [OpenAPI](https://ctx4.me/docs/openapi.json). `$ref` resolves relative to `components.schemas` in the full document. All parts: [1](https://ctx4.me/docs/api-schemas-1.md), [2](https://ctx4.me/docs/api-schemas-2.md), [3](https://ctx4.me/docs/api-schemas-3.md), [4](https://ctx4.me/docs/api-schemas-4.md).

## CreateDataSourceConnectionRequest


```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
    },
    "network_attachment_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "source": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "database": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "sqlserver"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "username_password"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "host",
            "port",
            "database",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "database": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "postgres"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "username_password"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "host",
            "port",
            "database",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "database": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "mysql"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "username_password"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "host",
            "port",
            "database",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "database": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "mongodb"
              ]
            },
            "replica_set": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "authentication": {
              "type": "string",
              "enum": [
                "username_password"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "host",
            "port",
            "database",
            "tls",
            "kind",
            "replica_set",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            },
            "port": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535
            },
            "database": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "mongodb"
              ]
            },
            "replica_set": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "authentication": {
              "type": "string",
              "enum": [
                "x509"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {},
              "additionalProperties": false
            }
          },
          "required": [
            "host",
            "port",
            "database",
            "tls",
            "kind",
            "replica_set",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "bootstrap_servers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "host": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  }
                },
                "required": [
                  "host",
                  "port"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 20
            },
            "topic": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "topic"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "sasl_scram_256"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "bootstrap_servers",
            "topic",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "bootstrap_servers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "host": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  }
                },
                "required": [
                  "host",
                  "port"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 20
            },
            "topic": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "topic"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "sasl_scram_512"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "password": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "username",
                "password"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "bootstrap_servers",
            "topic",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "bootstrap_servers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "host": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  }
                },
                "required": [
                  "host",
                  "port"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 20
            },
            "topic": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tls": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "require"
                      ]
                    }
                  },
                  "required": [
                    "mode"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "verify_ca",
                        "verify_full"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mutual_tls"
                      ]
                    },
                    "ca_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_certificate": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    },
                    "client_key": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "mode",
                    "ca_certificate",
                    "client_certificate",
                    "client_key"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "topic"
              ]
            },
            "authentication": {
              "type": "string",
              "enum": [
                "mutual_tls"
              ]
            },
            "credential": {
              "type": "object",
              "properties": {},
              "additionalProperties": false
            }
          },
          "required": [
            "bootstrap_servers",
            "topic",
            "tls",
            "kind",
            "authentication",
            "credential"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "name",
    "source"
  ],
  "additionalProperties": false,
  "description": "Typed source settings; raw DSNs, secret references, connector configs, and executable content are not accepted"
}
```

## ReplaceDataSourceCredentialRequest


```json
{
  "type": "object",
  "properties": {
    "credential": {
      "type": "object",
      "properties": {
        "username": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "username",
        "password"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "credential"
  ],
  "additionalProperties": false,
  "description": "A new username and password for a password-authenticated source; stored as the next secret version and never returned"
}
```

## SourceSchema


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "source_connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "source_technology": {
      "type": "string",
      "enum": [
        "postgres",
        "mysql",
        "mongodb",
        "sqlserver",
        "topic"
      ]
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "entities": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "key_fields": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "maxItems": 64
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "nullable": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "type",
                "nullable"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 2000
          }
        },
        "required": [
          "name",
          "key_fields",
          "fields"
        ],
        "additionalProperties": false
      },
      "maxItems": 500
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
      },
      "maxItems": 64
    },
    "incomplete": {
      "type": "boolean"
    },
    "compatibility": {
      "type": "string",
      "enum": [
        "initial",
        "compatible",
        "breaking"
      ]
    },
    "breaking_reasons": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
      },
      "maxItems": 2000
    },
    "predecessor_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "id",
    "source_connection_id",
    "source_technology",
    "version",
    "hash",
    "entities",
    "capabilities",
    "incomplete",
    "compatibility",
    "breaking_reasons",
    "predecessor_id",
    "created_at"
  ],
  "additionalProperties": false
}
```

## ProviderSchema


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "connector_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "entity": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "key_fields": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 1
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "provider_name": {
            "type": "string",
            "minLength": 1
          },
          "definition": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "name",
          "provider_name",
          "definition"
        ],
        "additionalProperties": false
      },
      "minItems": 1
    },
    "predecessor_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "id",
    "connection_id",
    "connector_id",
    "entity",
    "version",
    "hash",
    "key_fields",
    "fields",
    "predecessor_id",
    "created_at"
  ],
  "additionalProperties": false
}
```

## ToolSessionWithMcp

Related schemas: [EndUserRef](https://ctx4.me/docs/api-schemas-2.md#enduserref), [SessionTool](https://ctx4.me/docs/api-schemas-3.md#sessiontool).

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "connection_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "user_id": {
      "$ref": "#/components/schemas/EndUserRef"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "expired",
        "revoked"
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SessionTool"
      }
    },
    "disabled_tools": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
      }
    },
    "connections": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "connection_id": {
              "type": "string",
              "format": "uuid",
              "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
            },
            "alias": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 64
            }
          },
          "required": [
            "connection_id",
            "alias"
          ],
          "additionalProperties": false
        }
      }
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "max_calls": {
      "type": [
        "integer",
        "null"
      ],
      "exclusiveMinimum": 0
    },
    "calls_used": {
      "type": "integer",
      "minimum": 0
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "mcp_url": {
      "type": "string",
      "maxLength": 2048,
      "format": "uri"
    }
  },
  "required": [
    "id",
    "connection_id",
    "user_id",
    "status",
    "tools",
    "disabled_tools",
    "connections",
    "expires_at",
    "max_calls",
    "calls_used",
    "version",
    "created_at",
    "updated_at",
    "mcp_url"
  ],
  "additionalProperties": false
}
```

## SessionTool


```json
{
  "type": "object",
  "properties": {
    "tool_id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
    },
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "connector_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "operation_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    }
  },
  "required": [
    "tool_id",
    "connector_id",
    "connector_version",
    "operation_id",
    "connection_id"
  ],
  "additionalProperties": false
}
```

## CreateToolSessionRequest

Related schemas: [EndUserRef](https://ctx4.me/docs/api-schemas-2.md#enduserref).

```json
{
  "type": "object",
  "properties": {
    "connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "user_id": {
      "$ref": "#/components/schemas/EndUserRef"
    },
    "tool_allowlist": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
      },
      "minItems": 1,
      "maxItems": 200
    },
    "ttl_seconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 86400
    },
    "max_calls": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 10000
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "connection_id"
      ]
    },
    {
      "required": [
        "user_id"
      ]
    }
  ],
  "description": "Creates a tool session. With a pinned connection the snapshot derives from connection ∩ catalog ∩ policy ∩ allowlist and is immutable afterwards; without one the session starts empty and fills as accounts are connected to it"
}
```

## ToolSession

Related schemas: [EndUserRef](https://ctx4.me/docs/api-schemas-2.md#enduserref), [SessionTool](https://ctx4.me/docs/api-schemas-3.md#sessiontool).

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "connection_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "user_id": {
      "$ref": "#/components/schemas/EndUserRef"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "expired",
        "revoked"
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SessionTool"
      }
    },
    "disabled_tools": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
      }
    },
    "connections": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "connection_id": {
              "type": "string",
              "format": "uuid",
              "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
            },
            "alias": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 64
            }
          },
          "required": [
            "connection_id",
            "alias"
          ],
          "additionalProperties": false
        }
      }
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "max_calls": {
      "type": [
        "integer",
        "null"
      ],
      "exclusiveMinimum": 0
    },
    "calls_used": {
      "type": "integer",
      "minimum": 0
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "id",
    "connection_id",
    "user_id",
    "status",
    "tools",
    "disabled_tools",
    "connections",
    "expires_at",
    "max_calls",
    "calls_used",
    "version",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

## PatchToolSessionRequest


```json
{
  "type": "object",
  "properties": {
    "expected_version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "disable": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
      },
      "minItems": 1,
      "maxItems": 200
    },
    "enable": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
      },
      "minItems": 1,
      "maxItems": 200
    }
  },
  "required": [
    "expected_version"
  ],
  "additionalProperties": false,
  "description": "Bounded session mutation: enable/disable tools within the immutable snapshot, CAS-guarded by expected_version"
}
```

## SessionToolListResponse

Related schemas: [SessionToolDetail](https://ctx4.me/docs/api-schemas-3.md#sessiontooldetail).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SessionToolDetail"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

## SessionToolDetail


```json
{
  "type": "object",
  "properties": {
    "tool_id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.-]{1,239}$"
    },
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "connector_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "operation_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "display_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "input_schema": {}
  },
  "required": [
    "tool_id",
    "connector_id",
    "connector_version",
    "operation_id",
    "connection_id",
    "display_name",
    "description"
  ],
  "additionalProperties": false
}
```

## SyncDeliveryAuthority


```json
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "number",
      "enum": [
        1
      ]
    },
    "context4OrganizationId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,200}$"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "syncId": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "entity": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
    },
    "resourceKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "deliveryGrants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "deliveryGrantId": {
            "type": "string",
            "format": "uuid",
            "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
          },
          "deliveryGeneration": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "retiring",
              "revoked"
            ]
          },
          "retiringExpiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-16T12:00:00.000Z"
          },
          "revocationBarriers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partition": {
                  "type": "integer",
                  "minimum": 0
                },
                "offset": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,18})$"
                }
              },
              "required": [
                "partition",
                "offset"
              ],
              "additionalProperties": false
            },
            "maxItems": 1024
          }
        },
        "required": [
          "deliveryGrantId",
          "deliveryGeneration",
          "state",
          "retiringExpiresAt",
          "revocationBarriers"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 8
    },
    "sourceEpoch": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "sourceEpochTransition": {
      "type": "string",
      "enum": [
        "continuation",
        "replacement-snapshot",
        "incompatible-reset"
      ]
    },
    "authorityRevision": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "active": {
      "type": "boolean"
    }
  },
  "required": [
    "schemaVersion",
    "context4OrganizationId",
    "workspaceId",
    "syncId",
    "entity",
    "resourceKey",
    "deliveryGrants",
    "sourceEpoch",
    "sourceEpochTransition",
    "authorityRevision",
    "active"
  ],
  "additionalProperties": false
}
```

## Sync

Related schemas: [DataSourceAttentionReason](https://ctx4.me/docs/api-schemas-2.md#datasourceattentionreason).

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "connection_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "source_kind": {
      "type": "string",
      "enum": [
        "api_poll",
        "database_cdc",
        "database_poll",
        "topic"
      ]
    },
    "database_poll": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "table": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "minItems": 1,
          "maxItems": 256
        },
        "primary_key": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "minItems": 1,
          "maxItems": 16
        },
        "mode": {
          "type": "string",
          "enum": [
            "full_scan",
            "rowversion",
            "timestamp"
          ]
        },
        "watermark_column": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 128
        },
        "full_reconciliation_minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10080
        },
        "timestamp_overlap_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400
        },
        "deletion_policy": {
          "type": "string",
          "enum": [
            "preserve",
            "confirm_missing"
          ]
        },
        "config_revision": {
          "type": "integer",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "schema",
        "table",
        "columns",
        "primary_key",
        "mode",
        "watermark_column",
        "full_reconciliation_minutes",
        "timestamp_overlap_seconds",
        "deletion_policy",
        "config_revision"
      ],
      "additionalProperties": false
    },
    "entity": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
    },
    "strategy": {
      "type": "string",
      "enum": [
        "incremental",
        "snapshot-diff"
      ]
    },
    "schedule_minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10080
    },
    "schedule_clamped": {
      "type": "boolean"
    },
    "requested_schedule_minutes": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 10080
    },
    "status": {
      "type": "string",
      "enum": [
        "enabled",
        "paused",
        "deleted"
      ]
    },
    "source_health": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "phase": {
          "type": "string",
          "enum": [
            "gateway_connecting",
            "source_connecting",
            "snapshotting",
            "streaming",
            "paused",
            "failed"
          ]
        },
        "classified_error": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 120
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-07-16T12:00:00.000Z"
        },
        "artifacts": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "state": {
              "type": "string",
              "minLength": 1,
              "maxLength": 16,
              "description": "One of `held`, `released`, `orphaned`, `absent`.",
              "example": "held"
            },
            "since": {
              "type": "string",
              "format": "date-time",
              "example": "2026-07-16T12:00:00.000Z"
            }
          },
          "required": [
            "state",
            "since"
          ],
          "additionalProperties": false,
          "description": "The PostgreSQL replication slot and publication this CDC sync holds on its source, and since when it is in that state: `held`; `released` — the sync stayed paused past the pause limit or failed past the failed-slot grace, so the slot was dropped and the next start takes a fresh snapshot; `orphaned` — a release gave up and the source's DBA must drop the slot; `absent` — nothing was left to release. Null for a source that holds none."
        }
      },
      "required": [
        "phase",
        "classified_error",
        "updated_at",
        "artifacts"
      ],
      "additionalProperties": false
    },
    "source_attention": {
      "$ref": "#/components/schemas/DataSourceAttentionReason"
    },
    "last_run_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "next_run_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "id",
    "connector_id",
    "connection_id",
    "source_kind",
    "entity",
    "strategy",
    "schedule_minutes",
    "schedule_clamped",
    "requested_schedule_minutes",
    "status",
    "source_health",
    "last_run_at",
    "next_run_at",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

## SyncList

Related schemas: [Sync](https://ctx4.me/docs/api-schemas-3.md#sync).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Sync"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400,
      "description": "Cursor for the next page; null when exhausted"
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

## SyncTestFire


```json
{
  "type": "object",
  "properties": {
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "external_id",
          "payload"
        ],
        "additionalProperties": false
      }
    },
    "estimated_total": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    }
  },
  "required": [
    "records",
    "estimated_total"
  ],
  "additionalProperties": false
}
```

## SyncRunList

Related schemas: [SyncRun](https://ctx4.me/docs/api-schemas-4.md#syncrun).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SyncRun"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400,
      "description": "Cursor for the next page; null when exhausted"
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

