This repository contains the official OpenAPI/Swagger definitions for seven.io's telecommunications API services, including SMS, TTS (Text-to-Speech), HLR (Home Location Register), MNP (Mobile Number Portability), and CNAM (Caller Name) services.
The project maintains API schemas in both Swagger 2.0 and OpenAPI 3.0 formats, available in both JSON and YAML. All schemas are automatically generated from a master Swagger 2.0 definition to ensure consistency across formats.
- SMS - Send and receive SMS messages
- TTS - Text-to-Speech conversion
- HLR - Home Location Register lookups
- MNP - Mobile Number Portability checks
- CNAM - Caller Name identification
npm install @seven.io/api-schemes
The schemas are available in multiple formats:
// Import JSON schemas
const openapi = require('@seven.io/api-schemes/json/openapi.json');
const swagger = require('@seven.io/api-schemes/json/swagger.json');
// Or reference YAML files
// yml/openapi.yml - OpenAPI 3.0 format
// yml/swagger.yml - Swagger 2.0 format (source of truth)
├── yml/
│ ├── swagger.yml # Master Swagger 2.0 definition (source of truth)
│ └── openapi.yml # Generated OpenAPI 3.0 YAML
├── json/
│ ├── swagger.json # Generated Swagger 2.0 JSON
│ └── openapi.json # Generated OpenAPI 3.0 JSON
└── build.mts # TypeScript build script
- Node.js >= 18.0.0
- npm
git clone https://github.com/seven-io/api-schemes.git
cd api-schemes
npm install
npm run build
This command:
- Reads the master Swagger 2.0 definition from
yml/swagger.yml
- Converts between Swagger 2.0 and OpenAPI 3.0 formats
- Validates all schemas using @apidevtools/swagger-parser
- Generates all output files in both JSON and YAML formats
- Applies consistent formatting with Prettier
- Make changes to
yml/swagger.yml
(the source of truth) - Run build with
npm run build
to regenerate all formats - Commit changes - pre-commit hooks ensure the build passes
swagger2openapi
- Converts Swagger 2.0 to OpenAPI 3.0@apidevtools/swagger-parser
- Validates API definitionsyamljs
- YAML parsing and stringificationprettier
- Code formatting
For detailed API documentation and interactive examples, visit:
- Fork the repository
- Create a feature branch
- Make your changes to
yml/swagger.yml
- Run
npm run build
to regenerate all formats - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Need help? Feel free to contact us or open an issue.