SendGrid · Arazzo Workflow

SendGrid List Add Contacts and Count

Version 1.0.0

Create a list, upsert contacts into it, and branch on the list's contact count.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub EmailEmail APIMarketing EmailSMTPT1Transactional EmailEmail MarketingDeliverabilityMarketingArazzoWorkflows

Provider

sendgrid

Workflows

list-add-contacts-and-count
Create a list, upsert contacts, and branch on its contact count.
Creates a list, upserts contacts into it, and reads the list's contact count, branching on whether the list has contacts yet.
3 steps inputs: apiKey, contacts, listName outputs: contactCount, jobId, listId
1
createList
Create a new marketing contacts list.
2
upsertContacts
Upsert the supplied contacts into the new list. The request is queued and returns a 202 with a job_id.
3
countContacts
Read the list's contact count and branch on whether the list already has contacts or is still empty while the upsert job runs.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: SendGrid List Add Contacts and Count
  summary: Create a list, upsert contacts into it, and branch on the list's contact count.
  description: >-
    Builds a contacts list, populates it, and inspects its size. The workflow
    creates a new marketing list, upserts contacts into that list (an
    asynchronous operation that returns a 202 with a job_id), and then reads the
    list's contact count, branching on whether the list is empty or already has
    contacts so the caller can decide whether to poll again for the upsert job.
    Each step inlines its request and bearer token so the flow can be read and
    run without the OpenAPI files.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-420.10
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-420.10
      capability_name: Customer Data Management
      spec: sendgrid-contacts-api-openapi.yml
      confidence: 0.72
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: contactsApi
  url: ../openapi/sendgrid-contacts-api-openapi.yml
  type: openapi
- name: listsApi
  url: ../openapi/sendgrid-lists-api-openapi.yml
  type: openapi
workflows:
- workflowId: list-add-contacts-and-count
  summary: Create a list, upsert contacts, and branch on its contact count.
  description: >-
    Creates a list, upserts contacts into it, and reads the list's contact
    count, branching on whether the list has contacts yet.
  inputs:
    type: object
    required:
    - apiKey
    - listName
    - contacts
    properties:
      apiKey:
        type: string
        description: SendGrid API key sent as a bearer token.
      listName:
        type: string
        description: The name for the new contacts list.
      contacts:
        type: array
        description: Array of contact objects to upsert into the list.
        items:
          type: object
  steps:
  - stepId: createList
    description: Create a new marketing contacts list.
    operationId: CreateMarketingList
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.listName
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      listId: $response.body#/id
  - stepId: upsertContacts
    description: >-
      Upsert the supplied contacts into the new list. The request is queued and
      returns a 202 with a job_id.
    operationId: UpdateContact
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        list_ids:
        - $steps.createList.outputs.listId
        contacts: $inputs.contacts
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      jobId: $response.body#/job_id
  - stepId: countContacts
    description: >-
      Read the list's contact count and branch on whether the list already has
      contacts or is still empty while the upsert job runs.
    operationId: ListContactCount
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: id
      in: path
      value: $steps.createList.outputs.listId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      contactCount: $response.body#/contact_count
    onSuccess:
    - name: hasContacts
      type: end
      criteria:
      - context: $response.body
        condition: $.contact_count > 0
        type: jsonpath
    - name: stillEmpty
      type: end
      criteria:
      - context: $response.body
        condition: $.contact_count == 0
        type: jsonpath
  outputs:
    listId: $steps.createList.outputs.listId
    jobId: $steps.upsertContacts.outputs.jobId
    contactCount: $steps.countContacts.outputs.contactCount

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/sendgrid-list-add-contacts-count-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.