Skip to content

Code Mode

Code Mode is an alternative to the form-based connector editor. Instead of filling in fields one by one, you define the entire connector as a single JSON object. Use Code Mode when you want to copy configurations between environments, share connector setups with teammates, or manage connectors as code.

Use the form editor for day-to-day setup. Switch to Code Mode when you need to bulk-edit fields, paste a configuration from another environment, or version-control the full connector definition. Switching between the form editor and Code Mode is non-destructive — both views reflect the same connector definition and changes in either view are preserved.

Toggle Code Mode in the connector editor to switch between the visual form and the JSON view:

Code Mode Interface

JSON field reference

The JSON object in Code Mode maps directly to the fields in the form editor. For a description of each field, see Configuration.

JSON keyForm fieldNotes
nameConnection NameRequired
urlEndpoint URLRequired; supports Jinja2
methodHTTP MethodGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
headersHeadersArray of {key, value, overridable} objects
query_parametersQuery ParametersArray of {key, value, overridable} objects
authenticationAuthentication TypeObject with type and config
request_bodyPayload TemplateJinja2 template string
response_bodyResponse BodyJinja2 template for response transformation
response_content_typeResponse Content-TypeContent-Type override for the response

Authentication object

The authentication field takes an object with a type string and a config object whose keys depend on the type. The most common types:

json
// API Key
{
  "type": "apikey",
  "config": {
    "key": "X-API-Key",
    "value": "{{ get_secret('api_key') }}",
    "in": "header"
  }
}

// OAuth Client Credentials
{
  "type": "oauth_client_credentials",
  "config": {
    "client_id": "{{ get_secret('client_id') }}",
    "client_secret": "{{ get_secret('client_secret') }}",
    "token_url": "https://auth.example.com/token"
  }
}

For all supported authentication types and their fields, see Authentication.

Validation on save

When you save in Code Mode, the platform validates the JSON and all field values. If the JSON is not valid, an error appears with the line and column number. If a field value is invalid (for example, an unsupported HTTP method), a field-level error appears next to that field. Fix the errors and save again.

Next Steps

Gainsight CC Developer Portal