---
title: "Create API key"
method: POST
path: "/api-keys"
tags: ["API Keys & Security"]
---

# Create API key

`POST /api-keys`

## Request

- Base URL: `https://api.envoisms.ma/v1`
- URL: `https://api.envoisms.ma/v1/api-keys`
- Auth: HTTP bearer

## Request body

- object
  - `name` string
  - `permissions` string[]
  - `ip_whitelist` string[]
  - `rate_limit` integer
  - `sandbox` boolean: Mint a sandbox key, prefixed `env_test_` instead of `smr_`. Requests on a sandbox key are validated, priced and recorded exactly like live ones — opt-out list, sender rules, phishing screen and quota all apply — but nothing is delivered to a carrier, no balance is debited and no invoice line is created. A simulated delivery receipt follows a few seconds later, including the `delivered` webhook. Sends and OTPs made with a sandbox key are excluded from analytics and are only visible to sandbox keys. A key's mode is fixed at creation; create a new key to switch.

## Response `201`

API key created. Full key is returned once.

---

[API](https://skmtc.dev/envoisms/apis/envoisms-ma-api.md) · [All operations](https://skmtc.dev/envoisms/apis/envoisms-ma-api/llms.txt) · [OpenAPI document](https://skmtc.dev/envoisms/apis/envoisms-ma-api/revisions/662db074bd86?raw)
