Tester avec Playground !

Interface interactive pour tester TOUS les endpoints Organizations 🚀


✅ Create • GET mine • Switch • Plan
✅ Curl auto
✅ Copie presse-papiers
⚡ Test sandbox
📱 Mobile responsive
🛡️ Confirmation création

Developer Organizations API

Sandbox API pour gérer des organisations de test (table DevOrganizations)

⚠️ Sandbox uniquement - Ne pas utiliser pour production

1. Authentification

Clé API obligatoire

Toutes les requêtes nécessitent l'en-tête X-Api-Key

✅ Requête valide
curl -H "X-Api-Key: votre_cle_api"
"https://dpasswords.ca/api/dev/organizations/mine"
❌ Sans clé
401 Unauthorized
{ "error": "Missing or invalid API key" }

2. Plan & Limites

GET /api/dev/organizations/plan
📤 Requête
curl -H "X-Api-Key: votre_cle"
"https://dpasswords.ca/api/dev/organizations/plan"
📥 Réponse exemple
{
  "plan": "PRO",
  "normalizedPlan": "pro",
  "ownedOrgCount": 1,
  "orgLimit": 3,
  "canCreateOrg": true,
  "remainingSlots": 2,
  "totalOrgsUser": 1
}

3. Mes organisations

GET /api/dev/organizations/mine
📤 Requête
curl -H "X-Api-Key: votre_cle"
"https://dpasswords.ca/api/dev/organizations/mine"
📥 Réponse exemple
[
  {
    "id": 10,
    "name": "My Organization",
    "role": "Owner",
    "ownerUserId": "user-123"
  }
]

4. Créer une organisation

POST /api/dev/organizations/create
📤 Corps JSON
{
  "name": "Nouvelle Organisation"
}
📥 Réponse exemple
{
  "success": true,
  "organizationId": 15,
  "name": "Nouvelle Organisation"
}
Obligatoire: name

5. Switch organisation

POST /api/dev/organizations/switch
📤 Corps JSON
{
  "id": 10
}
📥 Réponse exemple
{
  "success": true,
  "organizationId": 10,
  "role": "Owner",
  "token": "sandbox-jwt-token-10"
}