SendGrid · Arazzo Workflow

SendGrid Suppression Group Add

Version 1.0.0

Create an unsubscribe suppression group, add addresses to it, and list its suppressions.

1 workflow 1 source API 1 provider
View Spec View on GitHub EmailEmail APIMarketing EmailSMTPT1Transactional EmailArazzoWorkflows

Provider

sendgrid

Workflows

suppression-group-add
Create an unsubscribe group, add suppressions, and list them.
Creates a suppression group, adds email addresses to it, and lists the group's suppressions to confirm.
3 steps inputs: apiKey, emails, groupDescription, groupName outputs: addedEmails, groupId, suppressions
1
createGroup
CreatAsmGroup
Create a new unsubscribe suppression group.
2
addSuppressions
AddSuppressionToAsmGroup
Add the supplied email addresses to the new suppression group so they are suppressed for mail tagged with the group.
3
listSuppressions
ListSuppressionFromAsmGroup
List the group's suppressions to confirm the addresses were added.

Source API Descriptions

Arazzo Workflow Specification

sendgrid-suppression-group-add-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: SendGrid Suppression Group Add
  summary: Create an unsubscribe suppression group, add addresses to it, and list its suppressions.
  description: >-
    Builds an unsubscribe group and populates it. The workflow creates a new
    suppression (unsubscribe) group, adds one or more email addresses to that
    group so they are suppressed for mail tagged with the group, and then lists
    the group's suppressions to confirm. Group creation returns 201, adding
    suppressions returns 201, and listing returns 200. Each step inlines its
    request and bearer token so the flow can be read and run without the OpenAPI
    files.
  version: 1.0.0
sourceDescriptions:
- name: suppressionsApi
  url: ../openapi/tsg_suppressions_v3.yaml
  type: openapi
workflows:
- workflowId: suppression-group-add
  summary: Create an unsubscribe group, add suppressions, and list them.
  description: >-
    Creates a suppression group, adds email addresses to it, and lists the
    group's suppressions to confirm.
  inputs:
    type: object
    required:
    - apiKey
    - groupName
    - groupDescription
    - emails
    properties:
      apiKey:
        type: string
        description: SendGrid API key sent as a bearer token.
      groupName:
        type: string
        description: The name of the new suppression group.
      groupDescription:
        type: string
        description: A brief description of the suppression group.
      emails:
        type: array
        description: Email addresses to add to the suppression group.
        items:
          type: string
  steps:
  - stepId: createGroup
    description: Create a new unsubscribe suppression group.
    operationId: CreatAsmGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.groupName
        description: $inputs.groupDescription
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      groupId: $response.body#/id
  - stepId: addSuppressions
    description: >-
      Add the supplied email addresses to the new suppression group so they are
      suppressed for mail tagged with the group.
    operationId: AddSuppressionToAsmGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: group_id
      in: path
      value: $steps.createGroup.outputs.groupId
    requestBody:
      contentType: application/json
      payload:
        recipient_emails: $inputs.emails
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      recipientEmails: $response.body#/recipient_emails
  - stepId: listSuppressions
    description: List the group's suppressions to confirm the addresses were added.
    operationId: ListSuppressionFromAsmGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: group_id
      in: path
      value: $steps.createGroup.outputs.groupId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      suppressions: $response.body
  outputs:
    groupId: $steps.createGroup.outputs.groupId
    addedEmails: $steps.addSuppressions.outputs.recipientEmails
    suppressions: $steps.listSuppressions.outputs.suppressions