curl --request PATCH \
--url https://api.withampersand.com/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.withampersand.com/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"
}Authorizations
Path Parameters
The Ampersand project ID or project name.
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"]
Show child attributes
Show child attributes
Response
Connection updated successfully.
The connection ID.
"connection-123"
The Ampersand project ID.
"project-456"
The SaaS provider that this Connection is for.
"salesforce"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The time the connection was created.
"2023-07-13T21:34:44.816354Z"
The authentication scheme used for this connection.
none, apiKey, basic, oauth2/authorizationCode, oauth2/authorizationCodePKCE, oauth2/clientCredentials, oauth2/password "oauth2/authorizationCode"
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"
Show child attributes
Show child attributes
If available, the identifier for the provider workspace (e.g. the Salesforce subdomain)
"provider-workspace-123"
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"
The time the connection was last updated.
"2023-07-13T21:34:44.816354Z"
Show child attributes
Show child attributes
The API key used while making the connection.
"api-key-123"
Show child attributes
Show child attributes
Was this page helpful?

