Amar Events API

REST API for the Amar Events platform. Base URL: https://amarevents.zone.id/api
All responses are JSON. All request bodies should be JSON with Content-Type: application/json.


Authentication

All authenticated requests require an API key passed as a Bearer token in the Authorization header.

HeaderValue
AuthorizationBearer ae_u_<your_key>
Content-Typeapplication/json

Generate your API key from the API Keys dashboard or via POST /api/keys after logging in.

Public endpoints like GET /events, GET /organizations, and POST /auth/register do not require authentication. All write operations and private data require an API key.

API Key Types

Each API key has a type that determines what permissions it can hold and its rate limit. Choose the appropriate type when creating keys.

User Key

For end-users — browse events, manage your own tickets and profile.

60 req/min
  • events:read
  • tickets:read
  • tickets:write
  • users:read
  • users:write

Organizer Key

For organizers — manage events, tickets, and donations. Requires organizer account.

120 req/min
  • events:read/write/delete
  • tickets:read/write/delete
  • organizations:read/write
  • donations:read/write
  • users:read

Admin Key

Full platform access. Requires admin account. Use for integrations and automation.

300 req/min
  • All organizer permissions
  • users:write
  • admin routes
  • * (wildcard)

Key prefixes identify type at a glance: ae_u_… (user), ae_o_… (organizer), ae_a_… (admin).


Rate Limits

Rate limits are enforced per API key on a per-minute sliding window. Limits vary by key type.

Key TypeLimitWindow
user60 requestsPer minute
organizer120 requestsPer minute
admin300 requestsPer minute

Rate limit headers are included on every authenticated response:

HeaderDescription
X-RateLimit-LimitYour key's maximum requests per minute
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets
X-RateLimit-TypeYour key type (user / organizer / admin)
Retry-AfterSeconds to wait (only on 429 responses)
When you receive a 429 Too Many Requests response, wait until Retry-After seconds have passed before retrying.

Error Handling

All errors follow a consistent structure:

{
  "success": false,
  "error":   "Human-readable error message"
}
CodeMeaning
400Bad Request — missing or invalid field
401Unauthorized — no or invalid API key
403Forbidden — insufficient permissions or wrong key type
404Not Found — resource does not exist
405Method Not Allowed
429Too Many Requests — rate limit exceeded
500Internal Server Error

Pagination

List endpoints support page and limit query parameters. The response includes a pagination object.

{
  "success":    true,
  "data":       [...],
  "pagination": {
    "total": 142,
    "page":  1,
    "limit": 20,
    "pages": 8
  }
}

Maximum limit is 100. Default is 20.


Auth

POST /auth/register Create a new account
Public
FieldTypeNotes
usernamestringrequired Min 3 chars
emailstringrequired Valid email
passwordstringrequired Min 6 chars
numberstringrequired Phone number
{ "username": "john", "email": "john@email.com", "password": "secret123", "number": "01700000000" }
POST /auth/login Login — start a session
Public

Creates a server session. For API access, generate a key via POST /keys after login.

FieldTypeNotes
emailstringrequired
passwordstringrequired
POST /auth/logout Destroy session
Public
GET /auth/me Identity of current key/session
UserOrganizerAdmin

Events

GET /events List public events
Public
Query ParamTypeNotes
searchstringoptional Name, location, description
categorystringoptional Education, Sports, Concert…
organization_idintoptional
pageintoptional Default 1
limitintoptional Default 20, max 100
GET /events/{id} Get event details with ticket types and custom fields
Public
GET /events/{id}/tickets List all registrations for an event
OrganizerAdmin

Requires organizer ownership of the event or admin key.

