Skip to main content
Uploads multiple student records at once using a CSV file. This endpoint is useful for importing large numbers of students into the system.

Request

This endpoint accepts a multipart form-data request with a CSV file.
file
file
required
CSV file containing student data. Must be UTF-8 encoded.

CSV Format

The CSV file should include the following columns. Both English and Spanish column names are supported:
English Column NameSpanish Column NameRequiredDescription
full_namenombre_completoYesStudent’s full name
document_numbernumero_documentoYesIdentification document number
document_typetipo_documentoNoDocument type (defaults to TI if not provided)
gendergeneroNoStudent’s gender
The bulk upload endpoint currently supports basic student information only. Guardian relationships and other advanced fields (birth_date, extra_data, piar_data) must be added individually using the Update Student endpoint.

CSV Example

full_name,document_number,document_type,gender
Juan Pérez García,1234567890,TI,M
María Rodríguez López,0987654321,TI,F
Carlos Gómez Martínez,1122334455,RC,M
Or using Spanish column names:
nombre_completo,numero_documento,tipo_documento,genero
Juan Pérez García,1234567890,TI,M
María Rodríguez López,0987654321,TI,F
Carlos Gómez Martínez,1122334455,RC,M

Response

Returns a summary of the bulk upload process.
message
string
Status message indicating the process is complete
processed
integer
Number of students successfully created
errors
array
Array of error messages for rows that failed validation or already exist

Validation Rules

  • full_name and document_number are required for each row
  • The combination of document_type and document_number must be unique within the school
  • If a student with the same document already exists, that row will be skipped and added to the errors array
  • Empty or invalid rows are skipped and reported in the errors array

Behavior

  • All successfully validated students are created in a single transaction
  • If any student fails validation, it will be reported in the errors array, but other valid students will still be created
  • Students are always created with is_active = true
  • Empty extra_data and piar_data objects are initialized for all students

Permissions Required

Requires the write:all permission (more restrictive than individual student creation).
curl -X POST "https://api.athena-erp.com/students/bulk" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "[email protected]"
{
  "message": "Proceso completado",
  "processed": 48,
  "errors": [
    "Fila 15: documento ya existe (1234567890)",
    "Fila 23: nombre y documento son obligatorios",
    "Fila 42: documento ya existe (9876543210)"
  ]
}

Tips for Successful Bulk Uploads

Before uploading:
  • Ensure your CSV file is UTF-8 encoded
  • Remove any duplicate document numbers from your file
  • Verify that required columns (full_name and document_number) are present
  • Use consistent document types (TI, RC, CC, CE, NUIP, or PASSPORT)
After uploading:
  • Review the errors array to identify any rows that failed
  • Use the Update Student endpoint to add missing information like birth dates, guardians, and custom data
  • Use the List Students endpoint to verify all students were created correctly

Build docs developers (and LLMs) love