AffiliateRail Partners API

The Partners API from AffiliateRail — 3 operation(s) for partners.

Operations 6

GET /v1/partners List partners #
POST /v1/partners Create a partner #
GET /v1/partners/{id} Retrieve a partner #
POST /v1/partners/{id} Update a partner #
DELETE /v1/partners/{id} Delete a partner #
POST /v1/partners/{id}/sso Mint a sign-in link #

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-partners-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-partners-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Affiliaterail Com Partners API
  version: '2026-08-21'
  description: 'Operations tagged Partners 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: Partners
paths:
  /v1/partners:
    get:
      tags:
      - Partners
      summary: List partners
      description: '**Scope:** `read`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          example: prg_7uSyy9FqVLCFWrdPeZaK
          description: Required on every list
        required: true
        description: Required on every list
        name: program_id
        in: query
      - schema:
          type: string
          example: '25'
          description: 1 to 100, default 25
        required: false
        description: 1 to 100, default 25
        name: limit
        in: query
      - schema:
          type: string
          description: Object id; returns the page after it (older)
        required: false
        description: Object id; returns the page after it (older)
        name: starting_after
        in: query
      - schema:
          type: string
          description: Object id; returns the page before it (newer)
        required: false
        description: Object id; returns the page before it (newer)
        name: ending_before
        in: query
      - schema:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
          description: 'Relations to embed: group'
        required: false
        description: 'Relations to embed: group'
        name: expand[]
        in: query
      - schema:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
          description: 'Extras to include: stats, tags'
        required: false
        description: 'Extras to include: stats, tags'
        name: include[]
        in: query
      - schema:
          type: string
          enum:
          - pending
          - active
          - declined
          - suspended
        required: false
        name: status
        in: query
      - schema:
          type: string
        required: false
        name: group_id
        in: query
      - schema:
          type: string
        required: false
        name: email
        in: query
      - schema:
          type: string
        required: false
        name: handle
        in: query
      - schema:
          type: string
        required: false
        name: search
        in: query
      responses:
        '200':
          description: Partners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerList'
        '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: getV1Partners
      x-operation-id-source: derived
    post:
      tags:
      - Partners
      summary: Create a partner
      description: 'Adds a partner directly (`status: active`) or into the review queue (`status: pending`). The handle is derived from the email when omitted. A duplicate answers 409 WITH the existing partner under `existing`, so you can connect it to your system without a second lookup.


        **Scope:** `partners:write` (or `write`)'
      security:
      - bearerAuth: []
      requestBody:
        description: ''
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerCreate'
      responses:
        '201':
          description: The new partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Partner'
        '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'
        '409':
          description: Email or handle already in use; the record you collided with rides along
          content:
            application/json:
              schema:
                type: object
                properties:
                  error: {}
                  existing:
                    $ref: '#/components/schemas/Partner'
                required:
                - existing
        '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: postV1Partners
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/partners/{id}:
    get:
      tags:
      - Partners
      summary: Retrieve a partner
      description: '**Scope:** `read`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        required: true
        description: Prefixed id (`part_…`)
        name: id
        in: path
      - schema:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
          description: 'Relations to embed: group'
        required: false
        description: 'Relations to embed: group'
        name: expand[]
        in: query
      - schema:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
          description: 'Extras to include: stats, tags'
        required: false
        description: 'Extras to include: stats, tags'
        name: include[]
        in: query
      responses:
        '200':
          description: The partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Partner'
        '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: getV1PartnersById
      x-operation-id-source: derived
    post:
      tags:
      - Partners
      summary: Update a partner
      description: '**Scope:** `partners:write` (or `write`)'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        required: true
        description: Prefixed id (`part_…`)
        name: id
        in: path
      requestBody:
        description: ''
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerUpdate'
      responses:
        '200':
          description: The updated partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Partner'
        '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: postV1PartnersById
      x-operation-id-source: derived
    delete:
      tags:
      - Partners
      summary: Delete a partner
      description: 'Removes the partner and everything attributed to them: links, referrals, customers, commissions, payouts. Not reversible.


        **Scope:** `partners:write` (or `write`)'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        required: true
        description: Prefixed id (`part_…`)
        name: id
        in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deleted'
        '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: deleteV1PartnersById
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
  /v1/partners/{id}/sso:
    post:
      tags:
      - Partners
      summary: Mint a sign-in link
      description: 'A single-use magic link that signs the partner straight into their portal. Fifteen-minute life. Drop it into your own emails or app. Needs the umbrella `write` scope: a sign-in link is a session on the partner''s portal, not a partner record, so no narrower scope hands one out.


        **Scope:** `write`'
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        required: true
        description: Prefixed id (`part_…`)
        name: id
        in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                ttl_seconds:
                  type: integer
                  minimum: 60
                  maximum: 86400
      responses:
        '201':
          description: The link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MagicLink'
        '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'
        '501':
          description: Magic links are not available yet
          content:
            application/json:
              schema: {}
      operationId: postV1PartnersByIdSso
      x-operation-id-source: derived
    servers:
    - url: https://api.affiliaterail.com
      description: Production
