Skip to content

Integrations

Every service the workspace connects in Settings › Integrations has an endpoint of its own in the API that calls that service’s API on the workspace’s behalf. Digize signs the call in with the connection’s access token or API key, sends it, and hands back what the service answered. Your code never holds the service’s token, and it reaches every endpoint the connection does, not only those Digize’s other operations use.

To Operations
List the services and which are connected GET /api/v1/integrations
Call a connected service’s API POST /api/v1/integrations/<id>/request, such as POST /api/v1/integrations/google_ads/request or POST /api/v1/integrations/meta/request
Upload a file for a call to send POST /api/v1/integrations/files

The key needs settings:write, as connecting a service does: a call can read and change everything the connection can.

From TypeScript, the SDK’s api.integration("google_ads").post(path, { body }) sends the same request.

Terminal window
curl -X POST https://digize.com/api/v1/integrations/google_ads/request \
-H "x-api-key: dgz_live_…" \
-H "content-type: application/json" \
-d '{
"method": "POST",
"url": "/customers/1234567890/googleAds:search",
"body": { "query": "SELECT campaign.id, campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_7_DAYS" }
}'

The body says what to send the service:

Field
method GET (the default), POST, PUT, PATCH or DELETE.
url A full URL under one of the service’s base URLs, or a path starting with /, which goes after the first. Each service’s reference page lists its bases.
query Query parameters, added to any already in url. A list repeats the parameter.
headers Only the headers a service lets a call set, such as Google Ads’ login-customer-id or Shippo’s shippo-api-version. Digize sets the ones that sign in.
body JSON, sent as JSON, up to 200,000 characters; for Twilio and Click2Mail, whose APIs take forms, a flat object of fields. A GET takes none.
content The whole body, sent exactly as given instead of body: an uploaded file or text. See Sending files.
files Uploaded files sent as multipart/form-data, with body’s fields beside them. See Sending files.

A file doesn’t fit in the call’s JSON, so it goes in two steps: upload it, then name it in the call.

  1. POST /api/v1/integrations/files takes the file’s fileName, contentType and size in bytes, and answers with an id and an uploadUrl.
  2. PUT the file to uploadUrl as the request body, with its Content-Length, within half an hour. The URL is signed, so it takes no key.
  3. Name the id in the call’s content or files. Digize streams the file to the service.

Files can be up to 100 MB. An upload is deleted a day after it came; until then a call can send it as often as it needs to, such as on a retry. A call only finds its own workspace’s uploads.

Field
content The whole body: { "upload": "<id>" } sends the file as the type it was uploaded with, or the one type names; { "text": "…", "type": "application/xml" } sends text, up to 200,000 characters (upload anything longer). Not with body or files.
files Up to 10 uploads as multipart/form-data, each { "field": "file", "upload": "<id>" }, with an optional filename (the uploaded one’s name otherwise). body’s fields go in the same form, and a field whose value is an object goes as a JSON part (Content-Type: application/json).
range On content or a files entry, { "first": 0, "last": 4194303 } sends only those bytes of the upload, both included, for a service that takes a file in pieces.
{ "$upload": "<id>" } Anywhere in body, swapped for the file’s bytes as base64, or with "as": "dataUrl" for a data:<type>;base64,… URL, for an API that takes a file inside JSON. Up to 10 MB in all, as each is held whole while the call is made.

Click2Mail’s Batch API takes a PDF of every piece and then an XML of the jobs, each as a PUT’s whole body, to a batch you make first:

Terminal window
# Upload the PDF
curl -X POST https://digize.com/api/v1/integrations/files \
-H "x-api-key: dgz_live_…" \
-H "content-type: application/json" \
-d '{ "fileName": "cards.pdf", "contentType": "application/pdf", "bytes": 2483201 }'
# → { "id": "upload_01J…", "uploadUrl": "https://digize.com/api/files/integration-uploads/…", "expiresAt": "…" }
curl -X PUT "<uploadUrl>" \
-H "content-type: application/pdf" \
--data-binary @cards.pdf
# Make a batch, then send it the PDF and the XML
curl -X POST https://digize.com/api/v1/integrations/click2mail/request \
-H "x-api-key: dgz_live_…" \
-H "content-type: application/json" \
-d '{ "method": "POST", "url": "https://batch.click2mail.com/v1/batches" }'
curl -X POST https://digize.com/api/v1/integrations/click2mail/request \
-H "x-api-key: dgz_live_…" \
-H "content-type: application/json" \
-d '{
"method": "PUT",
"url": "https://batch.click2mail.com/v1/batches/<batch id>",
"content": { "upload": "upload_01J…" }
}'
curl -X POST https://digize.com/api/v1/integrations/click2mail/request \
-H "x-api-key: dgz_live_…" \
-H "content-type: application/json" \
-d '{
"method": "PUT",
"url": "https://batch.click2mail.com/v1/batches/<batch id>",
"content": { "text": "<batch>…</batch>", "type": "application/xml" }
}'

Then a POST to the batch’s URL submits it, which mails it and charges the Click2Mail account. A staging account calls https://stage-batch.click2mail.com instead. Click2Mail’s REST API takes a document in a form:

