> ## Documentation Index
> Fetch the complete documentation index at: https://help-plum.xoxoday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Link API

> Generate a unique reward link per recipient and deliver it to their inbox. Ideal for automating reward distribution with email notifications.


| **Property**  | **Type** | **Description**                                                        |
| :------------ | :------- | :--------------------------------------------------------------------- |
| `campaignId`  | `String` | Unique identifier of the campaign for which links are to be generated. |
| `email_ids`   | `String` | Comma-separated list of recipient email addresses (or a single email). |
| `link_expiry` | `String` | Expiry date for the link(s) (format: `DD-MM-YYYY`).                    |

## Response Schema

| **Property**              | **Type** | **Description**                                                   |
| ------------------------- | -------- | ----------------------------------------------------------------- |
| data                      | object   | Root response object.                                             |
| data.generateLink         | object   | Container for link-sending operation.                             |
| data.generateLink.success | number   | API execution status (`1` = success).                             |
| data.generateLink.message | string   | Message returned by the API (e.g., “Links created successfully”). |


## OpenAPI

````yaml specs/reward-link-api.yaml POST /sendLinks
openapi: 3.0.3
info:
  title: Xoxoday Reward Link API
  version: '1.2'
  description: >
    APIs for automating reward distribution via personalized reward links and
    campaigns.


    **Auth endpoints** resolve against
    `https://stagingstores.xoxoday.com/chef/v1/oauth`

    using a per-operation server override.


    **Campaign + Link operations** use
    `https://stagingstores.xoxoday.com/chef/v1/oauth/api`

    as the base. `/generateLink` and `/sendLinks` have dedicated real paths.

    Campaign operations (`/campaignList`, `/campaignDetails`) use short virtual
    path

    suffixes because both operations share the same real URL (`/v1/oauth/api`)
    and

    OpenAPI does not allow two POST operations on the same path.
servers:
  - url: https://stagingstores.xoxoday.com/chef/v1/oauth/api
    description: Sandbox
  - url: https://accounts.xoxoday.com/chef/v1/oauth/api
    description: Production
  - url: https://canvas.xoxoday.com/chef/v1/oauth/api
    description: Testing
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Token management — validate and refresh access tokens.
  - name: Campaigns
    description: Fetch reward link campaigns and their details.
  - name: Links
    description: Generate and send reward links to recipients.
paths:
  /sendLinks:
    post:
      tags:
        - Links
      summary: Send Link API
      description: >
        Generate a unique reward link per recipient and deliver it to their
        inbox. Ideal for automating reward distribution with email
        notifications.
      operationId: sendLinks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - tag
                - variables
              properties:
                query:
                  type: string
                  enum:
                    - xoxo_link.mutation.generateLinkEmail
                  default: xoxo_link.mutation.generateLinkEmail
                  description: Always use `xoxo_link.mutation.generateLinkEmail`.
                tag:
                  type: string
                  enum:
                    - xoxo_link
                  default: xoxo_link
                  description: Always use `xoxo_link`.
                variables:
                  type: object
                  required:
                    - data
                  properties:
                    data:
                      type: object
                      required:
                        - campaignId
                        - email_ids
                        - link_expiry
                      properties:
                        campaignId:
                          type: integer
                          description: Unique identifier of the campaign.
                          example: 123
                        email_ids:
                          type: string
                          description: Comma-separated list of recipient email addresses.
                          example: email1@domain.com,email2@domain.com
                        link_expiry:
                          type: string
                          description: 'Expiry date for the links. Format: `DD-MM-YYYY`.'
                          example: 19-03-2023
            example:
              query: xoxo_link.mutation.generateLinkEmail
              tag: xoxo_link
              variables:
                data:
                  campaignId: 123
                  email_ids: email1@domain.com,email2@domain.com
                  link_expiry: 19-03-2023
      responses:
        '200':
          description: Links sent successfully to all recipients.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      generateLink:
                        type: object
                        properties:
                          success:
                            type: integer
                            description: '`1` = success.'
                          message:
                            type: string
              example:
                data:
                  generateLink:
                    success: 1
                    message: Links created successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '502':
          $ref: '#/components/responses/BadGateway'
components:
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              message:
                type: string
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Unauthorized
    BadGateway:
      description: Upstream service error.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <access_token>`'

````