SendGrid · Capability

Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2

Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2. 6 operations. Lead operation: Create Segment. Self-contained Naftiko capability covering one Sendgrid business surface.

Run with Naftiko SendgridSegmenting Contacts V2

What You Can Do

POST
Createsegment — Create Segment
/v1/v3/marketing/segments/2-0
GET
Listsegment — Get List of Segments
/v1/v3/marketing/segments/2-0
POST
Refreshsegment — Manually refresh a segment
/v1/v3/marketing/segments/2-0/refresh/{segment-id}
PATCH
Updatesegment — Update Segment
/v1/v3/marketing/segments/2-0/{segment-id}
GET
Getsegment — Get Segment by ID
/v1/v3/marketing/segments/2-0/{segment-id}
DELETE
Deletesegment — Delete segment
/v1/v3/marketing/segments/2-0/{segment-id}

MCP Tools

create-segment

Create Segment

get-list-segments

Get List of Segments

read-only idempotent
manually-refresh-segment

Manually refresh a segment

update-segment

Update Segment

idempotent
get-segment-id

Get Segment by ID

read-only idempotent
delete-segment

Delete segment

idempotent

Capability Spec

tsg_mc_segments_2.0_v3-segmenting-contacts-v2.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2
  description: 'Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2. 6 operations. Lead operation:
    Create Segment. Self-contained Naftiko capability covering one Sendgrid business surface.'
  tags:
  - Sendgrid
  - Segmenting Contacts V2
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SENDGRID_API_KEY: SENDGRID_API_KEY
capability:
  consumes:
  - type: http
    namespace: tsg_mc_segments_2.0_v3-segmenting-contacts-v2
    baseUri: https://api.sendgrid.com
    description: Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2 business capability. Self-contained,
      no shared references.
    resources:
    - name: v3-marketing-segments-2.0
      path: /v3/marketing/segments/2.0
      operations:
      - name: createsegment
        method: POST
        description: Create Segment
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: listsegment
        method: GET
        description: Get List of Segments
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ids
          in: query
          type: array
          description: A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids`
            parameters are ignored and only segments with
        - name: parent_list_ids
          in: query
          type: string
          description: A comma separated list up to 50 in size, to filter segments on.  Only segments that have any of these
            list ids as the parent list will be retrieved. This is dif
        - name: no_parent_list_id
          in: query
          type: boolean
          description: If set to `true`, segments with an empty value of `parent_list_id` will be returned in the filter.  If
            the value is not present, it defaults to 'false'.
    - name: v3-marketing-segments-2.0-refresh-segment_id
      path: /v3/marketing/segments/2.0/refresh/{segment_id}
      operations:
      - name: refreshsegment
        method: POST
        description: Manually refresh a segment
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: segment_id
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: v3-marketing-segments-2.0-segment_id
      path: /v3/marketing/segments/2.0/{segment_id}
      operations:
      - name: updatesegment
        method: PATCH
        description: Update Segment
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: getsegment
        method: GET
        description: Get Segment by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: contacts_sample
          in: query
          type: boolean
          description: Defaults to `true`. Set to `false` to exclude the contacts_sample in the response.
      - name: deletesegment
        method: DELETE
        description: Delete segment
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      token: '{{env.SENDGRID_API_KEY}}'
  exposes:
  - type: rest
    namespace: tsg_mc_segments_2.0_v3-segmenting-contacts-v2-rest
    port: 8080
    description: REST adapter for Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2. One Spectral-compliant
      resource per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/v3/marketing/segments/2-0
      name: v3-marketing-segments-2-0
      description: REST surface for v3-marketing-segments-2.0.
      operations:
      - method: POST
        name: createsegment
        description: Create Segment
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.createsegment
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: listsegment
        description: Get List of Segments
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.listsegment
        with:
          ids: rest.ids
          parent_list_ids: rest.parent_list_ids
          no_parent_list_id: rest.no_parent_list_id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v3/marketing/segments/2-0/refresh/{segment-id}
      name: v3-marketing-segments-2-0-refresh-segment-id
      description: REST surface for v3-marketing-segments-2.0-refresh-segment_id.
      operations:
      - method: POST
        name: refreshsegment
        description: Manually refresh a segment
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.refreshsegment
        with:
          segment_id: rest.segment_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v3/marketing/segments/2-0/{segment-id}
      name: v3-marketing-segments-2-0-segment-id
      description: REST surface for v3-marketing-segments-2.0-segment_id.
      operations:
      - method: PATCH
        name: updatesegment
        description: Update Segment
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.updatesegment
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: getsegment
        description: Get Segment by ID
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.getsegment
        with:
          contacts_sample: rest.contacts_sample
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletesegment
        description: Delete segment
        call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.deletesegment
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: tsg_mc_segments_2.0_v3-segmenting-contacts-v2-mcp
    port: 9090
    transport: http
    description: MCP adapter for Twilio SendGrid Marketing Campaigns Segments 2.0 API — Segmenting Contacts V2. One tool per
      consumed operation, routed inline through this capability's consumes block.
    tools:
    - name: create-segment
      description: Create Segment
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.createsegment
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-list-segments
      description: Get List of Segments
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.listsegment
      with:
        ids: tools.ids
        parent_list_ids: tools.parent_list_ids
        no_parent_list_id: tools.no_parent_list_id
      outputParameters:
      - type: object
        mapping: $.
    - name: manually-refresh-segment
      description: Manually refresh a segment
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.refreshsegment
      with:
        segment_id: tools.segment_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: update-segment
      description: Update Segment
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.updatesegment
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-segment-id
      description: Get Segment by ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.getsegment
      with:
        contacts_sample: tools.contacts_sample
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-segment
      description: Delete segment
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: tsg_mc_segments_2.0_v3-segmenting-contacts-v2.deletesegment
      outputParameters:
      - type: object
        mapping: $.