Query ParamTypeNotes
statusstringoptional Pending / Success / Failed
page / limitintoptional
GET /events/{id}/stats Revenue and ticket stats for an event
OrganizerAdmin
{
  "total":         150,
  "approved":      120,
  "pending":       20,
  "failed":        10,
  "revenue":       36000.00,
  "by_ticket_type": [...]
}
GET /events/{id}/gallery Get event gallery images
Public
GET /events/{id}/fields Get custom registration fields for an event
Public
POST /events Create a new event
OrganizerAdmin
FieldTypeNotes
namestringrequired
organization_idintrequired
datestringoptional YYYY-MM-DD
deadlinestringoptional YYYY-MM-DD
locationstringoptional
categorystringoptional Education, Sports, Concert, Conference, Workshop, Festival, Charity, Cultural, Games, Other
descriptionstringoptional
banner / logostringoptional Image URL
privacystringoptional public (default) or private
ticket_typesarrayoptional Array of {name, price, capacity, description}
PUT /events/{id} Update an event
OrganizerAdmin

Send only the fields you want to update. Updatable fields: name, date, deadline, location, category, description, logo, banner, privacy, notice, emailtitle, emailmessage, template, socials, wallets.

DELETE /events/{id} Delete an event and all related data
OrganizerAdmin
This permanently deletes the event, all tickets, ticket types, custom fields, and gallery entries.

Organizations

GET /organizations List all organizations
Public
Query ParamTypeNotes
searchstringoptional
page / limitintoptional
GET /organizations/{id} Get organization with recent public events
Public
POST /organizations Create an organization (admin only)
Admin
FieldTypeNotes
namestringrequired
user_idintrequired Owner user ID
descriptionstringoptional
eventcountintoptional Slot allowance
PUT /organizations/{id} Update organization
OrganizerAdmin

Organizers can update name, description, notice. Admins can also update plan and eventcount.


Tickets

GET /tickets List tickets — own (user) or by event (organizer)
UserOrganizerAdmin

Without event_id: returns tickets for the authenticated user's email. With event_id: requires organizer ownership.

Query ParamTypeNotes
event_idintoptional Filter by event (organizer only)
statusstringoptional Pending / Success / Failed / Refunded
page / limitintoptional
GET /tickets/{id} Get ticket details with custom field values
UserOrganizerAdmin

User can only access their own ticket. Organizer can access tickets for their events.

POST /tickets Register for an event
UserOrganizerAdmin
FieldTypeNotes
event_idintrequired
namestringoptional Defaults to account name
emailstringoptional Defaults to account email
numberstringoptional
ticket_type_idintoptional
transaction_idstringoptional Payment transaction ID
amountfloatoptional Overrides ticket type price
notestringoptional
custom_fieldsobjectoptional Key-value map of custom field responses
POST /tickets/{id}/verify Verify ticket validity (e.g. for QR scan)
OrganizerAdmin
{
  "ticket_id":  42,
  "name":       "Karim Rahman",
  "email":      "karim@email.com",
  "status":     "Success",
  "event":      "Tech Summit 2025",
  "event_date": "2025-06-10",
  "valid":      true
}
PUT /tickets/{id} Update ticket status or details
OrganizerAdmin
FieldTypeNotes
statusstringoptional Success / Pending / Failed / Refunded
transidstringoptional
name / email / number / notestringoptional
amountfloatoptional
ticket_type_idintoptional
DELETE /tickets/{id} Delete a ticket
OrganizerAdmin

Ticket Types

GET /ticket-types?event_id={id} List ticket types for an event with availability
Public
POST /ticket-types Create a ticket type for an event
OrganizerAdmin
FieldTypeNotes
event_idintrequired
namestringrequired
pricefloatoptional Default 0 (free)
capacityintoptional 0 = unlimited
descriptionstringoptional
PUT /ticket-types/{id} Update a ticket type
OrganizerAdmin
DELETE /ticket-types/{id} Delete a ticket type (only if no approved tickets)
OrganizerAdmin

Donations

GET /donations List donations (own org for organizers, all for admin)
OrganizerAdmin
Query ParamTypeNotes
statusstringoptional pending / verified
page / limitintoptional
POST /donations Submit a donation
Public
FieldTypeNotes
emailstringrequired
numberstringrequired
amountintrequired Min 1
transaction_idstringrequired Min 5 chars
typestringrequired bkash / nagad / rocket / card / other
organization_idintoptional
notestringoptional
PUT /donations/{id} Update donation status
OrganizerAdmin
FieldTypeNotes
statusstringrequired pending / approved / rejected

