# eWasl API Documentation > Source: https://docs.ewasl.com > Last updated: 2026-03-11 ## Overview eWasl is a social media management platform for the Middle East. It supports Arabic-first content with AI-powered tools for scheduling, publishing, and analytics across multiple platforms. ## Authentication All API requests require authentication via API key. ### API Key Authentication Include your API key in the `x-api-key` header: ``` x-api-key: ewasl_your_api_key_here ``` API keys can be generated in Settings > API Keys. Each key is scoped to a user account. ## Base URL ``` https://app.ewasl.com/api ``` ## Rate Limits - Standard API: 100 requests/minute - Strict endpoints (posting): 30 requests/minute - AI generation: 10 requests/minute ## Discovery & standards Machine-readable discovery documents (all on https://app.ewasl.com): - API catalog (RFC 9727): /.well-known/api-catalog (application/linkset+json) - OpenAPI 3.1 spec: /docs/api/openapi.json - MCP server card (SEP-1649): /.well-known/mcp/server-card.json - MCP endpoint (JSON-RPC over HTTP): /api/mcp - Agent skills index: /.well-known/agent-skills/index.json - OAuth authorization server (RFC 8414): /.well-known/oauth-authorization-server - OAuth protected resource (RFC 9728): /.well-known/oauth-protected-resource - Agent authentication guide: /auth.md - Health check: /api/health Agents acting on behalf of a user should authenticate via OAuth 2.0 (RFC 7591 dynamic client registration at /api/oauth-server/register, PKCE/S256). See /auth.md for the full flow. First-party server-to-server callers can use an `ewasl_*` API key as `Authorization: Bearer ewasl_...`. ## Endpoints ### Posts #### List Posts `GET /api/social/posts` Query parameters: - `limit` (number, default: 50, max: 100) — Number of posts to return - `offset` (number, default: 0) — Pagination offset Response: ```json { "posts": [ { "id": "uuid", "content": "Post text content", "status": "PUBLISHED | SCHEDULED | DRAFT | FAILED | PROCESSING", "media_urls": ["https://..."], "scheduled_at": "2026-03-11T10:00:00Z", "published_at": "2026-03-11T10:00:05Z", "created_at": "2026-03-11T09:00:00Z" } ], "total": 68, "analytics": { ... } } ``` #### Create Post `POST /api/social/posts` Request body: ```json { "content": "Hello world! #ewasl", "accountIds": ["uuid-of-connected-account"], "publishNow": true, "scheduledAt": "2026-03-12T10:00:00Z", "isDraft": false, "mediaFiles": ["https://storage-url/image.jpg"], "tiktokSettings": { "privacyLevel": "PUBLIC_TO_EVERYONE", "disableDuet": false, "disableComment": false, "disableStitch": false } } ``` #### Get Single Post `GET /api/social/posts/{id}` Returns full post data including associated accounts. #### Update Post `PATCH /api/social/posts/{id}` Only draft, scheduled, or failed posts can be edited. Request body (all fields optional): ```json { "content": "Updated content", "accountIds": ["uuid"], "mediaFiles": ["https://..."], "scheduledAt": "2026-03-12T10:00:00Z", "isDraft": true } ``` #### Get Post Status `GET /api/social/posts/{id}/status` Returns publishing status with per-platform results. #### Retry Failed Post `POST /api/social/posts/{id}/retry` ### Social Accounts #### List Connected Accounts `GET /api/social/connections` Returns all connected social media accounts with their status. Response: ```json { "connections": [ { "id": "uuid", "platform": "FACEBOOK | INSTAGRAM | TWITTER | YOUTUBE | TIKTOK | LINKEDIN | SNAPCHAT | TELEGRAM", "accountName": "My Page", "accountId": "platform-specific-id", "isExpired": false, "status": "active" } ], "summary": { "total": 6, "active": 5, "expired": 1 } } ``` ### AI Content Generation #### Generate Content `POST /api/ai/generate-content` Request body: ```json { "type": "social-content | brand-identity | pro-description", "goal": "sales | awareness | engagement | education | promotion", "platform": "twitter | instagram | facebook | linkedin | tiktok | youtube", "format": "post | thread | story | reel | caption", "language": "ar | en", "dialect": "formal | saudi | egyptian | gulf | levantine", "tone": "professional | casual | engaging | humorous | inspirational", "productId": "uuid (optional)" } ``` Response: ```json { "content": "Generated content text...", "brandConnected": true } ``` Note: Brand identity must be set up before generating social content. #### AI Rephrase `POST /api/ai/rephrase` Request body: ```json { "content": "Original text", "action": "rephrase | improve | shorten | expand", "platform": "twitter", "maxLength": 280 } ``` ### Analytics #### Get Analytics `GET /api/social/posts` (includes analytics in response) #### Export Analytics Available via the dashboard at `/analytics` — exports CSV. ### Media #### Upload Media `POST /api/media/upload` Multipart form data with file attachment. Max 4.5MB per file. Persist a UUID before sending and supply it in `x-ewasl-upload-operation-id`. Reuse that ID for the exact same upload after a lost response. Changed content conflicts with 409; an uncertain result returns the existing upload handle for verification rather than authorizing a fresh upload. For larger files, use the resumable upload flow: `POST /api/media/upload/session` Supply `x-ewasl-upload-operation-id` and `x-ewasl-upload-content-fingerprint` when preparing the session. The fingerprint format is `sha256-chunk-tree-v1:`: hash each ordered 8 MiB input chunk, then SHA-256 the UTF-8 manifest consisting of `ewasl-upload-content-chunk-tree-v1\n\n`. Use the returned transport: Supabase TUS uses 6 MiB chunks; private R2 multipart uses the session's signed part URLs and sizes. Finalize with `POST /api/media/upload/complete`. Supported large files are capped at 500 MiB; images have separate trusted-processing limits. Workspace quota is reserved before issuing upload credentials. Preserve the saved upload ID and location. Agent image uploads use `POST /api/v1/media/upload` with a caller-retained UUID in `Idempotency-Key` (10 MiB image limit). Agent resumable preparation uses `POST /api/v1/media/uploads` with the two session headers above. Identical retries recover the existing operation; verification-required responses are not permission to create another operation. Existing sessions retain their original storage provider during rollout and rollback. ### Brand Identity #### Get Brand Identity `GET /api/brand-identity` #### Update Brand Identity `POST /api/brand-identity` ### Products #### List Products `GET /api/user-products` #### Create Product `POST /api/user-products` ## Supported Platforms | Platform | Text | Image | Video | Status | |----------|------|-------|-------|--------| | Facebook | Yes | Yes | Yes | Active | | Instagram | Yes | Yes | Yes | Active | | Twitter/X | Yes | Yes | Yes | Active | | YouTube | No | No | Yes | Active | | TikTok | No | No | Yes | Active | | LinkedIn | Yes | Yes | Yes | Active | | Snapchat | Yes | Yes | Yes | Active | | Telegram | Yes | Yes | Yes | Active | | Pinterest | Yes | Yes | No | Active | ## Character Limits - Twitter/X: 280 characters - Facebook: 63,206 characters - Instagram: 2,200 characters - LinkedIn: 3,000 characters - TikTok: 2,200 characters - YouTube: 5,000 characters (description) - Snapchat: 250 characters - Telegram: 4,096 characters ## Webhooks & Cron Jobs eWasl uses scheduled cron jobs for: - Token refresh (every 30-60 minutes) - Scheduled post publishing (every minute) - Analytics fetching (periodic) - Data cleanup (daily) ## Error Codes - 400: Bad Request (validation error) - 401: Unauthorized (missing/invalid API key) - 403: Forbidden (insufficient permissions) - 404: Not Found - 429: Rate Limited - 500: Internal Server Error - 503: Service Unavailable (AI service down) ## SDKs & Integrations - MCP (Model Context Protocol): Available at /docs/mcp - REST API: All endpoints documented above - Webhook notifications: Coming soon ## Support - Documentation: https://docs.ewasl.com - Email: support@ewasl.com - API Status: https://app.ewasl.com/api/monitoring/status