> ## Documentation Index
> Fetch the complete documentation index at: https://chariow.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Affiliate Invitations

> Send invitation emails to potential affiliates

Sends invitation emails to the provided email addresses. Up to 25 emails can be sent in a single request. Existing affiliates and pending invitations are automatically skipped.

## Request Body

<ParamField body="emails" type="array" required>
  Array of email addresses (1-25 items)

  **Example:** `["john@example.com", "jane@example.com"]`
</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="invitations" type="array">
      Array of created invitation objects

      <Expandable title="invitation object">
        <ResponseField name="id" type="string">
          Unique invitation identifier (e.g., `affinv_abc123xyz`)
        </ResponseField>

        <ResponseField name="email" type="string">
          Email address the invitation was sent to
        </ResponseField>

        <ResponseField name="status" type="string">
          Invitation status: `pending`
        </ResponseField>

        <ResponseField name="expires_at" type="string">
          ISO 8601 expiration timestamp
        </ResponseField>

        <ResponseField name="created_at" type="string">
          ISO 8601 creation timestamp
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="skipped" type="object">
      Details of skipped emails

      <Expandable title="skipped object">
        <ResponseField name="already_affiliate" type="array">
          Emails that are already registered as affiliates
        </ResponseField>

        <ResponseField name="already_invited" type="array">
          Emails that have pending invitations
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.chariow.com/v1/affiliates/invitations" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "emails": ["john@example.com", "jane@example.com"]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.chariow.com/v1/affiliates/invitations', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      emails: ['john@example.com', 'jane@example.com']
    })
  });
  const data = await response.json();
  ```

  ```php PHP theme={null}
  $ch = curl_init('https://api.chariow.com/v1/affiliates/invitations');
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer YOUR_API_KEY',
      'Content-Type: application/json'
  ]);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'emails' => ['john@example.com', 'jane@example.com']
  ]));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  ```
</RequestExample>

<ResponseExample>
  ```json Response (201 Created) theme={null}
  {
    "message": "2 invitations sent successfully",
    "data": {
      "invitations": [
        {
          "id": "affinv_abc123xyz",
          "email": "john@example.com",
          "status": "pending",
          "expires_at": "2026-02-10T10:30:00+00:00",
          "created_at": "2026-01-11T10:30:00+00:00"
        },
        {
          "id": "affinv_def456uvw",
          "email": "jane@example.com",
          "status": "pending",
          "expires_at": "2026-02-10T10:30:00+00:00",
          "created_at": "2026-01-11T10:30:00+00:00"
        }
      ],
      "skipped": {
        "already_affiliate": [],
        "already_invited": []
      }
    },
    "errors": []
  }
  ```

  ```json Partial Success (201 Created) theme={null}
  {
    "message": "1 invitation sent successfully",
    "data": {
      "invitations": [
        {
          "id": "affinv_abc123xyz",
          "email": "john@example.com",
          "status": "pending",
          "expires_at": "2026-02-10T10:30:00+00:00",
          "created_at": "2026-01-11T10:30:00+00:00"
        }
      ],
      "skipped": {
        "already_affiliate": ["existing@affiliate.com"],
        "already_invited": ["pending@invitation.com"]
      }
    },
    "errors": []
  }
  ```

  ```json Validation Error (422) theme={null}
  {
    "message": "The emails field is required.",
    "data": [],
    "errors": {
      "emails": ["The emails field is required."]
    }
  }
  ```
</ResponseExample>
