AffiliateRail Messaging API

The Messaging API from AffiliateRail — 6 operation(s) for messaging.

Operations 6

GET /v1/campaigns List campaigns #
GET /v1/campaigns/{id} Retrieve a campaign #
POST /v1/campaigns/{id}/send Send a campaign #
GET /v1/sequences List sequences #
POST /v1/sequences/{id}/pause Pause a sequence #
POST /v1/sequences/{id}/resume Resume a sequence #

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • 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 API
curl "https://apis.io/api/v1/apis/affiliaterail-com:affiliaterail-com-messaging-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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.

OpenAPI Specification

affiliaterail-com-messaging-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Affiliaterail Com Messaging API
  version: '2026-08-21'
  description: 'Operations tagged Messaging across 2 of this provider''s published API definitions: affiliaterail-com-docs-openapi.json, affiliaterail-com-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.affiliaterail.com
  description: Production
tags:
- name: Messaging
paths:
  /v1/campaigns:
    get:
      tags:
      - Messaging
      summary: List campaigns
      description: 'Newest first, with delivery stats. Drafts are composed in the dashboard.


        **Scope:** `read`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
        required: true
        name: program_id
        in: query
      responses:
        '200':
          description: Campaigns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: getV1Campaigns
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/campaigns/{id}:
    get:
      tags:
      - Messaging
      summary: Retrieve a campaign
      description: '**Scope:** `read`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?camp_
        required: true
        name: id
        in: path
      - schema:
          type: string
        required: true
        name: program_id
        in: query
      responses:
        '200':
          description: The campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: getV1CampaignsById
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/campaigns/{id}/send:
    post:
      tags:
      - Messaging
      summary: Send a campaign
      description: 'Sends a draft or paused campaign now, to the audience saved on it: the audience is queued atomically and the sender runs exactly as the dashboard''s Send button. Refused when nobody matches the audience or the campaign is not sendable from its current state.


        **Scope:** `write`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?camp_
        required: true
        name: id
        in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignSend'
      responses:
        '200':
          description: The campaign, now sending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postV1CampaignsByIdSend
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/sequences:
    get:
      tags:
      - Messaging
      summary: List sequences
      description: 'Every sequence with its trigger, step count and enrolment counts.


        **Scope:** `read`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
        required: true
        name: program_id
        in: query
      responses:
        '200':
          description: Sequences
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SequenceList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: getV1Sequences
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/sequences/{id}/pause:
    post:
      tags:
      - Messaging
      summary: Pause a sequence
      description: 'Nobody is dropped: a paused sequence advances nobody, and resuming carries each partner on from the step they were on.


        **Scope:** `write`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?seq_
        required: true
        name: id
        in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SequenceAction'
      responses:
        '200':
          description: The paused sequence
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postV1SequencesByIdPause
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/sequences/{id}/resume:
    post:
      tags:
      - Messaging
      summary: Resume a sequence
      description: 'Turns a paused sequence back on. Each enrolled partner carries on from the step they were on.


        **Scope:** `write`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?seq_
        required: true
        name: id
        in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SequenceResume'
      responses:
        '200':
          description: The active sequence
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or unknown API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Key lacks the required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such object in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request was understood and refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Rate limited: see Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postV1SequencesByIdResume
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
components:
  schemas:
    SequenceResume:
      type: object
      properties:
        program_id:
          type: string
      required:
      - program_id
    SequenceAction:
      type: object
      properties:
        program_id:
          type: string
      required:
      - program_id
    Campaign:
      type: object
      properties:
        id:
          type: string
          pattern: ^(sample_)?camp_
          example: camp_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`camp_…`)
        object:
          type: string
          enum:
          - campaign
        program_id:
          type: string
          pattern: ^(sample_)?prg_
          example: prg_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`prg_…`)
        name:
          type: string
        subject:
          type: string
        status:
          type: string
          enum:
          - draft
          - scheduled
          - sending
          - paused
          - sent
        scheduled_at:
          type:
          - string
          - 'null'
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
        sent_at:
          type:
          - string
          - 'null'
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
        stats:
          type: object
          properties:
            total:
              type: integer
            queued:
              type: integer
            sent:
              type: integer
            failed:
              type: integer
            opened:
              type: integer
            skipped:
              type: integer
          required:
          - total
          - queued
          - sent
          - failed
          - opened
          - skipped
        created_at:
          type: string
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
        updated_at:
          type: string
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
      required:
      - id
      - object
      - program_id
      - name
      - subject
      - status
      - scheduled_at
      - sent_at
      - stats
      - created_at
      - updated_at
    CampaignList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Campaign'
        has_more:
          type: boolean
        total_count:
          type: integer
      required:
      - data
      - has_more
      - total_count
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
              - authentication_error
              - permission_error
              - invalid_request_error
              - not_found_error
              - conflict_error
              - rate_limit_error
              - plan_error
              - not_implemented_error
              - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
          required:
          - type
          - code
          - message
      required:
      - error
    CampaignSend:
      type: object
      properties:
        program_id:
          type: string
      required:
      - program_id
    SequenceList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Sequence'
        has_more:
          type: boolean
        total_count:
          type: integer
      required:
      - data
      - has_more
      - total_count
    Sequence:
      type: object
      properties:
        id:
          type: string
          pattern: ^(sample_)?seq_
          example: seq_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`seq_…`)
        object:
          type: string
          enum:
          - sequence
        program_id:
          type: string
          pattern: ^(sample_)?prg_
          example: prg_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`prg_…`)
        name:
          type: string
        status:
          type: string
          enum:
          - active
          - paused
        trigger:
          type: string
          enum:
          - approved
          - idle
          - first_commission
        trigger_days:
          type:
          - integer
          - 'null'
        steps:
          type: integer
        counts:
          type: object
          properties:
            enrolled:
              type: integer
            active:
              type: integer
            completed:
              type: integer
          required:
          - enrolled
          - active
          - completed
        created_at:
          type: string
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
        updated_at:
          type: string
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
      required:
      - id
      - object
      - program_id
      - name
      - status
      - trigger
      - trigger_days
      - steps
      - counts
      - created_at
      - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: rail_live_… or rail_test_…
      description: Create keys in Settings → API keys. Each key carries scopes; the docs name the scope every route needs.
x-refined-from:
- affiliaterail-com-docs-openapi.json
- affiliaterail-com-openapi.json