curl --request PATCH \
--url https://api.ampersand.ai/v1/projects/{projectIdOrName}/connections/{connectionId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"updateMask": [
"apiKey"
],
"connection": {
"apiKey": "new-api-key-value"
}
}
'{
"id": "c3a1f9d2-7b4e-4f8a-9e6d-2c5b8a3f1e7d",
"projectId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"provider": "salesforce",
"group": {
"groupRef": "8f2e4a6b-1c3d-4e5f-9a7b-0d8e6f2c4a1b",
"groupName": "my-group"
},
"consumer": {
"consumerRef": "d4e5f6a7-b8c9-4d0e-a1f2-3b4c5d6e7f8a",
"consumerName": "my-consumer"
},
"providerWorkspaceRef": "my-org.my.salesforce.com",
"authScheme": "apiKey",
"status": "working",
"createTime": "2023-07-13T21:34:44.816354Z",
"updateTime": "2024-01-15T10:22:33.000000Z"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Invalid update mask",
"subsystem": "api",
"time": "2024-04-22T18:55:28.456076Z",
"requestId": "89eb1ffb-2a54-4105-aaae-7bf990f1aa69#87715",
"remedy": "Allowed masks: 'providerWorkspaceRef, providerMetadata, apiKey, basicAuth, oauth2ClientCredentials, oauth2PasswordCredentials'",
"retryable": false
}{
"type": "urn:problem-type:exampleOrganization:exampleProblem",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Description of the type of problem that occurred",
"status": 400,
"detail": "Description of specific occurrence of the problem",
"instance": "urn:uuid:123e4567-e89b-12d3-a456-426614174000"
}Update a connection.
Rotate credentials or update metadata (such as the provider workspace reference) for an existing connection.
curl --request PATCH \
--url https://api.ampersand.ai/v1/projects/{projectIdOrName}/connections/{connectionId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"updateMask": [
"apiKey"
],
"connection": {
"apiKey": "new-api-key-value"
}
}
'{
"id": "c3a1f9d2-7b4e-4f8a-9e6d-2c5b8a3f1e7d",
"projectId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"provider": "salesforce",
"group": {
"groupRef": "8f2e4a6b-1c3d-4e5f-9a7b-0d8e6f2c4a1b",
"groupName": "my-group"
},
"consumer": {
"consumerRef": "d4e5f6a7-b8c9-4d0e-a1f2-3b4c5d6e7f8a",
"consumerName": "my-consumer"
},
"providerWorkspaceRef": "my-org.my.salesforce.com",
"authScheme": "apiKey",
"status": "working",
"createTime": "2023-07-13T21:34:44.816354Z",
"updateTime": "2024-01-15T10:22:33.000000Z"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Invalid update mask",
"subsystem": "api",
"time": "2024-04-22T18:55:28.456076Z",
"requestId": "89eb1ffb-2a54-4105-aaae-7bf990f1aa69#87715",
"remedy": "Allowed masks: 'providerWorkspaceRef, providerMetadata, apiKey, basicAuth, oauth2ClientCredentials, oauth2PasswordCredentials'",
"retryable": false
}{
"type": "urn:problem-type:exampleOrganization:exampleProblem",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Description of the type of problem that occurred",
"status": 400,
"detail": "Description of specific occurrence of the problem",
"instance": "urn:uuid:123e4567-e89b-12d3-a456-426614174000"
}Path Parameters
The ID of the connection to update. You can find this via the list connections endpoint.
Body
Specify which fields to update in updateMask and provide corresponding values in connection. Fields in connection not listed in updateMask are ignored.
Fields to update. Each entry must have a corresponding value in connection. Credential fields (apiKey, basicAuth, oauth2ClientCredentials, oauth2PasswordCredentials) must match the connection's existing auth scheme.
providerWorkspaceRef, providerMetadata, apiKey, basicAuth, oauth2ClientCredentials, oauth2PasswordCredentials ["apiKey"]
Response
Connection updated successfully.
The status of the connection.
created: The connection has just been created or the access token was just refreshed.working: The connection has successfully been used to make a request.bad_credentials: The connection encountered credential-related issues when making a request, or when attempting to refresh the access token.
created, working, bad_credentials "working"
If available, the ID that Salesforce/Hubspot uses to identify this user (e.g. Salesforce has IDs in the form of https://login.salesforce.com/id/00D4x0000019CQTEA2/0054x000000orJ4AA)
"provider-consumer-123"
Was this page helpful?

