API Reference¶
Information about the AstroManager API for advanced users and integrations.
Overview¶
AstroManager provides a REST API that powers both the web application and the N.I.N.A. plugin. While primarily internal, some endpoints may be useful for advanced integrations.
Authentication¶
OAuth 2.0¶
The API uses OAuth 2.0 for authentication via Azure AD B2C.
- Authorization Flow: Authorization Code with PKCE
- Token Type: Bearer tokens
- Token Lifetime: 1 hour (auto-refresh)
For Personal Use¶
The N.I.N.A. plugin handles authentication automatically. No separate API keys are needed for personal use.
For Integrations¶
Contact support if you need API access for custom integrations.
Base URL¶
Rate Limits¶
| Plan | Requests/Hour |
|---|---|
| Trial | 1,000 |
| Subscription | 10,000 |
Rate limit headers are included in responses: - X-RateLimit-Limit - X-RateLimit-Remaining - X-RateLimit-Reset
Common Endpoints¶
Subscription¶
GET /subscription - Get current subscription status
POST /subscription/portal - Create Stripe portal session
Deep Sky Objects¶
Scheduled Targets¶
GET /scheduler/targets - List scheduled targets
POST /scheduler/targets - Add target
PUT /scheduler/targets/{id} - Update target
DELETE /scheduler/targets/{id} - Delete target
Plugin Endpoints¶
POST /plugin/heartbeat - Send heartbeat
POST /plugin/status - Update equipment status
POST /plugin/exposure - Report completed exposure
GET /plugin/target - Get next target to image
Response Format¶
All responses are JSON:
Error responses:
Status Codes¶
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
Webhooks¶
Coming Soon: Webhook support for real-time event notifications.
Support¶
For API questions or integration requests, contact support.