Skip to main content
PUT
/
projects
/
{projectIdOrName}
/
integrations:batch
Batch upsert a group of integrations
curl --request PUT \
  --url https://api.withampersand.com/v1/projects/{projectIdOrName}/integrations:batch \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "sourceZipUrl": "https://storage.googleapis.com/my-bucket/source-files/integration-v1.2.3.zip",
  "sourceYaml": "<string>"
}'
[
  {
    "id": "<string>",
    "projectId": "project-456",
    "name": "read-accounts",
    "provider": "salesforce",
    "createTime": "2023-11-07T05:31:56Z",
    "updateTime": "2023-11-07T05:31:56Z",
    "latestRevision": {
      "id": "revision-id-1",
      "specVersion": "1.0.0",
      "createTime": "2023-11-07T05:31:56Z",
      "content": {
        "name": "<string>",
        "provider": "<string>",
        "displayName": "<string>",
        "module": "<string>",
        "read": {
          "objects": [
            {
              "objectName": "<string>",
              "destination": "<string>",
              "schedule": "<string>",
              "mapToName": "people",
              "mapToDisplayName": "People",
              "requiredFields": [
                {
                  "fieldName": "<string>",
                  "mapToName": "account_id",
                  "mapToDisplayName": "Account ID"
                }
              ],
              "optionalFields": [
                {
                  "fieldName": "<string>",
                  "mapToName": "account_id",
                  "mapToDisplayName": "Account ID"
                }
              ],
              "optionalFieldsAuto": "all",
              "backfill": {
                "defaultPeriod": {
                  "days": 30,
                  "fullHistory": false
                }
              },
              "delivery": {
                "mode": "auto",
                "pageSize": 275
              },
              "enabled": "always"
            }
          ]
        },
        "write": {
          "objects": [
            {
              "objectName": "<string>",
              "inheritMapping": true,
              "valueDefaults": {
                "allowAnyFields": true
              }
            }
          ]
        },
        "proxy": {
          "enabled": true,
          "useModule": true
        },
        "subscribe": {
          "objects": [
            {
              "objectName": "<string>",
              "destination": "<string>",
              "inheritFieldsAndMapping": true,
              "createEvent": {
                "enabled": "always"
              },
              "updateEvent": {
                "enabled": "always",
                "watchFieldsAuto": "all",
                "requiredWatchFields": [
                  [
                    "name",
                    "domain"
                  ]
                ]
              },
              "deleteEvent": {
                "enabled": "always"
              },
              "associationChangeEvent": {
                "enabled": "always",
                "includeFullRecords": true
              },
              "otherEvents": [
                [
                  "object.merged",
                  "object.restored"
                ]
              ]
            }
          ]
        }
      }
    }
  }
]

Authorizations

X-Api-Key
string
header
required

Path Parameters

projectIdOrName
string
required

The Ampersand project ID or project name.

Query Parameters

destructive
boolean

Defaults to false. This flag controls whether to perform destructive actions when deploying integrations, like pausing all read actions for an object that was removed in the latest revision.

Body

application/json

The source of the integrations to upsert. One of sourceZipUrl or sourceYaml is required.

sourceZipUrl
string

URL of where a zip of the source files can be downloaded (e.g. Google Cloud Storage URL).

Example:

"https://storage.googleapis.com/my-bucket/source-files/integration-v1.2.3.zip"

sourceYaml
string

A YAML string that defines the integrations.

Response

Upserted integrations.

id
string
required

The integration ID.

projectId
string
required

The Ampersand project ID.

Example:

"project-456"

name
string
required

The integration name.

Example:

"read-accounts"

provider
string
required

The SaaS provider that this integration connects to.

Example:

"salesforce"

createTime
string<date-time>
required

The time the integration was created.

latestRevision
object
required
updateTime
string<date-time>

The time the integration was last updated.

I