Users

GET /users/me Get own profile with organization and stats
UserOrganizerAdmin
GET /users/me/tickets List own ticket registrations
User
Query ParamNotes
statusPending / Success / Failed
page / limitPagination
GET /users/me/keys List own API keys
UserOrganizerAdmin
PUT /users/me Update profile
UserOrganizer
FieldTypeNotes
usernamestringoptional Min 3 chars, must be unique
numberstringoptional
pfpstringoptional Profile picture URL
countrystringoptional
passwordstringoptional Requires current_password
current_passwordstringRequired when changing password

API Keys

GET /keys List own API keys
UserOrganizerAdmin
POST /keys Create a new API key
UserOrganizerAdmin
You must be logged in via session (POST /auth/login) or already have a key to create new keys via the API. Easier to use the dashboard.
FieldTypeNotes
namestringrequired
key_typestringrequired user / organizer / admin
permissionsarrayoptional Subset of allowed permissions for the key type
expires_atstringoptional ISO date e.g. 2026-01-01
{
  "name":        "My App",
  "key_type":    "organizer",
  "permissions": ["events:read", "tickets:read", "tickets:write"],
  "expires_at":  "2027-01-01"
}

Response includes the raw key — save it immediately, it is never shown again.

{
  "id":          12,
  "key":         "ae_o_4f8a…",
  "key_type":    "organizer",
  "permissions": [...],
  "rate_limit":  120
}
PUT /keys/{id} Update key name, permissions, or active status
UserOrganizerAdmin
FieldTypeNotes
namestringoptional
permissionsarrayoptional Must be within allowed permissions for key type
is_activebooloptional
DELETE /keys/{id} Revoke an API key
UserOrganizerAdmin

Admin

All admin endpoints require an admin API key (key_type = admin) or an active admin session. Organizer keys with admin permission do not grant access.
GET /admin/stats Platform-wide statistics
Admin
GET /admin/users List all users with filtering
Admin
Query ParamNotes
searchUsername, email, or phone
typeuser / organizer
admin0 or 1
page / limitPagination
GET /admin/users/{id} Get user with organization, API keys, and ticket count
Admin
PUT /admin/users/{id} Update user — promote/demote organizer, change password
Admin
FieldNotes
username / email / number / type / admin / countryUpdate user fields
passwordNew password (min 6 chars)
promote_organizertrue — sets type to organizer and creates org if none exists
demote_organizertrue — sets type back to user
DELETE /admin/users/{id} Permanently delete a user and their data
Admin
GET /admin/events List all events (public and private)
Admin
Query ParamNotes
searchEvent name
privacypublic / private
page / limitPagination
GET /admin/donations List all donations across the platform
Admin
PUT /admin/donations/{id} Update donation status
Admin
FieldNotes
statuspending / verified / rejected
GET /admin/api-keys List all API keys on the platform
Admin
Query ParamNotes
user_idFilter by user
active0 or 1
key_typeuser / organizer / admin
page / limitPagination
DELETE /admin/revoke-key/{id} Force-revoke any API key
Admin
GET /admin/plans List all subscription plans
Admin
GET /admin/rate-limits View recent rate limit usage by key
Admin

Permissions Reference

PermissionAllowsAvailable In
events:readRead public and private events you ownall types
events:writeCreate and update eventsorganizer, admin
events:deleteDelete eventsorganizer, admin
tickets:readRead your own tickets or event ticketsall types
tickets:writeRegister for events, update ticket statusall types
tickets:deleteDelete ticketsorganizer, admin
organizations:readRead organization detailsorganizer, admin
organizations:writeUpdate organizationorganizer, admin
donations:readRead donations for your orgorganizer, admin
donations:writeUpdate donation statusorganizer, admin
users:readRead own profileall types
users:writeUpdate own profileuser, admin
adminAccess all admin routesadmin only
*All permissionsadmin only