Welcome to the official ITCPR API documentation. This API powers various internal and external services including LaTeX document generation, GitHub integration, Discord automation, ZeroTier management, email utilities, WSL command syncing, and server operations.
All endpoints are available under:
https://api.itcpr.org
All requests and responses are in JSON format unless otherwise noted.
POST /latex/compileDescription:
Compile LaTeX documents, including support for BibTeX and embedded figures (as base64).
Payload:
{
"content": "<LaTeX code>",
"bibliography": "<optional .bib content>",
"figures": [
{
"name": "fig1.png",
"data": "data:image/png;base64,..."
}
],
"debug": false
}
Response: Returns a compiled PDF document as binary. If debug: true, logs are included in X-Log-Preview header.
POST /discord/messageSend a plain text message to a specific Discord channel. Optionally reply to a message.
{
"channelId": "DISCORD_CHANNEL_ID",
"message": "Hello from ITCPR API",
"replyToMessageId": "OPTIONAL_MESSAGE_ID"
}
Response: Returns message ID on success.
POST /discord/add_userAdd a user to the guild (server) using OAuth2 access_token.
{
"userId": "DISCORD_USER_ID",
"accessToken": "OAUTH_ACCESS_TOKEN"
}
POST /discord/remove_userRemove a user from the guild.
{
"userId": "DISCORD_USER_ID"
}
POST /discord/assign_roleAssign an existing role to a user within a guild.
{
"userId": "DISCORD_USER_ID",
"roleId": "DISCORD_ROLE_ID"
}
POST /discord/user_msgSend a direct message to a Discord user.
{
"userId": "DISCORD_USER_ID",
"message": "Your message here"
}
POST /email/unigurubdSend emails via UniGuruBD SMTP credentials.
POST /email/itcprSend emails via ITCPR's dedicated SMTP gateway.
Shared Payload:
{
"to": "recipient@example.com",
"subject": "Hello from ITCPR",
"message": "<p>This is an HTML or plain text email body</p>"
}
POST /email/sendSend emails via ITCPR SMTP with sender tracking. Emails to @mail.itcpr.org are stored in Firebase inbox.
{
"to": "recipient@example.com",
"from": "sender@example.com",
"subject": "Hello from ITCPR",
"message": "<p>Email body</p>"
}
POST /email/incomingReceive incoming emails (webhook endpoint for email service).
POST /email/chessbdSend emails via ChessBD SMTP credentials.
{
"to": "recipient@example.com",
"from": "sender@example.com",
"subject": "Subject",
"message": "Email body"
}
GET /apply/allGet all applications (staff only). Requires Firebase ID token in Authorization: Bearer <token> header.
POST /portal/newuserCreate a new user in Firebase Auth (staff only). Requires Firebase ID token.
{
"email": "newuser@example.com"
}
POST /portal/remove_userRemove a user from Firebase Auth and Firestore (staff only). Requires Firebase ID token.
{
"uid": "USER_UID"
}
POST /zerotier/authenticateAuthorize a device in the ZeroTier network and assign a static IP.
{
"member_id": "ZT_MEMBER_ID",
"ip": "192.168.195.10",
"name": "Device Name"
}
POST /zerotier/deauthenticateRemove a member from the ZeroTier network.
{
"member_id": "ZT_MEMBER_ID"
}
GET /github/get_files?path=...List files in a specified GitHub repository path. Path must include 'files'.
GET /github/apply/get_files?path=...List files in the apply repository path. Path must include 'files'.
POST /github/upload_file?path=...Upload a file to a GitHub repository.
Form Data:
- file: file input
- path: destination folder under /files/
POST /github/apply/upload?path=...Upload a file to the apply GitHub repository.
Form Data:
- file: file input
- path: destination folder under /files/
POST /github/webhookTrigger a Discord message when someone pushes to the repo.
POST /cloudflare/uploadUpload a file to Cloudflare R2 storage.
Form Data:
- file: file input
Response: Returns unique path and public URL.
POST /supabase/upload_fileUpload a file to Supabase storage.
Form Data:
- file: file input
Response: Returns unique path and public URL.
POST /wsl/uploadUpload a .txt file to WSL for logging or syncing purposes.
Form Data:
- file: .txt file
GET /wsl/downloadDownload the current log file stored on WSL.
POST /wsl/sessionUpload a .json session file to WSL.
Form Data:
- file: .json file
POST /server/webhookUpdate internal server metrics via a JSON POST.
{
"file": "server_stats.json",
"data": {
"cpu": 45.2,
"memory": 60.1
}
}
POST /server/statsRetrieve latest saved system stats.
{
"file": "server_stats.json"
}
POST /server/accessUpload access_codes.json to the server.
Form Data:
- file: .json file
POST /server/downloadDownload a specific file from the server.
{
"filename": "access_codes.json"
}
POST /server/job_uploadUpload a job output zip file with metadata.
Form Data:
- file: .zip file
- metadata: JSON file with user_id and job_id
POST /server/job_downloadDownload a job output zip file.
{
"user_id": "user123",
"job_id": "job456"
}
POST /server/job_deleteDelete a job output directory.
{
"user_id": "user123",
"job_id": "job456"
}
POST /server/wakeSend Wake-on-LAN command to a PC and log the request.
{
"username": "user@example.com"
}
GET /library/fetchFetch all books from the library database.
POST /library/addAdd a new book to the library.
{
"title": "Book Title",
"author": "Author Name",
"publisher": "Publisher",
"publication_date": "2024-01-01",
"edition": "1st",
"pdf_name": "book.pdf"
}
POST /library/editEdit an existing book.
{
"id": "bk000001",
"title": "Updated Title",
"author": "Updated Author"
}
DELETE /library/deleteDelete a book from the library.
{
"id": "bk000001"
}
POST /library/upload?request_id=...Upload a PDF file for a book (temporary storage).
Form Data:
- file: PDF file
GET /library/pdf?request_id=...Download a PDF file by request ID. File is deleted after download.
POST /gemini/askQuery Google Gemini AI model.
{
"message": "What is the capital of France?"
}
Response:
{
"response": "The capital of France is Paris."
}
POST /auth/ssoSingle Sign-On authentication using Firebase ID token.
{
"email": "user@example.com",
"password": "password",
"firebaseIdToken": "FIREBASE_ID_TOKEN"
}
Response:
{
"success": true,
"customToken": "FIREBASE_CUSTOM_TOKEN"
}
GET /tool/itcpr_calendar_icsGet ITCPR calendar in iCal format. Returns text/calendar content.
POST /cloud/github/webhookHandle GitHub App webhook events (installation, repository, member, etc.).
POST /cloud/app/oauth/urlGenerate OAuth URL for GitHub App authentication.
{
"redirect_uri": "https://cloud.itcpr.org/github/callback"
}
Response:
{
"url": "https://github.com/login/oauth/authorize?...",
"state": "STATE_TOKEN"
}
POST /cloud/app/oauth/callbackHandle OAuth callback and exchange code for token.
{
"code": "AUTHORIZATION_CODE",
"state": "STATE_TOKEN"
}
GET /cloud/app/connectionCheck if user has connected GitHub account. Requires X-User-ID header.
POST /cloud/app/disconnectDisconnect user's GitHub account. Requires X-User-ID header.
GET /cloud/app/userGet authenticated user's GitHub information. Requires X-User-ID header.
GET /cloud/app/orgGet organization information and statistics.
GET /cloud/app/org/membersGet all organization members.
GET /cloud/app/org/membershipCheck if authenticated user is a member of the organization.
POST /cloud/app/org/inviteInvite a user to the organization by username.
{
"username": "github_username"
}
DELETE /cloud/app/org/members/<username>Remove a member from the organization.
GET /cloud/app/org/teamsGet all teams in the organization.
GET /cloud/app/org/teams/<team_slug>/membersGet team members.
PUT /cloud/app/org/teams/<team_slug>/membersAdd user to team.
{
"username": "github_username",
"role": "member"
}
DELETE /cloud/app/org/teams/<team_slug>/members/<username>Remove user from team.
POST /cloud/app/org/teamsCreate a new team.
{
"name": "Team Name",
"description": "Team description",
"privacy": "closed"
}
PATCH /cloud/app/org/teams/<team_slug>Update team information.
DELETE /cloud/app/org/teams/<team_slug>Delete a team.
GET /cloud/app/org/reposGet all organization repositories (public and private).
POST /cloud/app/org/reposCreate a new repository in the organization.
{
"name": "repo-name",
"description": "Repository description",
"visibility": "private",
"template": "project-template"
}
GET /cloud/app/repos/<owner>/<repo>Get repository details.
DELETE /cloud/app/repos/<owner>/<repo>Delete a repository.
GET /cloud/app/repos/<owner>/<repo>/collaboratorsGet repository collaborators.
PUT /cloud/app/repos/<owner>/<repo>/collaborators/<username>Add or update a collaborator.
{
"permission": "push"
}
DELETE /cloud/app/repos/<owner>/<repo>/collaborators/<username>Remove a collaborator.
PATCH /cloud/app/repos/<owner>/<repo>/collaborators/<username>Update a collaborator's permission.
{
"permission": "admin"
}
PUT /cloud/app/repos/<owner>/<repo>/teams/<team_slug>Add team to repository.
{
"permission": "push"
}
DELETE /cloud/app/repos/<owner>/<repo>/teams/<team_slug>Remove team from repository.
POST /api/device/startStart device authentication flow - generate device code.
Response:
{
"device_code": "ABC12345",
"user_code": "ABCD-1234",
"verification_uri": "https://api.itcpr.org/device?code=ABCD-1234",
"expires_in": 600,
"interval": 5
}
GET /api/device/poll?device_code=...Poll for device authentication approval.
Response (pending):
{
"status": "pending"
}
Response (approved):
{
"device_id": "uuid",
"device_token": "token_string"
}
POST /api/device/approveApprove device authentication (called from frontend). Requires authentication.
{
"device_code": "ABCD-1234",
"device_name": "My CLI Device"
}
POST /api/device/denyDeny device authentication (called from frontend).
{
"device_code": "ABCD-1234"
}
POST /api/device/revokeRevoke a device token.
{
"device_id": "device_uuid"
}
GET /api/agent/devicesGet all devices for current user. Requires X-User-ID header.
GET /api/agent/meGet current device/user information. Requires Authorization: Bearer <device_token> header.
GET /api/agent/reposGet repositories assigned to this device/user. Requires Authorization: Bearer <device_token> header.
POST /api/agent/tokenGet short-lived GitHub installation token for repository access. Requires Authorization: Bearer <device_token> header.
{
"repo": "optional-repo-name"
}
All endpoints (unless file upload) expect:
Content-Type: application/json
Use appropriate headers for file uploads via multipart/form-data.
curl -X POST https://api.itcpr.org/email/itcpr \
-H "Content-Type: application/json" \
-d '{
"to": "you@example.com",
"subject": "Welcome!",
"message": "Hello from ITCPR API."
}'
HTTP status code and JSON body with "error" and "details" fields./latex/compile include Content-Type: application/pdf.This service is part of the ITCPR nonprofit platform and intended for internal and collaborative use.
All rights reserved ยฉ 2025 ITCPR.