Update a Connection State
Updates the connection state. To update the state, you should pause your connection first.
To update the connection state, do the following:
- Pause connection using Update a Connection endpoint (set 'paused' to 'true').
- Update the state by using the Update Connection State endpoint.
- Unpause the connection by setting the 'paused' parameter to 'false' in the Update a Connection endpoint request.
This endpoint is only supported for Function and Connection SDK connectors.
Request schema
Path parameters
connectionId
stringrequired
The unique identifier of the connection. Retrieve it from the id field in the List All Connections response, or from the id field returned when you Create a Connection.
example:
4107c213907114059a5544ad8fa66c52
Header parameters
Authorization
stringrequired
HTTP: basicAuth
HTTP AuthorizationScheme: basic
Accept
string
default:
application/json;version=2
example:
application/json;version=2
Request
state
object
Http + 1.1
PATCH
https://api.fivetran.com/v1/connections/4107c213907114059a5544ad8fa66c52/state
PATCH /v1/connections/4107c213907114059a5544ad8fa66c52/state HTTP/1.1 Accept: application/json;version=2 Authorization: BasicContent-Type: application/json Host: api.fivetran.com Content-Length: 17 { "state": {} }
Responses
200
Successful response
400
The request body is missing or malformed.
401
Unauthorized error
404
Connection not found error.
405
Not a function connector error. Also returned when an unsupported HTTP method is used.
406
Not acceptable error
409
Connection cannot be updated because the sync is in progress.
415
Unsupported media type error
200
code
stringrequired
Response status code
example:
Success
message
string
Response status text
example:
Connection state has been updated
data
objectrequired
state
objectrequired
A freeform JSON object representing the connector's cursor or internal state. The structure is defined by the connector implementation and varies by connector type. Returns 400 if no state has been written yet.
example:
{
"cursor": "2024-01-01T00:00:00Z"
}
{ "code": "Success", "message": "Connection state has been updated", "data": { "state": { "cursor": "2024-01-01T00:00:00Z" } } }