Skip to main content
Version: Next

Linear

Linear source connector

Description​

The Linear source connector reads data from the Linear GraphQL API. It is based on the HTTP source connector and sends the configured api_key as the Authorization request header, as required by the Linear API.

Key Features​

Source Options​

NameTypeRequiredDefaultDescription
urlStringYes-Linear API endpoint URL, usually https://api.linear.app/graphql.
api_keyStringYes-Linear API key. The connector sends it verbatim as the Authorization request header value; no Bearer prefix is added, so OAuth access tokens must be configured as api_key = "Bearer <token>".
methodStringNogetHTTP request method. Supported values are GET and POST.
headersMapNo-Extra HTTP headers. Any Authorization entry here is always replaced by the value of api_key.
paramsMapNo-Query parameters sent with the request.
bodyStringNo-HTTP request body. Usually used with method = "POST" to send a GraphQL query.
formatStringNotextResponse format. Use json when reading the GraphQL response into a SeaTunnel schema; use text to return the raw response as content. The shared HTTP option also accepts binary, but binary is not supported by the Linear source and binary_chunk_size has no effect here.
schemaConfigNo-Output schema. Required when format = "json".
schema.fieldsConfigNo-Field names and SeaTunnel data types used to parse the JSON response.
content_fieldStringNo-JSONPath used to select a nested part of the response before parsing it with schema, for example $.data.issues.nodes.*.
json_fieldConfigNo-Field-level JSONPath mapping. Use it with schema when output fields come from different JSON paths.
retryIntNo-Maximum retry times when the HTTP request fails with an IOException.
retry_backoff_multiplier_msIntNo100Retry backoff multiplier in milliseconds. Takes effect only when retry is configured.
retry_backoff_max_msIntNo10000Maximum retry backoff in milliseconds. Takes effect only when retry is configured.
enable_multi_linesBooleanNofalseWhen true, multiple JSON objects separated by newlines in the response body are treated as separate records.
keep_params_as_formBooleanNofalseWhen true, request parameters are sent as form-encoded body parameters instead of URL query parameters.
connect_timeout_msIntNo12000HTTP connection timeout in milliseconds.
socket_timeout_msIntNo60000HTTP socket timeout in milliseconds.
json_filed_missed_return_nullBooleanNofalseReturn null when a configured JSON field is missing.
common-optionsConfigNo-Source plugin common parameters. See Source Common Options.
tip

api_key is a sensitive credential. Unlike options such as password or access_key, api_key is not masked in parsed-config logs and is not encrypted or decrypted by default. To protect the value, add api_key to env.shade.options and encrypt it with the configured shade.identifier. See Config Encryption and Decryption.

Usage Notes​

  • The plugin name in the job configuration is Linear.
  • Set format = "json" and configure schema when you want typed SeaTunnel rows.
  • Use content_field to unwrap the GraphQL envelope, for example $.data.issues.nodes.*, before parsing with schema.
  • Use json_field only when each output field needs its own JSONPath expression.
  • Pagination is not supported by this connector. Each job reads only what a single request returns; the HTTP pageing block and its options have no effect here.
  • api_key is sent verbatim as the Authorization header value and always overrides any Authorization entry in headers. Put only other custom headers in headers.

Task Examples​

Read Issues​

env {
parallelism = 1
job.mode = "BATCH"
}

source {
Linear {
url = "https://api.linear.app/graphql"
api_key = "<your_linear_api_key>"
method = "POST"
body = "{\"query\": \"{ issues { nodes { id title } } }\"}"
format = "json"
content_field = "$.data.issues.nodes.*"
schema = {
fields {
id = string
title = string
}
}
plugin_output = "linear_data"
}
}

sink {
Console {
}
}

Extract Fields With JSONPath​

env {
parallelism = 1
job.mode = "BATCH"
}

source {
Linear {
url = "https://api.linear.app/graphql"
api_key = "<your_linear_api_key>"
method = "POST"
body = "{\"query\": \"{ issues { nodes { id title } } }\"}"
format = "json"
json_field = {
id = "$.data.issues.nodes[*].id"
title = "$.data.issues.nodes[*].title"
}
schema = {
fields {
id = string
title = string
}
}
}
}

Changelog​

Change Log
ChangeCommitVersion
[Feature][Connector-V2] Add Linear HTTP source connectorhttps://github.com/apache/seatunnel/commit/56cfbca0fbNext