Skip to main content

Outages upload

Upload plant outage records as a single CSV file per plant per request.

POST https://api.ravenwits.com/api/v0/outages/upload/

Requires Bearer API key.


Request

multipart/form-data:

FieldTypeRequiredDescription
plant_idstringYesPlant identifier (must exist under Plants for your account).
filefileYesCSV only (.csv extension, text/csv or application/csv content type).

Example (curl)

curl --request POST \
--url 'https://api.ravenwits.com/api/v0/outages/upload/' \
--header 'Authorization: Bearer {your-api-key}' \
--form 'plant_id=MY_PLANT_ID' \
--form 'file=@./outages.csv;type=text/csv'

Responses

StatusBody
201{ "message": "Outages CSV stored successfully." }
400Missing plant_id / file, not .csv, wrong content type, or file is not valid CSV, e.g. { "plant_id": ["This field is required."] } or { "file": ["Only CSV files are allowed (.csv extension)."] }
401Invalid or missing API key.
404{ "detail": "Plant with this ID does not exist." }
502{ "detail": "File upload failed." }
503{ "detail": "Outages uploads are not configured." }