# GET /v2/auth/admin_invitation

Gültigkeit einer Administrator-Einladung prüfen

Prüft den vertraulichen Einladungs-code aus der Query und liefert Gültigkeit, Status, Ablaufzeit sowie Anzeigenamen. Fehlende/ungültige Codes liefern valid=false; die Einladung wird durch das Lesen nicht angenommen.

- Operation-ID: get_v2_auth_admin_invitation
- Dokumentation: /docs/api/v2/operations/get-v2-auth-admin-invitation-3d9e8ca18467/
- OpenAPI-Version: 3.2.1
- Vollständige Spezifikation: /docs/api/v2/openapi.json
- Dokumentationsstatus: reviewed
- Ändert Zustand: nein, gemäss Annotation
- Für Automation freigegeben: nein

## Server

Serverwerte stammen unverändert aus der Datei. Eine lokale Entwicklungsadresse ist keine bestätigte Produktionsadresse. `API_ORIGIN` muss auf die passende Instanz gesetzt werden.

```json
[
  {
    "url": "https://app2.edoobox.com",
    "description": "edoobox API"
  }
]
```

## Authentifizierung

Für diesen Endpunkt deklariert die Spezifikation keine OpenAPI-Authentifizierung (`security: []`). Weitere Bedingungen stehen in der Beschreibung und den edoobox-Hinweisen.

### Wirksame Security Requirements und vollständige Verfahren

```json
{
  "security": [],
  "securitySchemes": {}
}
```

## Parameter

| Name | Ort | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| code | query | nein | Vertraulicher Einladungs-Code. |

### Vollständige wirksame Parameterdefinitionen

```json
[
  {
    "name": "code",
    "in": "query",
    "required": false,
    "schema": {
      "type": "string",
      "writeOnly": true,
      "x-edoobox-sensitive": true,
      "description": "Einladungs-Code aus dem erhaltenen Link, 40 bis 200 Zeichen."
    },
    "description": "Vertraulicher Einladungs-Code."
  }
]
```

## Anfrage

Kein Request Body deklariert.

## Antworten

HTTP-Status und Antwortinhalt gemeinsam auswerten. Die folgenden Beschreibungen und Schemata sind die Angaben der Quelldatei.

```json
{
  "200": {
    "description": "Öffentliche Einladungsanzeige ohne interne IDs.",
    "content": {
      "application/json": {
        "example": {
          "success": true,
          "error": false,
          "data": {
            "valid": true,
            "status": "pending",
            "expires_at": 1790261000,
            "invited_by_name": "Kim Beispiel",
            "admin_name": "Alex Beispiel"
          }
        },
        "schema": {
          "type": "object",
          "properties": {
            "success": {
              "type": "boolean"
            },
            "error": {
              "type": [
                "boolean",
                "string"
              ]
            },
            "error_code": {
              "type": "string"
            },
            "data": {
              "type": "object",
              "properties": {
                "valid": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string"
                },
                "expires_at": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "invited_by_name": {
                  "type": "string"
                },
                "admin_name": {
                  "type": "string"
                }
              },
              "additionalProperties": true,
              "required": [
                "valid",
                "status",
                "expires_at",
                "invited_by_name",
                "admin_name"
              ]
            },
            "type": {
              "type": "string"
            }
          },
          "additionalProperties": true
        }
      }
    }
  },
  "400": {
    "description": "Invalid request.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40006"
        }
      }
    }
  },
  "401": {
    "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40103"
        }
      }
    }
  },
  "402": {
    "description": "Missing/invalid action data or subscription/operation restriction.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80100"
        }
      }
    }
  },
  "403": {
    "description": "Permission denied. Browser CORS rejection may have an empty body.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40340"
        }
      }
    }
  },
  "404": {
    "description": "Unknown resource/action or unsupported method.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80019"
        }
      }
    }
  },
  "422": {
    "description": "Validation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80020"
        }
      }
    }
  },
  "429": {
    "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED42902"
        }
      }
    },
    "headers": {
      "Retry-After": {
        "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
        "schema": {
          "type": "string",
          "examples": [
            "30"
          ]
        }
      }
    }
  },
  "502": {
    "description": "Server-side operation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED50201"
        }
      }
    }
  }
}
```

## Aufrufbeispiele

Anpassen vor dem Ausführen. Platzhalter und veröffentlichte Beispiele sind synthetisch. Die Beispiele senden hier keine Anfrage; sie ergänzen keine unbekannten Pflichtfelder.

### cURL

```sh
: "${API_ORIGIN:?API_ORIGIN setzen}"
curl --request 'GET' \
  --url "${API_ORIGIN%/}"'/v2/auth/admin_invitation'
```

