Create API Key

Generate a new API key with scoped permissions.


Request

Generate a new API key for programmatic access. The full key is returned only once in the response — store it securely immediately.

This endpoint requires session authentication (you must be logged in via the dashboard).

Body Parameters

namestringRequired

A descriptive name for the key (e.g., "Production App", "CI Pipeline", "MCP Integration"). Helps identify the key in your dashboard.

permissionsstring[]Optional
Default: ['posts:create', 'posts:read']

Array of permissions to grant to this key. Available permissions:

  • posts:read — Read posts and connections
  • posts:create — Create, schedule, and publish posts

Example Request

curl -X POST https://app.ewasl.com/api/settings/api-keys \
  -H "Authorization: Bearer ewasl_YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MCP Integration",
    "permissions": ["posts:create", "posts:read"]
  }'

Response

apiKeystring

The full, unmasked API key. Save this immediately — it will not be shown again. Format: ewasl_ followed by a random string.

keyobject

Metadata about the created key.

Response Example

{
  "apiKey": "ewasl_sk_live_a1b2c3d4e5f6g7h8i9j0...",
  "key": {
    "id": "key_123abc",
    "name": "MCP Integration",
    "permissions": ["posts:create", "posts:read"],
    "created_at": "2026-03-01T12:00:00Z"
  }
}