{
"method": "POST",
"url": "/molpro/documents",
"body": { "documentName": "Cards", "documentClass": "Postcard 4.25 x 6", "documentFormat": "PDF" },
"files": [{ "field": "file", "upload": "upload_01J…" }]
}

Other services’ uploads work the same way, wherever the service takes them on its own API:

  • YouTube: a resumable upload to https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status. The first call is a POST with the video’s details as body; its answer’s location is the session, and a PUT there with content: { "upload": "<id>", "type": "video/mp4" } sends the video.
  • Google Drive, through the Google Sheets connection: a POST to https://www.googleapis.com/upload/drive/v3/files?uploadType=media with the file as content, or a resumable upload as YouTube’s.
  • LinkedIn: POST /images?action=initializeUpload (or /documents?…) answers with an uploadUrl; a PUT to it with the file as content sends it.
  • LinkedIn videos go in parts: POST /videos?action=initializeUpload gives each part’s uploadUrl, firstByte and lastByte. PUT each part with content: { "upload": "<id>", "range": { "first": <firstByte>, "last": <lastByte> } }, then send each answer’s headers.etag, in order, as uploadedPartIds to POST /videos?action=finalizeUpload.
  • Meta: ad images and videos are forms, so they go in files, such as POST /act_<id>/adimages with files: [{ "field": "filename", "upload": "<id>" }]. A chunked video upload sends each chunk as a files entry with its range.
  • Printify: POST /uploads/images.json with body: { "file_name": "design.png", "contents": { "$upload": "<id>" } }.
  • Resend, SendGrid and Mailjet: an attachment’s content is { "$upload": "<id>" }, such as Resend’s attachments: [{ "filename": "invoice.pdf", "content": { "$upload": "<id>" } }].
  • QuickBooks: POST /upload with body: { "file_metadata_01": { "AttachableRef": [{ "EntityRef": { "type": "Invoice", "value": "130" } }], "FileName": "receipt.pdf", "ContentType": "application/pdf" } } and files: [{ "field": "file_content_01", "upload": "<id>" }]. Salesforce’s POST /sobjects/ContentVersion is the same, with entity_content and VersionData.

A call sends one file of up to 100 MB, or a range of one. Where a service hands back a signed address that needs no sign-in, such as Shopify’s staged uploads or Slack’s files.getUploadURLExternal, send the file there yourself, then finish through Digize.

The answer is 200 whenever the service answered, with what it said:

{
"status": 200,
"contentType": "application/json",
"body": { "results": [{ "campaign": { "id": "1", "name": "Spring" } }] },
"truncated": false,
"binary": false,
"location": null,
"headers": { "content-type": "application/json" }
}
  • status is the service’s. A refusal comes back the same way, such as 400 with the service’s own error in body, so check status as you would calling the service yourself.
  • body is JSON as parsed, or text. Past 1,000,000 characters it’s the answer’s start as text and truncated is true: ask for less, such as a smaller page.
  • A file (an image, a PDF, such as a Click2Mail proof) comes back as base64: binary is true and body is the file’s bytes, up to 10 MB. Past that body is null and truncated is true. Some services send a file only when asked, such as Click2Mail with "headers": { "accept": "application/pdf" }.
  • Redirects aren’t followed, so a signed-in call can’t be sent somewhere else; location says where one points.
  • headers are the service’s own, named in lowercase, without cookies, such as an upload part’s etag or a link to the next page.

Digize answers with an error of its own, in the usual shape, when the call never reaches the service: 404 not_found when the service isn’t connected, 400 invalid for a URL outside its bases, a header it can’t set, a body too big or an upload that isn’t there (not finished, or over a day old), 403 forbidden for a key without settings:write, and 503 unavailable when the service doesn’t answer within 30 seconds (5 minutes for a call that sends a file).

Service id
Anthropic anthropic
Browser Use browser_use
Calendly calendly
Click2Mail click2mail
DataForSEO dataforseo
Google Ads google_ads
Google Analytics google_analytics
Google Business Profile google_business
Google Calendar google_calendar
Google Contacts google_contacts
Google Merchant Center google_merchant
Google Search Console google_search_console
Google Sheets google_sheets
HubSpot hubspot
LeadsPlease leadsplease
LinkedIn linkedin_ads
Lulu lulu
Mailjet mailjet
Meta meta
Microsoft Advertising microsoft_ads
OpenAI openai
PCM Integrations pcm
Pinterest pinterest_ads
Printify printify
QuickBooks quickbooks
Resend resend
Salesforce salesforce
SendGrid sendgrid
Shippo shippo
Shopify shopify
Slack slack
Square square
TikTok tiktok_ads
Twilio twilio
Unipile (LinkedIn accounts) unipile
WooCommerce woocommerce
Xero xero
YouTube google_youtube

A call reaches only what the connection was granted: HubSpot, Shopify, Square and Google Contacts were connected to read, so those services refuse changes. Stripe isn’t here; use Stripe’s own API with your own key.

The agent doesn’t use these endpoints. It calls the same services with a read and a write of its own, which AI › Settings holds apart.