Enroll Attendee to Event
The enrollAttendeeToEvent mutation enrolls a single user into an event. The operation is idempotent — re-enrolling an already-enrolled user returns the existing attendee with wasNewlyCreated: false.
Manual enrollments always create a Payment with amount: 0 regardless of ticket price. See the Event Mutations overview for why.
Input Parameters
Section titled “Input Parameters”| Field | Type | Required | Description |
|---|---|---|---|
eventId | String! | Yes | ID of the event |
userId | String | No* | ID of an existing student in this school |
email | String | No* | Student email; creates a placeholder student-role user if no match |
name | String | No | Required when creating a new user via email. Ignored when email matches an existing student; the stored name is preserved. |
ticketId | String | No | Ticket on the event. Defaults to event.tickets.first if omitted. Required when the event has zero tickets configured (otherwise returns EVENT-005). |
*Note: Either userId or email must be provided.
Return Type
Section titled “Return Type”type AdminEnrollAttendeeToEventPayload { attendee: AdminEventAttendee # null when an error was raised wasNewlyCreated: Boolean # false on idempotent re-enroll}Errors surface as top-level GraphQL execution errors with extensions.error.code (see the table below), not on the payload.
AdminEventAttendee Object
Section titled “AdminEventAttendee Object”| Field | Type | Description |
|---|---|---|
id | String! | Enrollment ID. Pass to removeAttendeeFromEvent as attendeeId. |
userId | String! | Underlying User ID. Pass to removeAttendeeFromEvent as userId. |
paymentId | String! | Associated Payment ID (manual_enrolled with amount: 0 for admin-enrolled comp seats). Always present — every Enrollment has an associated Payment row. |
email | String! | Attendee email |
name | String | Attendee name |
attendStatus | AdminEventAttendStatus! | Enum: enrolled, checked_in, no_show, cancelled. See the enum reference. |
checkInAt | Int | Check-in time (Unix Timestamp) |
createdAt | Int! | Enrollment created time (Unix Timestamp) |
Example
Section titled “Example”mutation EnrollAttendee { enrollAttendeeToEvent( eventId: "evt_01HQ..." email: "attendee@example.com" name: "Jane Doe" ) { attendee { id email attendStatus } wasNewlyCreated }}Sample Response
Section titled “Sample Response”{ "data": { "enrollAttendeeToEvent": { "attendee": { "id": "enr_01HQABCD...", "email": "attendee@example.com", "attendStatus": "enrolled" }, "wasNewlyCreated": true } }}AdminEventAttendStatus Values
Section titled “AdminEventAttendStatus Values”| Value | Description |
|---|---|
enrolled | Active enrollment; the user has a confirmed seat. |
checked_in | Attendee was checked in at the event. |
no_show | Event ended without the attendee checking in. |
cancelled | Enrollment was canceled (rare — removeAttendeeFromEvent destroys the row instead). |
Common Errors
Section titled “Common Errors”Errors split across two namespaces:
ENROLLMENT-*codes are shared withenrollStudentToCourse; they classify caller-input issues (missing args, user lookup failure, email format).EVENT-*codes are event-specific; they classify event-state issues (capacity, lifecycle, ticket configuration).
| Code | Retryability | Description |
|---|---|---|
ENROLLMENT-001 | Programmer error | Either userId or email must be provided |
ENROLLMENT-002 | Permanent (skip row) | User not found (when userId was provided) |
ENROLLMENT-006 | Permanent (skip row) | Invalid email format |
ENROLLMENT-007 | Permanent (skip row) | Name is required when creating a new user |
EVENT-001 | Programmer error | Event not found |
EVENT-002 | Programmer error | Ticket not found or does not belong to this event |
EVENT-003 | Transient — retry only if capacity may free | Event has reached its maximum attendee capacity |
EVENT-004 | Permanent | Event is canceled or completed (not enrollable) |
EVENT-005 | Programmer error | Event has no ticket configured |
EVENT-006 | Permanent (skip row) | User is archived |
OAuth Scope
Section titled “OAuth Scope”Requires students:write.
Related Resources
Section titled “Related Resources”- Bulk Enroll Attendees - Enroll many attendees in one call
- Remove Attendee - Remove a user’s enrollment
- Event Mutations Overview
For more information about the Teachify Admin API, please refer to the API Overview.