> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.helpyousponsor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload an attendance workbook

> Requires participation_configure, programs_view and access to this organization’s program, with participation enabled. Accepts a private CSV/XLSX file up to20MiB and an existing program participation period. Inspects up to12 sample rows per sheet for mapping. Workbook bounds are100 sheets,100000 source rows,512 columns and2000000 expanded cells. A matching organization-wide upload idempotency key returns the original batch with HTTP200; reuse for another program/period returns422. Upload does not create participation checks. Requires permission: one of participation_configure.



## OpenAPI

````yaml post /admin/programs/{program_id}/participation/imports
openapi: 3.0.0
info:
  title: Gratona API
  description: >-
    REST API for the Gratona fundraising platform, including donor, donation,
    sponsorship, program, event, and integration workflows. Endpoints are
    organized by tag. Most endpoints require either a Passport bearer token or
    an issued API key — see the Security Schemes section.
  contact:
    name: Gratona Engineering
    url: https://gratona.com
    email: devs@gratona.com
  version: 1.0.0
servers:
  - url: https://api.gratona.com/v1
    description: Server Version 1.0.0
security: []
tags:
  - name: Auth
    description: >-
      Login, signup, logout, password reset, and email verification for admin
      users and donors.
  - name: Donors
    description: >-
      Donor records: CRUD, profile fields, household linkage, search, filters,
      merge, and duplicate detection.
  - name: Donations
    description: >-
      Individual donation records, recurring commitments, soft credits, refunds,
      designations, and exports.
  - name: Sponsorships
    description: >-
      Donor-to-entity commitment relationships, lifecycle transitions, and
      commitment-specific filters.
  - name: Entities
    description: >-
      Recipient records (children, families, projects, animals, etc.), their
      status, and entity-level fields.
  - name: Programs
    description: >-
      Program / campaign configuration: hierarchy, settings, and program-level
      metadata.
  - name: Forms
    description: >-
      Custom form builder (HysForm), form fields, standardized donor fields, and
      field migrations.
  - name: Trips
    description: >-
      Mission-trip management: trips, participants, budgets, tasks,
      e-signatures, fundraising milestones, and background checks.
  - name: Communications
    description: >-
      Email templates, SMS, newsletters, donor email manager, and per-donor
      notes.
  - name: Payments
    description: >-
      Payment-gateway management (Stripe, PayPal, Flutterwave, QuickBooks).
      Excludes inbound webhooks — see the Webhooks tag.
  - name: Reports
    description: Dashboards, analytics, scheduled reports, and exports.
  - name: Admin
    description: >-
      Client-account administration: users, groups/permissions, settings,
      integrations, and account lifecycle.
  - name: Donor Portal
    description: >-
      Endpoints consumed by the donor-facing portal (donor login, dashboard,
      donation history, messages).
  - name: Recipient Portal
    description: Endpoints consumed by the recipient-facing portal.
  - name: Public
    description: >-
      Unauthenticated public endpoints: donor signup, public trip pages,
      peer-to-peer campaigns, public checkout.
  - name: Webhooks
    description: >-
      Inbound webhooks from third parties (Stripe, PayPal, Flutterwave, Checkr,
      DropboxSign). Annotated minimally for reference; payload shapes are owned
      by the upstream provider.
  - name: Events
    description: >-
      Event setup, invitations, registration, ticketing, attendance and event
      reporting.
  - name: Journeys
    description: >-
      Journey graphs, activation, enrollment, message templates and event
      follow-up automations.
  - name: Tasks
    description: Workspace tasks, assignments, saved task views and record collaboration.
  - name: Fundraising
    description: >-
      Fundraising portfolios, stewardship plans, giving anniversaries and
      personal donor follow-up.
  - name: Impact Stories
    description: Story intake, review, assets, consent and publication workflows.
  - name: Integrations
    description: Workspace integration connections, mappings, synchronization and recovery.
  - name: Email Calendar
    description: Connected email/calendar accounts and donor interactions.
  - name: Spaces
    description: Workspace Spaces and collaborative Pages.
  - name: Library
    description: Workspace documents, source connections, files and analysis.
  - name: Intelligence
    description: Donor intelligence and Tali workspace workflows.
  - name: Automation
    description: >-
      V3 automation primitive discovery, input validation, invocation and Zapier
      contracts.
  - name: Schema
    description: V3 model, enum, capability and scope discovery.
  - name: Zapier
    description: Zapier automation connections, polling feeds and actions.
  - name: Files
    description: Files
  - name: Client
    description: Client
  - name: Payment Gateways
    description: Payment Gateways
  - name: Email Settings
    description: Email Settings
  - name: Admin Dashboard
    description: Admin Dashboard
  - name: Recipients
    description: Recipients
  - name: Historical Archived Updates
    description: Historical Archived Updates
  - name: Team & access
    description: Team & access
  - name: Settings
    description: Settings
  - name: Notifications
    description: Notifications
  - name: Participation
    description: Participation
  - name: Users
    description: Users
  - name: Wrapped
    description: Wrapped
  - name: Donor SignUp
    description: Donor SignUp
  - name: Frontend
    description: Frontend
  - name: User
    description: User
  - name: Workspace
    description: Workspace
