Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Crypto-Project-ENSTA/back-end/llms.txt

Use this file to discover all available pages before exploring further.

Call this endpoint to enroll a new voter before the election opens. You supply the voter’s email address, and the system records it in the database. On success the voter will receive credential emails containing the N1 and N2 codes they need for the voting flow. If the email is already registered the endpoint returns a 409 response with the same RegisterResponse shape so you can handle both cases uniformly.

Request

POST /voters/register

Body

email
string
required
The email address of the voter to register. Must be unique across all registered voters.

Response

status
string
required
Outcome of the registration attempt. "success" when the voter was created; "error" when registration was rejected (for example, a duplicate email).
message
string
required
Human-readable description of the result, such as "Voter registered successfully" or "Email already exists".
voter
string
required
The email address of the voter concerned by this response.

HTTP status codes

CodeMeaning
201Voter registered successfully.
409The email address is already enrolled in the system.
400Registration failed due to a malformed request or an unexpected server error.

Example

curl -X POST https://your-api/voters/register \
  -H "Content-Type: application/json" \
  -d '{"email": "alice@example.com"}'
{
  "status": "success",
  "message": "Voter registered successfully",
  "voter": "alice@example.com"
}

Build docs developers (and LLMs) love