API Reference
IOTA SDK provides both GraphQL and REST APIs for integration and custom development.
GraphQL API
GraphQL is available for flexible data queries and mutations:
| Module | Endpoint | Description |
|---|---|---|
| Core | /query | Users, uploads, authentication |
| Warehouse | /query/warehouse | Products, inventory, orders |
GraphQL Features
- Strongly typed - Schema defines all available operations
- Flexible queries - Request exactly what you need
- Real-time - Subscriptions for live updates
- Introspection - Self-documenting API
Making GraphQL Requests
GraphQL endpoint accepts POST requests with JSON body:
{
"query": "query { users(limit: 10) { id firstName email } }"
}REST API
REST endpoints are available for traditional HTTP operations:
Authentication
All API requests require authentication via:
- Session cookie - For browser clients
- API token - For programmatic access (if enabled)
Common Patterns
| Operation | Method | Pattern |
|---|---|---|
| List | GET | /resource |
| Get one | GET | /resource/:id |
| Create | POST | /resource |
| Update | PUT or POST | /resource/:id (many form-based UIs use POST) |
| Delete | DELETE | /resource/:id |
Module APIs
Select a module to view its API documentation:
- Core API - Users, authentication, uploads
- Warehouse API - Products, inventory, orders
API Explorer
Use the GraphQL Playground to explore the API:
- Start the development server
- Navigate to
/playground(dev) — it targets/query; module-specific endpoint e.g./query/warehouse - Use the interactive explorer to build queries
SDK Clients
While you can use raw HTTP requests, consider:
- Generated clients - Use GraphQL codegen for type-safe clients
- Apollo Client - Feature-rich GraphQL client
- Fetch/Axios - Simple HTTP clients for REST
Note: Not all modules expose GraphQL schemas. Modules without GraphQL use REST endpoints exclusively.
Last updated on