Skip to content

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.

FieldTypeRequiredDescription
eventIdString!YesID of the event
userIdStringNo*ID of an existing student in this school
emailStringNo*Student email; creates a placeholder student-role user if no match
nameStringNoRequired when creating a new user via email. Ignored when email matches an existing student; the stored name is preserved.
ticketIdStringNoTicket 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.

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.

FieldTypeDescription
idString!Enrollment ID. Pass to removeAttendeeFromEvent as attendeeId.
userIdString!Underlying User ID. Pass to removeAttendeeFromEvent as userId.
paymentIdString!Associated Payment ID (manual_enrolled with amount: 0 for admin-enrolled comp seats). Always present — every Enrollment has an associated Payment row.
emailString!Attendee email
nameStringAttendee name
attendStatusAdminEventAttendStatus!Enum: enrolled, checked_in, no_show, cancelled. See the enum reference.
checkInAtIntCheck-in time (Unix Timestamp)
createdAtInt!Enrollment created time (Unix Timestamp)
mutation EnrollAttendee {
enrollAttendeeToEvent(
eventId: "evt_01HQ..."
email: "attendee@example.com"
name: "Jane Doe"
) {
attendee { id email attendStatus }
wasNewlyCreated
}
}
{
"data": {
"enrollAttendeeToEvent": {
"attendee": {
"id": "enr_01HQABCD...",
"email": "attendee@example.com",
"attendStatus": "enrolled"
},
"wasNewlyCreated": true
}
}
}
ValueDescription
enrolledActive enrollment; the user has a confirmed seat.
checked_inAttendee was checked in at the event.
no_showEvent ended without the attendee checking in.
cancelledEnrollment was canceled (rare — removeAttendeeFromEvent destroys the row instead).

Errors split across two namespaces:

  • ENROLLMENT-* codes are shared with enrollStudentToCourse; 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).
CodeRetryabilityDescription
ENROLLMENT-001Programmer errorEither userId or email must be provided
ENROLLMENT-002Permanent (skip row)User not found (when userId was provided)
ENROLLMENT-006Permanent (skip row)Invalid email format
ENROLLMENT-007Permanent (skip row)Name is required when creating a new user
EVENT-001Programmer errorEvent not found
EVENT-002Programmer errorTicket not found or does not belong to this event
EVENT-003Transient — retry only if capacity may freeEvent has reached its maximum attendee capacity
EVENT-004PermanentEvent is canceled or completed (not enrollable)
EVENT-005Programmer errorEvent has no ticket configured
EVENT-006Permanent (skip row)User is archived

Requires students:write.

For more information about the Teachify Admin API, please refer to the API Overview.