Skip to main content

Documentation Index

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

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

This endpoint registers a new voter by email address. On success, it returns the registered voter identifier. If the email is already in use, the endpoint returns an error status instead of creating a duplicate entry. Registration is only accepted while the system is in the register phase — calls made after voting has started will be rejected.
POST /voters/register

Request body

email
string
required
The voter’s email address. Must be unique across all registered voters.

Response fields

status
"success" | "error"
Indicates whether the registration succeeded or failed.
message
"voter registered successfully" | "email already exists"
Human-readable description of the outcome.
voter
string
The registered voter identifier, typically the email address supplied in the request.

Example request

curl -X POST "$API_URL/voters/register" \
  -H "Content-Type: application/json" \
  -d '{"email": "alice@example.com"}'

Example responses

{
  "status": "success",
  "message": "voter registered successfully",
  "voter": "alice@example.com"
}
Registration is only available when voting_status === "register". Once the voting phase begins, this endpoint will no longer accept new registrations.

Build docs developers (and LLMs) love