paths:
  /admin/programs/{program_id}/participation/imports:
    post:
      tags:
        - Participation
      summary: Upload an attendance workbook
      description: >-
        Requires participation_configure, programs_view and access to this
        organization’s program, with participation enabled. Accepts a private
        CSV/XLSX file up to20MiB and an existing program participation period.
        Inspects up to12 sample rows per sheet for mapping. Workbook bounds
        are100 sheets,100000 source rows,512 columns and2000000 expanded cells.
        A matching organization-wide upload idempotency key returns the original
        batch with HTTP200; reuse for another program/period returns422. Upload
        does not create participation checks. Requires permission: one of
        participation_configure.
      operationId: reference_Admin_ParticipationImportController_upload
      parameters:
        - name: program_id
          in: path
          description: Program id in the current organization.
          required: true
          schema:
            type: integer
          example: 42
      requestBody:
        description: Validated request fields for this operation.
        required: true
        content:
          multipart/form-data:
            schema:
              required:
                - file
                - participation_period_id
                - idempotency_key
              properties:
                file:
                  description: >-
                    CSV or XLSX attendance workbook, maximum20480KiB. MIME and
                    extension are checked.
                  type: string
                  format: binary
                participation_period_id:
                  description: Existing participation period in this program.
                  type: integer
                  minimum: 1
                  example: 18
                idempotency_key:
                  description: >-
                    Stable upload retry key; scoped across the current
                    organization.
                  type: string
                  maxLength: 255
                  example: attendance-upload-2026-10-20
              type: object
      responses:
        '200':
          description: >-
            Original batch returned for an idempotent upload retry, including
            paged rows and recipient fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParticipationImportBatch'
        '201':
          description: Operation result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParticipationImportBatch'
        '401':
          description: Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: >-
            The authenticated user lacks access to this workflow or its related
            records.
        '404':
          description: The program or its participation period is missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Request validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestRejection'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      servers:
        - url: https://api.gratona.com/v1
          description: Gratona API