components:
  schemas:
    PartnerUpdate:
      type: object
      properties:
        first_name:
          type:
          - string
          - 'null'
        last_name:
          type:
          - string
          - 'null'
        display_name:
          type:
          - string
          - 'null'
        company_name:
          type:
          - string
          - 'null'
        website_url:
          type:
          - string
          - 'null'
          format: uri
        country_code:
          type:
          - string
          - 'null'
          minLength: 2
          maxLength: 2
        handle:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{0,30}[a-z0-9]$
        group_id:
          type:
          - string
          - 'null'
          pattern: ^(sample_)?grp_
          example: grp_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`grp_…`)
        min_payout_minor:
          type:
          - integer
          - 'null'
          minimum: 0
          example: 2500
          description: Integer minor units (cents, pence). Never a float, never a string.
        status:
          type: string
          enum:
          - active
          - suspended
          description: Suspend or reinstate. Approval of a pending partner goes through applications.
        suspension_reason:
          type:
          - string
          - 'null'
        tag_ids:
          type: array
          items:
            type: string
            pattern: ^(sample_)?tag_
            example: tag_7uSyy9FqVLCFWrdPeZaK
            description: Prefixed id (`tag_…`)
          description: Replaces the partner's tags
        metadata:
          type:
          - object
          - 'null'
          additionalProperties: {}
          description: Your own key/value data, stored as given
    Partner:
      type: object
      properties:
        id:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        object:
          type: string
          enum:
          - partner
        program_id:
          type: string
          pattern: ^(sample_)?prg_
          example: prg_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`prg_…`)
        group_id:
          type:
          - string
          - 'null'
          pattern: ^(sample_)?grp_
          example: grp_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`grp_…`)
        email:
          type: string
          format: email
        first_name:
          type:
          - string
          - 'null'
        last_name:
          type:
          - string
          - 'null'
        display_name:
          type:
          - string
          - 'null'
        company_name:
          type:
          - string
          - 'null'
        website_url:
          type:
          - string
          - 'null'
        country_code:
          type:
          - string
          - 'null'
        language_code:
          type:
          - string
          - 'null'
        handle:
          type: string
          description: The `?ref=` value
        status:
          type: string
          enum:
          - pending
          - active
          - declined
          - suspended
        decline_reason:
          type:
          - string
          - 'null'
        suspension_reason:
          type:
          - string
          - 'null'
        currency:
          type: string
          minLength: 3
          maxLength: 3
          example: USD
          description: The program's currency; every amount on this partner is in it
        min_payout_minor:
          type:
          - integer
          - 'null'
          example: 2500
          description: Per-partner threshold override; null means the program's
        terms_accepted_at:
          type:
          - string
          - 'null'
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
        terms_version:
          type:
          - string
          - 'null'
        completed_onboarding:
          type: boolean
        email_first_referral:
          type: boolean
        email_new_referral:
          type: boolean
        email_payout_paid:
          type: boolean
        metadata:
          type:
          - object
          - 'null'
          additionalProperties: {}
          description: Your own key/value data, stored as given
        stats:
          $ref: '#/components/schemas/PartnerStats'
        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
      - group_id
      - email
      - first_name
      - last_name
      - display_name
      - company_name
      - website_url
      - country_code
      - language_code
      - handle
      - status
      - decline_reason
      - suspension_reason
      - currency
      - min_payout_minor
      - terms_accepted_at
      - terms_version
      - completed_onboarding
      - email_first_referral
      - email_new_referral
      - email_payout_paid
      - metadata
      - created_at
      - updated_at
    PartnerList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Partner'
        has_more:
          type: boolean
          description: Pass the last object's id as `starting_after` to fetch the next page
        total_count:
          type: integer
          description: Count of every object matching the filters, ignoring the cursor
      required:
      - data
      - has_more
      - total_count
    PartnerCreate:
      type: object
      properties:
        program_id:
          type: string
          pattern: ^(sample_)?prg_
          example: prg_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`prg_…`)
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        company_name:
          type: string
        website_url:
          type: string
          format: uri
        country_code:
          type: string
          minLength: 2
          maxLength: 2
        handle:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{0,30}[a-z0-9]$
          description: 2 to 32 chars, letters, digits, hyphens. Derived from the email when omitted.
        group_id:
          type: string
          pattern: ^(sample_)?grp_
          example: grp_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`grp_…`)
        status:
          type: string
          enum:
          - active
          - pending
          default: active
          description: '`pending` puts the partner in the review queue instead of activating them'
        metadata:
          type:
          - object
          - 'null'
          additionalProperties: {}
          description: Your own key/value data, stored as given
      required:
      - program_id
      - email
    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
    PartnerStats:
      type: object
      properties:
        clicks:
          type: integer
        referrals:
          type: integer
        customers:
          type: integer
        commissions_minor:
          type: integer
          example: 2500
          description: Integer minor units (cents, pence). Never a float, never a string.
        paid_minor:
          type: integer
          example: 2500
          description: Integer minor units (cents, pence). Never a float, never a string.
        currency:
          type: string
          minLength: 3
          maxLength: 3
          example: USD
          description: ISO-4217
      required:
      - clicks
      - referrals
      - customers
      - commissions_minor
      - paid_minor
      - currency
    MagicLink:
      type: object
      properties:
        object:
          type: string
          enum:
          - magic_link
        partner_id:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        url:
          type: string
          format: uri
        expires_at:
          type: string
          format: date-time
          example: '2026-08-21T10:15:30.000Z'
          description: ISO-8601, UTC
      required:
      - object
      - partner_id
      - url
      - expires_at
    Deleted:
      type: object
      properties:
        id:
          type: string
          pattern: ^(sample_)?part_
          example: part_7uSyy9FqVLCFWrdPeZaK
          description: Prefixed id (`part_…`)
        object:
          type: string
        deleted:
          type: boolean
          enum:
          - true
      required:
      - id
      - object
      - deleted
  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