Skip to content

Commit 99025e8

Browse files
authored
Add PATCH /data_connectors/:id to OpenAPI spec (#427)
* feat: Add update endpoint for data connectors with request body schema * chore: Remove changelog entries for open API * feat: Add error handling for invalid state in data connector endpoint
1 parent 81c5053 commit 99025e8

2 files changed

Lines changed: 261 additions & 6 deletions

File tree

descriptions/0/api.intercom.io.yaml

Lines changed: 261 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10553,7 +10553,7 @@ paths:
1055310553
- Data Connectors
1055410554
operationId: createDataConnector
1055510555
description: |
10556-
Create a new data connector. The connector is created in `draft` state. Configure its URL, headers, data inputs, and other settings, then publish it to `live` when ready.
10556+
Create a new data connector. The connector is created in `draft` state. Configure its URL, headers, data inputs, and other settings, then set it to `live` when ready.
1055710557
responses:
1055810558
'201':
1055910559
description: Data connector created
@@ -10864,6 +10864,156 @@ paths:
1086410864
message: Access Token Invalid
1086510865
schema:
1086610866
"$ref": "#/components/schemas/error"
10867+
patch:
10868+
summary: Update a data connector
10869+
parameters:
10870+
- name: Intercom-Version
10871+
in: header
10872+
schema:
10873+
"$ref": "#/components/schemas/intercom_version"
10874+
- name: id
10875+
in: path
10876+
required: true
10877+
description: The unique identifier of the data connector.
10878+
example: '12345'
10879+
schema:
10880+
type: string
10881+
tags:
10882+
- Data Connectors
10883+
operationId: updateDataConnector
10884+
description: |
10885+
Update an existing data connector. Only provided fields are changed. Set `state` to `live` or `draft` to change the connector's state.
10886+
requestBody:
10887+
content:
10888+
application/json:
10889+
schema:
10890+
"$ref": "#/components/schemas/update_data_connector_request"
10891+
examples:
10892+
Update name and description:
10893+
summary: Update basic fields
10894+
value:
10895+
name: Updated Connector Name
10896+
description: Updated description
10897+
Set state to live:
10898+
summary: Set a connector to live
10899+
value:
10900+
state: live
10901+
Set state to draft:
10902+
summary: Set a connector to draft
10903+
value:
10904+
state: draft
10905+
responses:
10906+
'200':
10907+
description: Data connector updated
10908+
content:
10909+
application/json:
10910+
examples:
10911+
Data connector updated:
10912+
value:
10913+
type: data_connector
10914+
id: '12345'
10915+
name: Updated Connector Name
10916+
description: Updated description
10917+
state: draft
10918+
http_method: post
10919+
direct_fin_usage: false
10920+
audiences:
10921+
- users
10922+
- leads
10923+
execution_type: server_side
10924+
configuration_response_type: test_response_type
10925+
data_transformation_type:
10926+
client_function_name:
10927+
client_function_timeout_ms:
10928+
data_inputs:
10929+
- name: conversation_id
10930+
type: string
10931+
description: The Intercom conversation ID
10932+
required: true
10933+
default_value: ''
10934+
response_fields: []
10935+
object_mappings: []
10936+
token_ids: []
10937+
customer_authentication: false
10938+
bypass_authentication: false
10939+
validate_missing_attributes: false
10940+
created_by_admin_id: '456'
10941+
updated_by_admin_id: '456'
10942+
created_at: '2025-11-15T09:30:00Z'
10943+
updated_at: '2026-03-24T14:22:15Z'
10944+
execution_results_url: "/data_connectors/12345/execution_results"
10945+
schema:
10946+
"$ref": "#/components/schemas/data_connector_detail"
10947+
'404':
10948+
description: Data connector not found
10949+
content:
10950+
application/json:
10951+
examples:
10952+
Data connector not found:
10953+
value:
10954+
type: error.list
10955+
request_id: b4a45e2c-7a8d-4f3e-9c1a-2d5e8f7a6b3c
10956+
errors:
10957+
- code: data_connector_not_found
10958+
message: Data connector not found
10959+
schema:
10960+
"$ref": "#/components/schemas/error"
10961+
'409':
10962+
description: Conflict
10963+
content:
10964+
application/json:
10965+
examples:
10966+
Data connector in use:
10967+
value:
10968+
type: error.list
10969+
request_id: d6c78e4f-1a2b-3c4d-5e6f-7a8b9c0d1e2f
10970+
errors:
10971+
- code: data_connector_in_use
10972+
message: Data connector is in use by other resources and cannot be set to draft
10973+
schema:
10974+
"$ref": "#/components/schemas/error"
10975+
'422':
10976+
description: Invalid parameter
10977+
content:
10978+
application/json:
10979+
examples:
10980+
Invalid audiences:
10981+
value:
10982+
type: error.list
10983+
request_id: a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
10984+
errors:
10985+
- code: parameter_invalid
10986+
message: "Invalid audiences. Must be a subset of: leads, users, visitors"
10987+
Invalid field value:
10988+
value:
10989+
type: error.list
10990+
request_id: a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
10991+
errors:
10992+
- code: parameter_invalid
10993+
message: "Http Method isn't an option"
10994+
Invalid state:
10995+
value:
10996+
type: error.list
10997+
request_id: a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
10998+
errors:
10999+
- code: parameter_invalid
11000+
message: "Invalid state. Must be one of: draft, live"
11001+
schema:
11002+
"$ref": "#/components/schemas/error"
11003+
'401':
11004+
description: Unauthorized
11005+
content:
11006+
application/json:
11007+
examples:
11008+
Unauthorized:
11009+
value:
11010+
type: error.list
11011+
request_id: test-uuid-replacement
11012+
errors:
11013+
- code: unauthorized
11014+
message: Access Token Invalid
11015+
schema:
11016+
"$ref": "#/components/schemas/error"
1086711017
"/data_connectors/{data_connector_id}/execution_results":
1086811018
get:
1086911019
summary: List execution results for a data connector
@@ -22485,6 +22635,116 @@ components:
2248522635
example: false
2248622636
required:
2248722637
- name
22638+
update_data_connector_request:
22639+
title: Update Data Connector Request
22640+
type: object
22641+
description: |
22642+
Update an existing data connector. All fields are optional — only provided fields will be updated. Set `state` to `live` or `draft` to change the connector's state.
22643+
properties:
22644+
name:
22645+
type: string
22646+
description: The name of the data connector.
22647+
example: Updated Connector Name
22648+
description:
22649+
type: string
22650+
description: A description of what this data connector does.
22651+
example: Updated description
22652+
state:
22653+
type: string
22654+
description: The desired state of the connector.
22655+
enum:
22656+
- draft
22657+
- live
22658+
http_method:
22659+
type: string
22660+
description: The HTTP method used by the data connector.
22661+
enum:
22662+
- get
22663+
- post
22664+
- put
22665+
- delete
22666+
- patch
22667+
example: post
22668+
url:
22669+
type: string
22670+
description: The URL of the external API endpoint. Supports template variables like `{{order_id}}`.
22671+
example: "https://api.example.com/orders/{{order_id}}/status"
22672+
body:
22673+
type: string
22674+
nullable: true
22675+
description: The request body template. Supports template variables.
22676+
direct_fin_usage:
22677+
type: boolean
22678+
description: Whether this connector is used directly by Fin.
22679+
example: false
22680+
audiences:
22681+
type: array
22682+
description: The audience types this connector targets.
22683+
items:
22684+
type: string
22685+
enum:
22686+
- leads
22687+
- users
22688+
- visitors
22689+
example:
22690+
- leads
22691+
- users
22692+
headers:
22693+
type: array
22694+
description: HTTP headers to include in the request.
22695+
items:
22696+
type: object
22697+
properties:
22698+
name:
22699+
type: string
22700+
description: The header name.
22701+
example: Content-Type
22702+
value:
22703+
type: string
22704+
description: The header value. Supports template variables.
22705+
example: application/json
22706+
data_inputs:
22707+
type: array
22708+
description: The input parameters accepted by this data connector. Replaces all existing inputs.
22709+
items:
22710+
type: object
22711+
properties:
22712+
name:
22713+
type: string
22714+
description: The name of the input parameter.
22715+
example: order_id
22716+
type:
22717+
type: string
22718+
description: The data type of the input.
22719+
enum:
22720+
- string
22721+
- integer
22722+
- decimal
22723+
- boolean
22724+
example: string
22725+
description:
22726+
type: string
22727+
description: A description of the input parameter. Required for each input.
22728+
example: The order ID to look up
22729+
required:
22730+
type: boolean
22731+
description: Whether this input is required.
22732+
example: true
22733+
default_value:
22734+
type: string
22735+
description: The default value for this input, if any.
22736+
customer_authentication:
22737+
type: boolean
22738+
description: Whether OTP authentication is enabled for this connector.
22739+
example: false
22740+
bypass_authentication:
22741+
type: boolean
22742+
description: Whether authentication is bypassed for this connector.
22743+
example: false
22744+
validate_missing_attributes:
22745+
type: boolean
22746+
description: Whether to validate missing attributes before execution.
22747+
example: true
2248822748
data_connector:
2248922749
title: Data Connector
2249022750
type: object

descriptions/0/changelog.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)