components:
  schemas:
    ParticipationImportBatch:
      properties:
        id:
          type: integer
          example: 42
        program_id:
          type: integer
          example: 12
        participation_period_id:
          type: integer
          example: 18
          nullable: true
        original_filename:
          type: string
          example: attendance.xlsx
        source_type:
          type: string
          enum:
            - csv
            - xlsx
          example: xlsx
        status:
          type: string
          enum:
            - pending
            - validating
            - review
            - processing
            - completed
            - failed
            - voided
          example: review
        progress:
          type: integer
          example: 100
        mapping:
          oneOf:
            - $ref: '#/components/schemas/ParticipationImportMapping'
            - type: string
              enum:
                - null
              nullable: true
        inspection:
          type: array
          items:
            properties:
              name:
                type: string
                example: Sheet1
              suggested_header_row:
                type: integer
                example: 1
              columns:
                type: array
                items:
                  properties:
                    index:
                      type: integer
                      example: 0
                    letter:
                      type: string
                      example: A
                  type: object
              sample_rows:
                type: array
                items:
                  properties:
                    row_number:
                      type: integer
                      example: 2
                    values:
                      type: array
                      items:
                        type: string
                        example: Jane Recipient
                  type: object
                maxItems: 12
            type: object
        summary:
          description: >-
            Counts after validation; empty array before counts exist. Limit
            failures add estimated_rows/maximum_rows.
          oneOf:
            - properties:
                total_rows:
                  type: integer
                  example: 1
                ready_rows:
                  type: integer
                  example: 1
                review_rows:
                  type: integer
                  example: 1
                blocked_rows:
                  type: integer
                  example: 1
                unresolved_rows:
                  type: integer
                  example: 1
                committed_rows:
                  type: integer
                  example: 1
                skipped_rows:
                  type: integer
                  example: 1
                exact_id_matches:
                  type: integer
                  example: 1
                provisional_rows:
                  type: integer
                  example: 1
                estimated_rows:
                  type: integer
                  example: 1
                maximum_rows:
                  type: integer
                  example: 1
              type: object
              additionalProperties: true
            - type: array
              items:
                type: string
              maxItems: 0
        validation_errors:
          type: array
          items:
            properties:
              sheet:
                type: string
                example: Sheet1
              row:
                type: integer
                example: 2
              date:
                type: string
                format: date
                example: '2026-10-20'
                nullable: true
              codes:
                type: array
                items:
                  type: string
                  example: placement_conflict
            type: object
          maxItems: 100
        error_message:
          type: string
          example: >-
            The attendance file could not be validated. Review the mapping and
            retry.
          nullable: true
        failure_stage:
          type: string
          enum:
            - validation
            - commit
            - null
          example: validation
          nullable: true
        can_commit:
          description: True only in review with zero blocked and review rows.
          type: boolean
          example: true
        can_void:
          description: True only while completed.
          type: boolean
          example: false
        created_at:
          type: string
          format: date-time
          example: '2026-10-20T12:00:00Z'
          nullable: true
        completed_at:
          type: string
          format: date-time
          example: '2026-10-20T12:05:00Z'
          nullable: true
        voided_at:
          type: string
          format: date-time
          nullable: true
        void_reason:
          type: string
          example: Imported the incorrect workbook.
          nullable: true
        created_checks:
          type: array
          items:
            properties:
              id:
                type: integer
                example: 120
              scheduled_for:
                type: string
                format: date
                example: '2026-10-20'
                nullable: true
              status:
                type: string
                enum:
                  - draft
                  - submitted
                  - superseded
                  - voided
                example: submitted
              revision:
                type: integer
                example: 1
              site:
                properties:
                  id:
                    type: integer
                    example: 12
                  name:
                    type: string
                    example: Main campus
                    nullable: true
                type: object
                nullable: true
              cohort:
                properties:
                  id:
                    type: integer
                    example: 12
                  name:
                    type: string
                    example: Main campus
                    nullable: true
                type: object
                nullable: true
              counts:
                properties:
                  expected:
                    type: integer
                    example: 25
                  seen:
                    type: integer
                    example: 23
                  unresolved:
                    type: integer
                    example: 2
                type: object
            type: object
        rows:
          properties:
            items:
              type: array
              items:
                $ref: '#/components/schemas/ParticipationImportRow'
            total:
              type: integer
              example: 25
            current_page:
              type: integer
              example: 1
            per_page:
              type: integer
              example: 50
            last_page:
              type: integer
              example: 1
          type: object
        recipient_fields:
          type: array
          items:
            properties:
              key:
                type: string
                example: student_id
              label:
                type: string
                example: Student ID
              type:
                type: string
                example: hysCustomID
              is_title:
                type: boolean
                example: false
            type: object
      type: object
    UnauthorizedResponse:
      title: UnauthorizedResponse
      description: >-
        Returned with HTTP 401 when the request lacks a valid Passport bearer
        token, a valid `X-HYS-API-Key`, or a valid session. The body is the
        simple `{message, status}` envelope emitted by `AuthenticateApiOrKey`.
      required:
        - message
        - status
      properties:
        message:
          description: >-
            Always the literal string `Unauthorized` from the `auth.api_or_key`
            middleware. Login endpoints return `Invalid Credentials` instead.
          type: string
          example: Unauthorized
        status:
          type: string
          example: error
      type: object
    NotFoundResponse:
      title: NotFoundResponse
      description: >-
        Returned with HTTP 404 when a resource lookup misses (typically because
        the id doesn't exist OR is scoped to a different `client_id`). Note:
        many endpoints intentionally collapse 'not found' and 'forbidden' into a
        single 404 to avoid leaking which records exist in another tenant.
      required:
        - message
      properties:
        message:
          description: >-
            Human-readable message. Often a more specific string like `Donor not
            found` or `Trip not found`.
          type: string
          example: Not Found
        status:
          type: string
          example: error
      type: object
    RequestRejection:
      description: >-
        Request or workflow rejection. Framework field-validation failures
        contain errors; semantic rejections may contain message without errors;
        legacy/provider failures may use error and error_code. The operation
        description identifies the rejected condition. Domain responses may add
        current revision, limits or other conflict context.
      anyOf:
        - $ref: '#/components/schemas/ValidationErrorResponse'
        - $ref: '#/components/schemas/ErrorResponse'
        - required:
            - error
          properties:
            error:
              description: Legacy or provider-facing error message.
              type: string
              example: The request could not be completed.
            error_code:
              description: Stable domain error code, when provided.
              type: string
              example: WORKFLOW_UNAVAILABLE
          type: object
    ParticipationImportMapping:
      required:
        - evidence_source
        - existing_session_action
        - symbols
        - sheets
      properties:
        evidence_source:
          description: >-
            One of this program’s allowed evidence sources; use participation
            setup options to discover restrictions.
          type: string
          enum:
            - official_record
            - headcount
            - staff_confirmation
            - participant_confirmation
            - legacy_import
            - other
          example: official_record
        external_student_id_field_key:
          description: >-
            Optional current program hysCustomID field used for exact student ID
            matching.
          type: string
          maxLength: 100
          example: student_id
          nullable: true
        gender_field_key:
          description: Optional current program recipient field for match scoring.
          type: string
          maxLength: 100
          example: gender
          nullable: true
        existing_session_action:
          description: >-
            How validation handles a check already present for the
            date/site/cohort.
          type: string
          enum:
            - block
            - skip
            - correction
          example: block
        symbols:
          description: >-
            Map source symbols (keys at most100 characters) to encounter and
            enrollment states. Each mapped symbol needs confirmed_enrolled or
            unresolved for dry-run rows to be committable; omitted/null
            confirmation blocks those rows.
          oneOf:
            - description: >-
                Map source symbols (keys at most100 characters) to encounter and
                enrollment states. Each mapped symbol needs confirmed_enrolled
                or unresolved for dry-run rows to be committable; omitted/null
                confirmation blocks those rows.
              maxProperties: 50
              minProperties: 1
              type: object
              additionalProperties:
                required:
                  - encounter_status
                properties:
                  encounter_status:
                    type: string
                    enum:
                      - seen
                      - not_seen
                      - not_checked
                      - not_expected
                      - unclear
                    example: seen
                  enrollment_confirmation:
                    description: >-
                      Choose confirmed_enrolled or unresolved for every mapped
                      symbol. Omitted/null passes mapping validation but blocks
                      expanded attendance rows during the dry run.
                    type: string
                    enum:
                      - confirmed_enrolled
                      - unresolved
                      - null
                    example: confirmed_enrolled
                    nullable: true
                type: object
            - type: array
              items:
                required:
                  - encounter_status
                properties:
                  encounter_status:
                    type: string
                    enum:
                      - seen
                      - not_seen
                      - not_checked
                      - not_expected
                      - unclear
                    example: seen
                  enrollment_confirmation:
                    description: >-
                      Choose confirmed_enrolled or unresolved for every mapped
                      symbol. Omitted/null passes mapping validation but blocks
                      expanded attendance rows during the dry run.
                    type: string
                    enum:
                      - confirmed_enrolled
                      - unresolved
                      - null
                    example: confirmed_enrolled
                    nullable: true
                type: object
              maxItems: 50
        sheets:
          type: array
          items:
            required:
              - sheet
              - header_row
              - columns
              - site
              - cohort
              - attendance_columns
            properties:
              enabled:
                description: Default true; at least one sheet must remain enabled.
                type: boolean
                example: true
              sheet:
                description: Exact inspected worksheet name; use CSV for CSV files.
                type: string
                maxLength: 255
                example: Sheet1
              header_row:
                description: One-based header row; data starts after it.
                type: integer
                maximum: 10000
                minimum: 1
                example: 1
              columns:
                properties:
                  name:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                  gratona_id:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                  student_id:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                  gender:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                type: object
              site:
                properties:
                  fixed_id:
                    description: Fixed site/cohort ID within this program.
                    type: integer
                    minimum: 1
                    example: 42
                    nullable: true
                  column:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                  value_map:
                    description: >-
                      Workbook cell text to organization/program site or cohort
                      ID.
                    oneOf:
                      - description: >-
                          Workbook cell text to organization/program site or
                          cohort ID.
                        maxProperties: 500
                        type: object
                        additionalProperties:
                          type: integer
                          minimum: 1
                          example: 42
                          nullable: true
                      - type: array
                        items:
                          type: integer
                          minimum: 1
                          example: 42
                          nullable: true
                        maxItems: 500
                type: object
              cohort:
                properties:
                  fixed_id:
                    description: Fixed site/cohort ID within this program.
                    type: integer
                    minimum: 1
                    example: 42
                    nullable: true
                  column:
                    description: Zero-based workbook column index.
                    type: integer
                    maximum: 10000
                    minimum: 0
                    example: 0
                    nullable: true
                  value_map:
                    description: >-
                      Workbook cell text to organization/program site or cohort
                      ID.
                    oneOf:
                      - description: >-
                          Workbook cell text to organization/program site or
                          cohort ID.
                        maxProperties: 1000
                        type: object
                        additionalProperties:
                          type: integer
                          minimum: 1
                          example: 42
                          nullable: true
                      - type: array
                        items:
                          type: integer
                          minimum: 1
                          example: 42
                          nullable: true
                        maxItems: 1000
                type: object
              profile_columns:
                description: >-
                  Current program recipient field keys mapped to zero-based
                  source columns.
                oneOf:
                  - description: >-
                      Current program recipient field keys mapped to zero-based
                      source columns.
                    maxProperties: 100
                    type: object
                    additionalProperties:
                      type: integer
                      maximum: 10000
                      minimum: 0
                      example: 0
                  - type: array
                    items:
                      type: integer
                      maximum: 10000
                      minimum: 0
                      example: 0
                    maxItems: 100
              attendance_columns:
                type: array
                items:
                  required:
                    - column
                    - date
                  properties:
                    column:
                      description: Zero-based attendance-symbol column.
                      type: integer
                      maximum: 10000
                      minimum: 0
                      example: 4
                    date:
                      type: string
                      format: date
                      example: '2026-10-20'
                  type: object
                maxItems: 366
                minItems: 1
            type: object
          maxItems: 100
          minItems: 1
      type: object
    ParticipationImportRow:
      properties:
        id:
          type: integer
          example: 84
        sheet:
          type: string
          example: Sheet1
        source_row_number:
          type: integer
          example: 2
        attendance_date:
          type: string
          format: date
          example: '2026-10-20'
          nullable: true
        display_name:
          type: string
          example: Jane Recipient
          nullable: true
        gratona_id:
          type: string
          example: '42'
          nullable: true
        external_student_id:
          type: string
          example: STU-001
          nullable: true
        site_id:
          type: integer
          example: 12
          nullable: true
        cohort_id:
          type: integer
          example: 18
          nullable: true
        site_source_value:
          type: string
          example: Main campus
          nullable: true
        cohort_source_value:
          type: string
          example: Group A
          nullable: true
        symbol:
          type: string
          example: P
          nullable: true
        encounter_status:
          type: string
          example: seen
          nullable: true
        enrollment_confirmation:
          type: string
          example: confirmed_enrolled
          nullable: true
        match_type:
          type: string
          example: suggested_candidate
          nullable: true
        decision:
          type: string
          example: match
          nullable: true
        status:
          type: string
          enum:
            - pending
            - ready
            - review
            - blocked
            - unresolved
            - skipped
            - committed
            - voided
          example: review
        entity_id:
          type: integer
          example: 42
          nullable: true
        candidates:
          type: array
          items:
            properties:
              entity_id:
                type: integer
                example: 42
              gratona_id:
                type: integer
                example: 42
              display_name:
                type: string
                example: Jane Recipient
              site_id:
                type: integer
                example: 12
                nullable: true
              cohort_id:
                type: integer
                example: 18
                nullable: true
              score:
                type: integer
                example: 95
              agreed:
                type: array
                items:
                  type: string
                  example: name
              conflicted:
                type: array
                items:
                  type: string
                  example: gender
            type: object
        errors:
          type: array
          items:
            type: string
            example: placement_conflict
        warnings:
          type: array
          items:
            type: string
            example: candidate_confirmation_required
        participation_session_id:
          type: integer
          example: 120
          nullable: true
      type: object
    ValidationErrorResponse:
      title: ValidationErrorResponse
      description: >-
        Returned with HTTP 422 when `Validator::make($data, $rules)` fails. The
        `errors` map is keyed by the failing field name; each value is an array
        of human-readable error messages for that field. Most controllers also
        include a top-level `status: error`.
      required:
        - errors
      properties:
        errors:
          description: >-
            Map of field name to array of validator error messages. Example:
            `{email: [The email field is required.], amount: [The amount must be
            a number.]}`.
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        status:
          description: Always the literal string `error`.
          type: string
          example: error
        message:
          description: >-
            Optional summary message — present on some endpoints, absent on
            others.
          type: string
          example: The given data was invalid.
          nullable: true
      type: object
    ErrorResponse:
      title: ErrorResponse
      description: >-
        Generic error envelope used by most controllers. Most error responses
        pair a human-readable `message` with `status: error`. Some endpoints
        additionally include `errors` (validator errors), `error` (legacy
        single-error string), `code`, or domain-specific context fields.
      required:
        - message
      properties:
        message:
          description: Human-readable error message.
          type: string
          example: Something went wrong. Please try again.
        status:
          description: >-
            Always the literal string `error` for failures. Some endpoints omit
            this field.
          type: string
          example: error
        error:
          description: Legacy single error code/string used by older endpoints.
          type: string
          example: invalid_request
          nullable: true
        code:
          description: >-
            Optional application-level error code (not all endpoints populate
            this).
          type: string
          example: DONOR_NOT_FOUND
          nullable: true
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: Passport bearer token authentication for legacy admin sessions.
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      description: Gratona API key sent with the compatibility header X-HYS-API-Key.
      name: X-HYS-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.