### JavaScript (Node.js)

```javascript
const required = (name) => {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
};
let path = "/v2/auth/admin_invitation";
const origin = required('API_ORIGIN');
const url = new URL((origin.endsWith('/') ? origin.slice(0, -1) : origin) + path);
const headers = {};
const response = await fetch(url, { method: "GET", headers, redirect: 'manual' });
const text = await response.text();
console.log(response.status, text);
// HTTP-Status und dokumentierte error/success-Felder gemeinsam prüfen.
```

### Python

```python
import os
import urllib.parse
import urllib.request
import urllib.error

path = "/v2/auth/admin_invitation"
url = os.environ["API_ORIGIN"].rstrip("/") + path
headers = {}

# Redirects nicht automatisch verfolgen.
class NoRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None
request = urllib.request.Request(url, headers=headers, method="GET")
try:
    response = urllib.request.build_opener(NoRedirect).open(request, timeout=30)
except urllib.error.HTTPError as error:
    response = error
print(response.status, response.read().decode("utf-8", errors="replace"))
# HTTP-Status und dokumentierte error/success-Felder gemeinsam prüfen.
```

## Vollständige Operationsdefinition und edoobox-Hinweise

Alle Originalfelder einschliesslich `x-edoobox-*`, requestBody und responses bleiben erhalten. Teilweise dokumentierte Schemata sind kein vollständiger Validierungsvertrag.

```json
{
  "operationId": "get_v2_auth_admin_invitation",
  "summary": "Gültigkeit einer Administrator-Einladung prüfen",
  "description": "Prüft den vertraulichen Einladungs-code aus der Query und liefert Gültigkeit, Status, Ablaufzeit sowie Anzeigenamen. Fehlende/ungültige Codes liefern valid=false; die Einladung wird durch das Lesen nicht angenommen.",
  "tags": [
    "auth"
  ],
  "security": [],
  "parameters": [
    {
      "name": "code",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "writeOnly": true,
        "x-edoobox-sensitive": true,
        "description": "Einladungs-Code aus dem erhaltenen Link, 40 bis 200 Zeichen."
      },
      "description": "Vertraulicher Einladungs-Code."
    }
  ],
  "responses": {
    "200": {
      "description": "Öffentliche Einladungsanzeige ohne interne IDs.",
      "content": {
        "application/json": {
          "example": {
            "success": true,
            "error": false,
            "data": {
              "valid": true,
              "status": "pending",
              "expires_at": 1790261000,
              "invited_by_name": "Kim Beispiel",
              "admin_name": "Alex Beispiel"
            }
          },
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "error": {
                "type": [
                  "boolean",
                  "string"
                ]
              },
              "error_code": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "valid": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "invited_by_name": {
                    "type": "string"
                  },
                  "admin_name": {
                    "type": "string"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "valid",
                  "status",
                  "expires_at",
                  "invited_by_name",
                  "admin_name"
                ]
              },
              "type": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        }
      }
    },
    "400": {
      "description": "Invalid request.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40006"
          }
        }
      }
    },
    "401": {
      "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40103"
          }
        }
      }
    },
    "402": {
      "description": "Missing/invalid action data or subscription/operation restriction.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80100"
          }
        }
      }
    },
    "403": {
      "description": "Permission denied. Browser CORS rejection may have an empty body.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40340"
          }
        }
      }
    },
    "404": {
      "description": "Unknown resource/action or unsupported method.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80019"
          }
        }
      }
    },
    "422": {
      "description": "Validation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80020"
          }
        }
      }
    },
    "429": {
      "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED42902"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
          "schema": {
            "type": "string",
            "examples": [
              "30"
            ]
          }
        }
      }
    },
    "502": {
      "description": "Server-side operation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED50201"
          }
        }
      }
    }
  },
  "x-edoobox-mutates-state": false,
  "x-edoobox-runtimeMutationGuard": false,
  "x-edoobox-get-effect": "read",
  "x-edoobox-documentationReview": {
    "file": "docs/openapi/operation-contracts/05-auth.json",
    "notes": []
  },
  "x-edoobox-source": {
    "file": "application/controllers/V2.php",
    "method": "coreV2",
    "line": 28
  },
  "x-edoobox-documentationStatus": "reviewed",
  "x-edoobox-readOnly": true,
  "x-edoobox-safeForAutomation": false,
  "x-edoobox-permission": {
    "description": "No account-JWT resource permission levels are applied. Authentication requirements, if any, are defined by this route source-specific boundary and dedicated security scheme.",
    "checkedByDispatcher": false,
    "levels": []
  }
}
```
