# Send a WhatsApp Web image

Use a connected WhatsApp session and a public HTTPS image URL accessible to the provider.

Required. Send the account API key in the X-API-Key header. Never expose the key in a public browser or git repository.

## Request preview

```bash
curl --request POST 'https://raselsms.com/api/v2/messages/send' \
  -H "X-API-Key: $RASEL_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'RASEL_JSON'
{
  "to": "+963912345678",
  "channel": "user_whatsapp_session",
  "messageType": "free_text",
  "content": {
    "text": "Product photo"
  },
  "attachment": {
    "type": "image",
    "publicUrl": "https://cdn.example.com/catalog/sku-100.png",
    "mimetype": "image/png",
    "fileName": "sku-100.png"
  }
}
RASEL_JSON
```

## HTTP 200

```json
{
  "success": true,
  "requestId": "msgreq_1739012345678_abc123",
  "status": "sent",
  "resolved": {
    "channel": "user_whatsapp_session",
    "provider": "user_whatsapp_session",
    "senderSource": "session"
  },
  "billing": {
    "estimatedCost": 0.02,
    "currency": "USD"
  },
  "tracking": {
    "messageId": "6800msg123def4567890aaaa",
    "usageId": "6800use123def4567890bbbb",
    "queueId": null
  }
}
```

Test locally with a mock response first. Confirm the recipient and cost before sending a live request.

- [GET /api/v2/whatsapp-web/sessions](https://raselsms.com/api-docs/markdown/conversation-context/whatsapp-sessions.md)

## HTTP 502

Partial failure does not undo an accepted section or its charge. The same key replays the cached response; resume failed sections from message history. A new key creates a new message and may duplicate accepted sections. Uncertain acceptance is never blindly retried.

```json
{
  "success": false,
  "requestId": "msgreq_example",
  "code": "SMS_PARTIAL_DELIVERY",
  "error": "إرسال الرسالة الطويلة: قُبل 1 من 3 أقسام. يمكن إعادة محاولة الأقسام الفاشلة فقط.",
  "details": {
    "smsMultipart": {
      "id": "sms_batch_example",
      "status": "partial",
      "totalParts": 3,
      "sentParts": 1,
      "parts": [
        {
          "index": 1,
          "state": "sent",
          "messageDocId": "680000000000000000000001"
        },
        {
          "index": 2,
          "state": "failed",
          "messageDocId": "680000000000000000000002"
        },
        {
          "index": 3,
          "state": "pending"
        }
      ]
    }
  },
  "billing": {
    "estimatedCost": 0.06,
    "currency": "USD"
  },
  "tracking": {
    "messageDocId": "680000000000000000000002",
    "messageId": null,
    "usageId": null,
    "queueId": null
  }
}
```

[API reference](https://raselsms.com/api-docs/markdown/messaging/send.md)

[OpenAPI](https://raselsms.com/api-docs/openapi.json)
