diff --git a/.cursor/rules/openapi-comparison-prompt.md b/.cursor/rules/openapi-comparison-prompt.md new file mode 100644 index 00000000..cf5c700d --- /dev/null +++ b/.cursor/rules/openapi-comparison-prompt.md @@ -0,0 +1,457 @@ +# OpenAPI Spec Comparison Analysis Prompt Template + +## Task Overview + +You are tasked with performing a comprehensive comparison between a manually maintained OpenAPI specification and its auto-generated TypeSpec counterpart. This can be used for two purposes: +1. **Gap Analysis**: Identify missing elements in the auto-generated spec for TypeSpec implementation +2. **Compatibility Audit**: Verify that TypeSpec-generated specs maintain API behavior compatibility with original specs + +This prompt provides methods and tools for both comprehensive analysis and focused auditing of critical API behavior changes. + +## Input Parameters + +**Manual Spec Path:** `{MANUAL_SPEC_PATH}` +**Auto-Generated Spec Path:** `{AUTO_GENERATED_SPEC_PATH}` +**API Name:** `{API_NAME}` +**Scratchpad Output Path:** `{SCRATCHPAD_OUTPUT_PATH}` + +## Analysis Methodology + +### Approach A: Comprehensive Gap Analysis (For TypeSpec Implementation) + +Use this approach when you need to identify missing elements in TypeSpec-generated specs for implementation. + +#### Step 1: Load and Parse Both Specifications + +1. Read both OpenAPI specification files completely +2. Parse and extract all structural elements from each spec +3. Create an inventory of all endpoints, methods, parameters, schemas, and metadata + +#### Step 2: Create Comparison Matrix + +For each endpoint in the manual spec, document: +- **Path**: The endpoint path +- **Method**: HTTP method (GET, POST, PUT, DELETE, etc.) +- **Parameters**: All path, query, header, and cookie parameters +- **Request Body**: Schema, content type, examples +- **Responses**: All response codes, schemas, examples +- **Authentication**: Security requirements +- **Documentation**: Descriptions, summaries, examples +- **Tags**: Operation tagging and categorization + +#### Step 3: Identify Missing Elements + +Compare each element from the manual spec against the auto-generated spec and categorize gaps: + +1. **Missing Endpoints**: Complete endpoints not present in auto-generated spec +2. **Missing Parameters**: Parameters missing from existing endpoints +3. **Missing Response Codes**: Response codes not covered in auto-generated spec +4. **Schema Differences**: Model/schema structure differences +5. **Missing Examples**: Example values not present in auto-generated spec +6. **Documentation Gaps**: Missing descriptions, summaries, or documentation +7. **Authentication Differences**: Security method mismatches + +#### Step 4: Document Findings in Markdown Scratchpad + +Create a comprehensive markdown scratchpad with the following structure: + +### Approach B: Focused Compatibility Audit (For API Behavior Verification) + +Use this approach when you need to verify that TypeSpec-generated specs maintain API behavior compatibility with original specs, filtering out acceptable differences. + +#### Step 1: Create Focused Comparison Script + +Create a Python script using PyYAML to compare OpenAPI specifications with filtering capabilities: + +```python +import yaml +import json +from typing import Dict, List, Any, Set + +class FocusedComparator: + def __init__(self, old_spec_path: str, new_spec_path: str): + self.old_spec_path = old_spec_path + self.new_spec_path = new_spec_path + self.old_spec = None + self.new_spec = None + self.critical_issues = [] + + def load_specifications(self): + """Load both OpenAPI specifications""" + with open(self.old_spec_path, 'r', encoding='utf-8') as f: + self.old_spec = yaml.safe_load(f) + with open(self.new_spec_path, 'r', encoding='utf-8') as f: + self.new_spec = yaml.safe_load(f) + + def is_error_code(self, code: str) -> bool: + """Filter out acceptable error codes""" + return code in ['401', '404', '403', '500'] + + def compare_response_codes(self, path: str, method: str, old_responses: Dict, new_responses: Dict) -> List[str]: + """Compare response codes, focusing on critical changes""" + issues = [] + old_codes = set(old_responses.keys()) + new_codes = set(new_responses.keys()) + + # Critical: removed codes + removed_codes = old_codes - new_codes + for code in removed_codes: + issues.append(f"⚠️ CRITICAL: Response code {code} was removed") + + # Critical: 200 -> 201 changes + if '200' in old_codes and '200' not in new_codes and '201' in new_codes: + issues.append(f"⚠️ CRITICAL: Response changed from 200 to 201 (should be 200)") + + return issues + + def compare_endpoint(self, path: str, old_path_data: Dict, new_path_data: Dict) -> List[str]: + """Compare endpoint for critical behavior changes""" + issues = [] + old_methods = {k: v for k, v in old_path_data.items() if k in ['get', 'post', 'put', 'delete', 'patch']} + new_methods = {k: v for k, v in new_path_data.items() if k in ['get', 'post', 'put', 'delete', 'patch']} + + # Check for removed methods + for method in old_methods.keys(): + if method not in new_methods: + issues.append(f"⚠️ CRITICAL: {method.upper()} method was removed") + + # Compare existing methods + for method in old_methods.keys(): + if method in new_methods: + response_issues = self.compare_response_codes( + path, method, + old_methods[method].get('responses', {}), + new_methods[method].get('responses', {}) + ) + issues.extend([f"{method.upper()}: {issue}" for issue in response_issues]) + + return issues +``` + +#### Step 2: Configure Filtering Rules + +Define what to ignore vs. what constitutes critical changes: + +**Ignore (Non-Critical):** +- Operation ID changes (`listResources` → `Resources_list`) +- Added error response codes (401, 404, 403) +- OpenAPI version changes (3.0.3 → 3.0.0) +- Schema reference style changes (inline → `$ref`) +- Added tags for organization + +**Critical (Must Fix):** +- Status code changes (200 → 201) +- Removed endpoints or methods +- Removed response codes +- Schema structure changes +- Description content changes + +#### Step 3: Run Focused Analysis + +Execute the comparison focusing only on API behavior changes: + +```bash +python3 focused_compare.py +``` + +This will generate focused reports identifying only critical issues that affect API behavior. + +#### Step 4: Fix TypeSpec Models + +For status code issues, update TypeSpec files: + +```typescript +// Before (incorrect) +@post create(@body request: CreateRequest): + { @statusCode statusCode: 201; @body response: Response; } + +// After (correct) +@post create(@body request: CreateRequest): + { @statusCode statusCode: 200; @body response: Response; } +``` + +#### Step 5: Verify Fixes + +Re-run the focused comparison after TypeSpec recompilation to ensure all critical issues are resolved. + +### Tools and Scripts for Automated Analysis + +#### Required Dependencies +- Python 3.x +- PyYAML (`pip install pyyaml`) +- TypeSpec compiler (for regenerating specs) + +#### Directory Structure for Analysis +``` +temp/api-comparison/ +├── compare_openapi.py # Full comparison script +├── focused_compare.py # Focused critical issues only +├── endpoints/ # Individual endpoint analyses +├── summary.md # Comprehensive comparison report +├── focused-critical-issues.md # Critical issues requiring fixes +└── status-code-fixes-needed.md # Status code specific fixes +``` + +#### Key Comparison Metrics +- **Endpoint count**: Total paths in both specs +- **Method coverage**: HTTP methods per endpoint +- **Response code alignment**: Status code consistency +- **Schema compatibility**: Request/response structure matching +- **Operation ID consistency**: (can be ignored for compatibility) + +### Step 4: Document Findings + +Create reports based on your analysis approach: + +## Scratchpad Format Specification + +```markdown +# {API_NAME} OpenAPI Spec Comparison Analysis + +## Overview +- **Manual Spec**: {MANUAL_SPEC_PATH} +- **Auto-Generated Spec**: {AUTO_GENERATED_SPEC_PATH} +- **Analysis Date**: {DATE} + +## Summary Statistics +- Total endpoints in manual spec: {COUNT} +- Total endpoints in auto-generated spec: {COUNT} +- Missing endpoints: {COUNT} +- Endpoints with differences: {COUNT} + +## Detailed Comparison + +### 1. Missing Endpoints + +#### {ENDPOINT_PATH} {HTTP_METHOD} +**Status**: Missing entirely from auto-generated spec +**Manual Spec Details**: +- **Summary**: {SUMMARY} +- **Description**: {DESCRIPTION} +- **Parameters**: + - {PARAM_NAME} ({PARAM_TYPE}): {DESCRIPTION} [Required: {YES/NO}] +- **Request Body**: {SCHEMA_DESCRIPTION} +- **Responses**: + - {STATUS_CODE}: {DESCRIPTION} - {SCHEMA} +- **Authentication**: {AUTH_METHOD} +- **Examples**: {EXAMPLES} + +**TypeSpec Implementation Required**: +- Create {RESOURCE_NAME} interface in TypeSpec +- Add {OPERATION_NAME} operation +- Define {MODEL_NAME} models for request/response +- Add appropriate decorators and documentation + +--- + +### 2. Endpoints with Differences + +#### {ENDPOINT_PATH} {HTTP_METHOD} +**Status**: Exists in both specs but has differences + +**Missing Parameters**: +- {PARAM_NAME} ({PARAM_TYPE}): {DESCRIPTION} [Required: {YES/NO}] + +**Missing Response Codes**: +- {STATUS_CODE}: {DESCRIPTION} - {SCHEMA} + +**Schema Differences**: +- Manual spec has {FIELD_NAME} field not present in auto-generated +- Type mismatch: {FIELD_NAME} is {TYPE1} in manual, {TYPE2} in auto-generated + +**Missing Examples**: +- Parameter {PARAM_NAME} lacks example value +- Response {STATUS_CODE} lacks example + +**Documentation Gaps**: +- Missing operation summary +- Missing parameter descriptions +- Missing response descriptions + +**TypeSpec Implementation Required**: +- Add missing parameters to {MODEL_NAME} +- Add missing response codes to operation +- Update model schemas with missing fields +- Add missing examples and documentation + +--- + +### 3. Schema Analysis + +#### Missing Models +- {MODEL_NAME}: {DESCRIPTION} + - Used in: {ENDPOINT_PATHS} + - Properties: {PROPERTY_LIST} + +#### Model Differences +- {MODEL_NAME}: + - Missing properties: {PROPERTY_LIST} + - Type mismatches: {FIELD_NAME} ({EXPECTED_TYPE} vs {ACTUAL_TYPE}) + +### 4. Authentication Differences + +#### Missing Security Schemes +- {SECURITY_SCHEME_NAME}: {DESCRIPTION} + - Type: {AUTH_TYPE} + - Used in: {ENDPOINT_LIST} + +#### Security Application Differences +- {ENDPOINT_PATH}: Manual requires {AUTH_METHOD}, auto-generated has {AUTH_METHOD} + +### 5. Documentation Gaps + +#### Missing Operation Documentation +- {ENDPOINT_PATH} {HTTP_METHOD}: Missing {SUMMARY/DESCRIPTION/EXAMPLES} + +#### Missing Parameter Documentation +- {ENDPOINT_PATH} {HTTP_METHOD} > {PARAM_NAME}: Missing {DESCRIPTION/EXAMPLE} + +#### Missing Response Documentation +- {ENDPOINT_PATH} {HTTP_METHOD} > {STATUS_CODE}: Missing {DESCRIPTION/EXAMPLE} + +## Action Items for TypeSpec Implementation + +### High Priority +1. **Missing Endpoints**: Create {COUNT} missing endpoints + - {ENDPOINT_PATH} {HTTP_METHOD} + - Implementation: Add to {TYPESPEC_FILE} + +2. **Missing Models**: Create {COUNT} missing models + - {MODEL_NAME} + - Implementation: Add to {TYPESPEC_FILE} + +### Medium Priority +1. **Parameter Additions**: Add {COUNT} missing parameters +2. **Response Code Additions**: Add {COUNT} missing response codes +3. **Schema Updates**: Update {COUNT} models with missing fields + +### Low Priority +1. **Documentation Enhancements**: Add missing descriptions and examples +2. **Authentication Updates**: Align security requirements + +## TypeSpec File Modifications Required + +### {TYPESPEC_FILE_PATH} +- Add {OPERATION_NAME} operation +- Create {MODEL_NAME} models +- Add missing decorators: @doc, @example, @summary + +### {MODELS_FILE_PATH} +- Define {MODEL_NAME} models +- Add missing properties +- Add proper type annotations + +## Next Steps + +1. Use this scratchpad to guide TypeSpec implementation +2. Implement high-priority items first +3. Test TypeSpec compilation after each major change +4. Verify generated OpenAPI matches manual spec +5. Update documentation as needed + +## Notes + +- Pay special attention to breaking changes +- Ensure backwards compatibility +- Validate all examples are realistic +- Check for consistent naming conventions +- Verify proper use of TypeSpec decorators +``` + +## Execution Instructions + +1. **Load both OpenAPI specs** using the provided paths +2. **Perform systematic comparison** following the methodology above +3. **Create the markdown scratchpad** using the format specification +4. **Document every difference** with specific details and implementation notes +5. **Prioritize findings** based on impact and complexity +6. **Provide actionable TypeSpec implementation guidance** + +## Quality Assurance + +- Ensure all endpoints from manual spec are accounted for +- Verify all schema differences are documented +- Check that implementation notes are specific and actionable +- Validate that the scratchpad can be used independently for TypeSpec implementation +- Confirm all missing elements are categorized correctly + +## Output Requirements + +- Complete markdown scratchpad file at the specified output path +- Summary statistics of the comparison +- Detailed findings with specific implementation guidance +- Prioritized action items for TypeSpec development +- Clear next steps for implementation + +## Usage Instructions + +### For Gap Analysis (Approach A) +To identify missing elements in TypeSpec-generated specs: + +1. Replace `{MANUAL_SPEC_PATH}` with the path to your manual OpenAPI spec +2. Replace `{AUTO_GENERATED_SPEC_PATH}` with the path to your TypeSpec-generated spec +3. Replace `{API_NAME}` with your API name (e.g., "Fabric API", "Calling API") +4. Replace `{SCRATCHPAD_OUTPUT_PATH}` with desired output path for the scratchpad file +5. Execute the analysis following the comprehensive methodology above + +### For Compatibility Audit (Approach B) +To verify API behavior compatibility: + +1. Create a `temp/api-comparison/` directory in your project +2. Copy the focused comparison script template from this prompt +3. Update the script with your specific spec paths +4. Run the focused comparison: `python3 focused_compare.py` +5. Review the generated reports for critical issues +6. Fix any status code or behavioral inconsistencies in TypeSpec files +7. Recompile TypeSpec and re-run comparison to verify fixes + +## Example Usage: Fabric API Audit + +Here's a real example of how this methodology was successfully applied to the Fabric API: + +### Problem +The TypeSpec-generated Fabric API specification had status code inconsistencies - returning 201 instead of 200 for create operations. + +### Solution Applied +1. **Created focused comparison script** at `temp/fabric-api-comparison/focused_compare.py` +2. **Identified critical issues**: 9 endpoints returning 201 instead of 200 +3. **Fixed TypeSpec files**: Updated 9 TypeSpec files to return 200 status codes +4. **Verified fixes**: Re-ran comparison showing 0 critical issues + +### Files Updated +- `specs/signalwire-rest/fabric-api/conference-rooms/main.tsp` +- `specs/signalwire-rest/fabric-api/cxml-scripts/main.tsp` +- `specs/signalwire-rest/fabric-api/freeswitch-connectors/main.tsp` +- `specs/signalwire-rest/fabric-api/relay-applications/main.tsp` +- `specs/signalwire-rest/fabric-api/sip-endpoints/main.tsp` +- `specs/signalwire-rest/fabric-api/swml-scripts/main.tsp` +- `specs/signalwire-rest/fabric-api/resources/domain-applications/main.tsp` +- `specs/signalwire-rest/fabric-api/resources/phone-routes/main.tsp` +- `specs/signalwire-rest/fabric-api/resources/sip-endpoints/main.tsp` + +### Results +- **Before**: 9 endpoints with critical status code issues +- **After**: 0 critical issues, full API behavior compatibility achieved +- **Ignored**: 67 operation ID changes (non-critical) +- **Ignored**: Added 401/404 error codes (enhancement, not breaking) + +## Best Practices + +### When to Use Each Approach +- **Gap Analysis (A)**: Building new TypeSpec implementations, missing functionality +- **Compatibility Audit (B)**: Verifying existing TypeSpec implementations, CI/CD validation + +### Common Issues to Look For +1. **Status Code Changes**: 200 ↔ 201 for create operations +2. **Removed Endpoints**: Missing paths in generated spec +3. **Missing Parameters**: Required parameters not present +4. **Schema Mismatches**: Structure differences affecting API contracts +5. **Authentication Changes**: Security requirements not matching + +### Automation Recommendations +- Integrate focused comparison into CI/CD pipeline +- Run compatibility audits before releases +- Set up alerts for critical API behavior changes +- Maintain separate scripts for different API families + +The resulting analysis will provide actionable guidance for maintaining API compatibility while leveraging TypeSpec's benefits. \ No newline at end of file diff --git a/.cursor/rules/typespec.md b/.cursor/rules/typespec.md new file mode 100644 index 00000000..893eedce --- /dev/null +++ b/.cursor/rules/typespec.md @@ -0,0 +1,649 @@ +# TypeSpec to OpenAPI Conversion Guide + +This guide provides comprehensive guidelines for converting OpenAPI specifications to TypeSpec equivalents, based on the patterns observed in the SignalWire REST API specifications. + +## Directory Structure Best Practices + +### Standard API Directory Layout + +``` +specs/signalwire-rest/ +├── {api-name}/ +│ ├── _spec_.yaml # OpenAPI metadata/config +│ ├── main.tsp # Main API definition +│ ├── {resource}/ +│ │ ├── main.tsp # Resource endpoints +│ │ └── models/ +│ │ ├── core.tsp # Core data models +│ │ ├── requests.tsp # Request models +│ │ ├── responses.tsp # Response models +│ │ ├── errors.tsp # Error models +│ │ ├── enums.tsp # Enumeration types +│ │ └── examples.tsp # Example data/constants +│ └── tsp-output/ +│ └── @typespec/ +│ └── openapi3/ +│ └── openapi.yaml # Generated OpenAPI spec +├── types/ # Shared types across APIs +│ ├── main.tsp +│ ├── status-codes/ +│ ├── scalar-types/ +│ └── composite-types/ +└── tspconfig.yaml # TypeSpec configuration +``` + +### Key Principles + +1. **Separation of Concerns**: Each file has a specific purpose +2. **Hierarchical Organization**: Resources are organized in logical hierarchies +3. **Shared Types**: Common types are centralized in the `types/` directory +4. **Generated Output**: TypeSpec compiles to OpenAPI in `tsp-output/` directory + +## File Organization Patterns + +### Main API File (`main.tsp`) + +The main API file should contain: +- Service-level decorators and metadata +- Server configuration +- Authentication setup +- Imports of all resource modules +- Root namespace definition + +```typescript +import "@typespec/http"; +import "../types"; +import "./calls"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@service(#{ + title: "Calling API", +}) +@server("https://{space_name}.signalwire.com/api/calling", "Endpoint", { + space_name: string = "{Your_Space_Name}"; +}) +@useAuth(BasicAuth) +@doc("API to create/manage SignalWire's Calls.") +namespace CallingAPI; +``` + +### Resource Main Files + +Resource-specific main files should: +- Define the resource's route +- Import all required models +- Define the interface with operations +- Group related operations logically + +```typescript +import "@typespec/http"; +import "../../types"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/calls") +namespace CallingAPI.Calls { + @tag("Calls") + @friendlyName("Calls") + interface Calls { + @summary("Create a Call") + @doc("Creates a new call with the specified parameters.") + create(@body request: CallCreateRequest): + { @statusCode statusCode: 201; @body call: CallResponse; } | + StatusCode401 | + StatusCode404 | + CallCreate422Error; + } +} +``` + +## Model Definition Guidelines + +### Core Models (`core.tsp`) + +Define the fundamental data structures: + +```typescript +model Call { + @doc("The unique identifier of the call.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + id: string; + + @doc("The origin number or address.") + @example("sip:from-sip@example.com") + from: string; + + @doc("The destination number or address.") + @example("sip:to-sip@example.com") + to: string; + + @doc("The status of the call.") + @example("queued") + status: "answered" | "queued" | "initiated" | "ringing" | "ending" | "ended"; +} +``` + +### Request Models (`requests.tsp`) + +Define request payloads and parameters: + +```typescript +@summary("Create call") +model CallCreateRequest { + @doc("The `dial` command is used to create a new call.") + @example("dial") + command: "dial"; + + @doc("Parameters for the dial command.") + params: CallCreateRequestParams; +} + +model CallCreateRequestParams { + @doc("The address that initiated the call.") + @example("sip:from-sip@example.com") + from: string; + + @doc("The address that received the call.") + @example("sip:to-sip@example.com") + to: string; +} +``` + +### Response Models (`responses.tsp`) + +Define response structures: + +```typescript +import "./core.tsp"; +import "../../../types/status-codes"; + +using Types.StatusCodes; + +model CallResponse {...Call} + +@example(#{ + errors: #[#{ + type: "validation_error", + code: "missing_required_parameter", + message: "url must be a valid http or https url", + attribute: "url" + }] +}) +model CallCreate422Error is Types.StatusCodes.StatusCode422; +``` + +## API Interface Structure + +### HTTP Method Decorators + +Use appropriate HTTP method decorators: + +```typescript +interface ResourceOperations { + // GET operations (default) + list(): ResourceListResponse; + + // POST operations + @post create(@body request: CreateRequest): CreateResponse; + + // PUT operations + @put update(@body request: UpdateRequest): UpdateResponse; + + // PATCH operations + @patch(#{ implicitOptionality: true }) + partialUpdate(@body request: PartialUpdateRequest): UpdateResponse; + + // DELETE operations + @delete delete(@path id: string): { @statusCode statusCode: 204; }; +} +``` + +### Path Parameters + +Define path parameters using the `@path` decorator: + +```typescript +model ResourcePathID { + @doc("Unique ID of the resource.") + @path + id: uuid; +} + +interface ResourceOperations { + read(...ResourcePathID): ResourceResponse; + update(...ResourcePathID, @body request: UpdateRequest): ResourceResponse; + delete(...ResourcePathID): { @statusCode statusCode: 204; }; +} +``` + +### Status Code Handling + +Use union types for multiple response possibilities: + +```typescript +interface ResourceOperations { + create(@body request: CreateRequest): + { @statusCode statusCode: 201; @body resource: ResourceResponse; } | + StatusCode401 | + StatusCode404 | + ResourceCreate422Error; +} +``` + +### Response Format Patterns + +#### Direct Array Responses +For endpoints that return arrays directly (not wrapped in an object): + +```typescript +// Option 1: Using the array type directly +list(): ResourceResponse[] | StatusCode401 | StatusCode404; + +// Option 2: Using an alias (defined in responses.tsp) +// In responses.tsp: +alias ResourceListResponse = ResourceResponse[]; +// In main.tsp: +list(): ResourceListResponse | StatusCode401 | StatusCode404; +``` + +#### Object Responses with Explicit Status +For endpoints that return single objects or need explicit status codes: + +```typescript +// Single object with status code +read(@path id: string): + { @statusCode statusCode: 200; @body resource: ResourceResponse; } | + StatusCode401 | + StatusCode404; + +// Creating a resource (201 status) +create(@body request: CreateRequest): + { @statusCode statusCode: 201; @body resource: ResourceResponse; } | + StatusCode401 | + StatusCode422; +``` + +#### Wrapped Array Responses +For endpoints that return arrays wrapped in an object (e.g., with pagination): + +```typescript +// In responses.tsp: +model ResourceListResponse { + data: ResourceResponse[]; + links?: PaginationLinks; +} + +// In main.tsp: +list(): ResourceListResponse | StatusCode401 | StatusCode404; +``` + +#### No Content Responses +For DELETE operations or other endpoints with no response body: + +```typescript +delete(@path id: string): + { @statusCode statusCode: 204; } | + StatusCode401 | + StatusCode404; +``` + +## Import and Namespace Management + +### Import Hierarchy + +Follow this import pattern: + +```typescript +// 1. TypeSpec core imports +import "@typespec/http"; +import "@typespec/openapi3"; + +// 2. Shared types imports +import "../../types"; + +// 3. Local model imports +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; + +// 4. Using statements +using TypeSpec.Http; +using Types.StatusCodes; +``` + +### Namespace Structure + +Organize namespaces hierarchically: + +```typescript +// Root namespace +namespace CallingAPI; + +// Resource namespace +namespace CallingAPI.Calls; + +// Shared types namespace +namespace Types.StatusCodes; +``` + +## Documentation Standards + +### Model Documentation + +Every model property should have: +- `@doc` decorator with clear description +- `@example` decorator with realistic example +- `@summary` decorator for complex models + +```typescript +model User { + @doc("The unique identifier for the user.") + @example("user_123456") + id: string; + + @doc("The user's email address.") + @example("user@example.com") + email: string; + + @doc("The user's current status.") + @example("active") + status: "active" | "inactive" | "pending"; +} +``` + +### Operation Documentation + +Operations should include: +- `@summary` with concise description +- `@doc` with detailed explanation +- `@opExample` for complex operations with examples + +```typescript +@summary("Create a new user") +@doc("Creates a new user account with the provided information.") +@opExample(#{ + parameters: createUserExample +}, #{ + title: "Create basic user", + description: "Create a new user with minimal required fields" +}) +create(@body request: CreateUserRequest): CreateUserResponse; +``` + +## Error Handling Patterns + +### Standard Error Models + +Define consistent error structures: + +```typescript +namespace Types.StatusCodes { + @error + model StatusCode404 { + @statusCode statusCode: 404; + @bodyRoot error: "Not Found"; + } + + @error + model StatusCode401 { + @statusCode statusCode: 401; + @bodyRoot error: "Unauthorized"; + } + + model StatusCode422Error { + @doc("Error type.") + type: string; + + @doc("Error code.") + code: string; + + @doc("Error message.") + message: string; + + @doc("Request parameter associated with this error.") + attribute: string; + } + + @error + model StatusCode422 { + @statusCode statusCode: 422; + errors: StatusCode422Error[]; + } +} +``` + +### Error Response Patterns + +Include appropriate error responses for each operation: + +```typescript +interface Operations { + create(@body request: CreateRequest): + { @statusCode statusCode: 201; @body resource: ResourceResponse; } | + StatusCode401 | // Unauthorized + StatusCode404 | // Not Found + StatusCode422; // Validation Error +} +``` + +## Model Composition Patterns + +### Inheritance and Composition + +Use TypeSpec's composition features effectively: + +```typescript +// Base model +model BaseResource { + @doc("The unique identifier.") + id: string; + + @doc("Creation timestamp.") + created_at: string; + + @doc("Last update timestamp.") + updated_at: string; +} + +// Extended model using spread operator +model User { + ...BaseResource; + + @doc("The user's email address.") + email: string; + + @doc("The user's display name.") + display_name: string; +} + +// Alternative using inheritance +model User is BaseResource { + @doc("The user's email address.") + email: string; +} +``` + +### Union Types + +Use union types for flexible request/response structures: + +```typescript +// Discriminated union for different request types +@oneOf +union CreateRequest { + CreateWithURL: CreateRequestWithURL; + CreateWithData: CreateRequestWithData; +} + +// Simple union for status values +model Resource { + status: "active" | "inactive" | "pending"; +} +``` + +## Common Pitfalls and Solutions + +### 1. Missing Import Statements + +**Problem**: TypeSpec compilation fails due to missing imports. + +**Solution**: Always import required dependencies: + +```typescript +import "@typespec/http"; // For HTTP decorators +import "@typespec/openapi3"; // For OpenAPI-specific features +import "../types"; // For shared types +``` + +### 2. Inconsistent Namespace Usage + +**Problem**: Models and operations not properly namespaced. + +**Solution**: Use consistent namespace hierarchy: + +```typescript +namespace API.Resource { + model ResourceModel { ... } + + interface ResourceOperations { ... } +} +``` + +### 3. Missing Documentation + +**Problem**: Generated OpenAPI lacks proper documentation. + +**Solution**: Add comprehensive documentation: + +```typescript +@doc("Clear description of what this model represents") +@example("realistic_example_value") +model MyModel { + @doc("Description of this property") + @example("example_value") + property: string; +} +``` + +### 4. Incorrect Status Code Usage + +**Problem**: Wrong HTTP status codes for operations. + +**Solution**: Use semantically correct status codes: + +```typescript +// Correct +create(): { @statusCode statusCode: 201; @body resource: Resource; } // Created +update(): { @statusCode statusCode: 200; @body resource: Resource; } // OK +delete(): { @statusCode statusCode: 204; } // No Content + +// Incorrect +create(): { @statusCode statusCode: 200; @body resource: Resource; } // Should be 201 +``` + +### 5. Poor Error Handling + +**Problem**: Missing or inconsistent error responses. + +**Solution**: Include all relevant error responses: + +```typescript +interface Operations { + create(@body request: CreateRequest): + { @statusCode statusCode: 201; @body resource: Resource; } | + StatusCode400 | // Bad Request + StatusCode401 | // Unauthorized + StatusCode422; // Validation Error +} +``` + +## TypeSpec to OpenAPI Compilation + +### Configuration + +Ensure proper TypeSpec configuration in `tspconfig.yaml`: + +```yaml +extends: "@typespec/openapi3/all" +options: + "@typespec/openapi3": + output-file: "openapi.yaml" + emitters: + - "@typespec/openapi3" +``` + +### Compilation Process + +1. **Write TypeSpec**: Create `.tsp` files following the patterns above +2. **Compile**: Run TypeSpec compiler to generate OpenAPI +3. **Validate**: Check generated OpenAPI for correctness +4. **Iterate**: Refine TypeSpec based on output + +### Best Practices for OpenAPI Generation + +1. **Use Semantic Decorators**: Prefer `@doc`, `@summary`, `@example` over comments +2. **Structure for Readability**: Organize models and operations logically +3. **Validate Examples**: Ensure examples are realistic and valid +4. **Test Generated Output**: Verify the generated OpenAPI meets requirements + +## Quick Reference Templates + +### Basic API Structure + +```typescript +import "@typespec/http"; +import "../types"; +import "./resource"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@service(#{ + title: "My API", +}) +@server("https://api.example.com", "API Endpoint") +@useAuth(BasicAuth) +@doc("Description of my API") +namespace MyAPI; +``` + +### Basic Resource Interface + +```typescript +@route("/resources") +namespace MyAPI.Resources { + @tag("Resources") + @friendlyName("Resources") + interface Resources { + @summary("List resources") + list(): ResourceListResponse | StatusCode401 | StatusCode404; + + @summary("Create resource") + @post create(@body request: CreateResourceRequest): + { @statusCode statusCode: 201; @body resource: ResourceResponse; } | + StatusCode401 | StatusCode422; + + @summary("Get resource") + read(@path id: string): + { @statusCode statusCode: 200; @body resource: ResourceResponse; } | + StatusCode401 | StatusCode404; + + @summary("Update resource") + @put update(@path id: string, @body request: UpdateResourceRequest): + { @statusCode statusCode: 200; @body resource: ResourceResponse; } | + StatusCode401 | StatusCode404 | StatusCode422; + + @summary("Delete resource") + @delete delete(@path id: string): + { @statusCode statusCode: 204; } | + StatusCode401 | StatusCode404; + } +} +``` + +This guide provides the foundation for converting OpenAPI specifications to TypeSpec equivalents while maintaining consistency with the established patterns in the SignalWire documentation project. \ No newline at end of file diff --git a/package.json b/package.json index f87d89c7..6df57862 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ ], "scripts": { "build": "yarn --cwd website build", + "serve": "yarn --cwd website serve", "start": "yarn --cwd website start", "start-fresh": "yarn --cwd website start-fresh", "build:website": "yarn --cwd website build", diff --git a/specs/package.json b/specs/package.json index 4c75e204..ca3e6f9a 100644 --- a/specs/package.json +++ b/specs/package.json @@ -10,14 +10,16 @@ "build:fabric-api": "cd ./signalwire-rest/fabric-api && tsp compile . && cd ../../", "build:logs-api": "cd ./signalwire-rest/logs-api && tsp compile . && cd ../../", "clean": "echo 'Skipping clean step'", - "prebuild": "yarn clean" + "prebuild": "yarn clean", + "format": "tsp format **/*.tsp", + "format:check": "tsp format --check **/*.tsp" }, "dependencies": { - "@typespec/compiler": "1.0.0", - "@typespec/http": "1.0.0", - "@typespec/openapi": "1.0.0", - "@typespec/openapi3": "1.0.0", - "@typespec/rest": "0.70.0" + "@typespec/compiler": "1.1.0", + "@typespec/http": "1.1.0", + "@typespec/openapi": "1.1.0", + "@typespec/openapi3": "1.1.0", + "@typespec/rest": "0.71.0" }, "devDependencies": { "typescript": "^5.5.4" diff --git a/specs/signalwire-rest/_globally_shared/const.tsp b/specs/signalwire-rest/_globally_shared/const.tsp new file mode 100644 index 00000000..352e1ffc --- /dev/null +++ b/specs/signalwire-rest/_globally_shared/const.tsp @@ -0,0 +1,21 @@ +const SERVER_URL = "signalwire.com/api"; + +const TERMS_OF_SERVICE = "https://signalwire.com/legal/signalwire-cloud-agreement"; + +const CONTACT_NAME = "SignalWire"; + +const CONTACT_URL = "https://support.signalwire.com/portal/en/newticket?departmentId=1029313000000006907&layoutId=1029313000000074011"; + +const CONTACT_EMAIL = "support@signalwire.com"; + +const LICENSE_URL = "https://github.com/signalwire/docs/blob/main/LICENSE"; + +const LICENSE_NAME = "MIT"; + +const CONTACT_INFO = #{ + name: CONTACT_NAME, + url: CONTACT_URL, + email: CONTACT_EMAIL, +}; + +const LICENSE_INFO = #{ name: LICENSE_NAME, url: LICENSE_URL }; diff --git a/specs/signalwire-rest/_globally_shared/enums.tsp b/specs/signalwire-rest/_globally_shared/enums.tsp new file mode 100644 index 00000000..c5bbaec3 --- /dev/null +++ b/specs/signalwire-rest/_globally_shared/enums.tsp @@ -0,0 +1,23 @@ +enum Ciphers { + AEAD_AES_256_GCM_8: "AEAD_AES_256_GCM_8", + AES_256_CM_HMAC_SHA1_80: "AES_256_CM_HMAC_SHA1_80", + AES_CM_128_HMAC_SHA1_80: "AES_CM_128_HMAC_SHA1_80", + AES_256_CM_HMAC_SHA1_32: "AES_256_CM_HMAC_SHA1_32", + AES_CM_128_HMAC_SHA1_32: "AES_CM_128_HMAC_SHA1_32", +} + +enum Codecs { + PCMU: "PCMU", + PCMA: "PCMA", + G722: "G722", + G729: "G729", + OPUS: "OPUS", + VP8: "VP8", + H264: "H264", +} + +enum Encryption { + Required: "required", + Optional: "optional", + Default: "default", +} diff --git a/specs/signalwire-rest/calling-api/calls/main.tsp b/specs/signalwire-rest/calling-api/calls/main.tsp index 0eb04157..59be619f 100644 --- a/specs/signalwire-rest/calling-api/calls/main.tsp +++ b/specs/signalwire-rest/calling-api/calls/main.tsp @@ -4,40 +4,57 @@ import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/examples.tsp"; - using TypeSpec.Http; using Types.StatusCodes; @route("/calls") namespace CallingAPI.Calls { - - @tag("Calls") - @friendlyName("Calls") - interface Calls { - - @summary("Create a Call") - @doc("To create a new call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`.") - create(@body request: CallCreateRequest): - { @statusCode statusCode: 201; @body call: CallResponse; } | - StatusCode401 | - StatusCode404 | - CallCreate422Error; - - - @summary("Update a Call") - @doc("To update an existing call, you send a `PUT` request to the Call resource with a payload including a `command` and additional nested `params`.") - @opExample(#{parameters: holdCallExample}, #{title: "Hold active call", description: "Put an active AI call on hold, pausing the conversation"}) - @opExample(#{parameters: unholdCallExample}, #{title: "Unhold active call", description: "Resume an AI call that was previously put on hold"}) - @opExample(#{parameters: aiMessageExample}, #{title: "Inject AI message", description: "Send a message to the AI conversation to modify behavior or add context"}) - //@opExample(#{parameters: #{request: #{command: "update", params: #{id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", url: "https://example.com/swml", fallback_url: "https://example.com/fallback"}}}}, #{title: "Update active call", description: "Modify an active call's behavior using new SWML instructions"}) - @put update(@body request: CallUpdateRequest): - { @statusCode statusCode: 200; @body call: CallResponse; } | - StatusCode401 | - StatusCode404 | - CallUpdate422Error; - } - - - - -} \ No newline at end of file + @tag("Calls") + @friendlyName("Calls") + interface Calls { + @summary("Create a Call") + @doc("To create a new call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`.") + create(@body request: CallCreateRequest): + | { + @statusCode statusCode: 201; + @body call: CallResponse; + } + | StatusCode401 + | StatusCode404 + | CallCreate422Error; + + @summary("Update a Call") + @doc("To update an existing call, you send a `PUT` request to the Call resource with a payload including a `command` and additional nested `params`.") + @opExample( + #{ parameters: holdCallExample }, + #{ + title: "Hold active call", + description: "Put an active AI call on hold, pausing the conversation", + } + ) + @opExample( + #{ parameters: unholdCallExample }, + #{ + title: "Unhold active call", + description: "Resume an AI call that was previously put on hold", + } + ) + @opExample( + #{ parameters: aiMessageExample }, + #{ + title: "Inject AI message", + description: "Send a message to the AI conversation to modify behavior or add context", + } + ) + //@opExample(#{parameters: #{request: #{command: "update", params: #{id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", url: "https://example.com/swml", fallback_url: "https://example.com/fallback"}}}}, #{title: "Update active call", description: "Modify an active call's behavior using new SWML instructions"}) + @put + update(@body request: CallUpdateRequest): + | { + @statusCode statusCode: 200; + @body call: CallResponse; + } + | StatusCode401 + | StatusCode404 + | CallUpdate422Error; + } +} diff --git a/specs/signalwire-rest/calling-api/calls/models/core.tsp b/specs/signalwire-rest/calling-api/calls/models/core.tsp index bff40e23..69f52b39 100644 --- a/specs/signalwire-rest/calling-api/calls/models/core.tsp +++ b/specs/signalwire-rest/calling-api/calls/models/core.tsp @@ -1,57 +1,52 @@ model Call { + @doc("The unique identifier of the call on SignalWire. This can be used to update the call programmatically.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + id: string; - @doc("The unique identifier of the call on SignalWire. This can be used to update the call programmatically.") - @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") - id: string; + @doc("The origin number or address.") + @example("sip:from-sip@example-112233445566.sip.signalwire.com") + from: string; - @doc("The origin number or address.") - @example("sip:from-sip@example-112233445566.sip.signalwire.com") - from: string; + @doc("The destination number or address.") + @example("sip:from-sip@example-112233445567.sip.signalwire.com") + to: string; - @doc("The destination number or address.") - @example("sip:from-sip@example-112233445567.sip.signalwire.com") - to: string; + @doc("The direction of the call.") + @example("outbound-api") + direction: "outbound-api"; - @doc("The direction of the call.") - @example("outbound-api") - direction: "outbound-api"; + @doc("The status of the call.") + @example("queued") + status: "answered" | "queued" | "initiated" | "ringing" | "ending" | "ended"; - @doc("The status of the call.") - @example("queued") - status: "answered" | "queued" | "initiated" | "ringing" | "ending" | "ended"; + @doc("The duration of the call in seconds.") + @example(60) + duration: integer; - @doc("The duration of the call in seconds.") - @example(60) - duration: integer; + @doc("The duration of the call in milliseconds.") + @example(60000) + duration_ms: integer; - @doc("The duration of the call in milliseconds.") - @example(60000) - duration_ms: integer; + @doc("The billable duration of the call in seconds.") + @example(60) + billable_duration: integer; - @doc("The billable duration of the call in seconds.") - @example(60) - billable_duration: integer; + @doc("Source of this call.") + @example("realtime_api") + source: "realtime_api"; - @doc("Source of this call.") - @example("realtime_api") - source: "realtime_api"; - - @doc("Type of this call.") - @example("relay_sip_call") - type: "relay_pstn_call" | "relay_sip_call" | "relay_webrtc_call" ; - - @doc("Details on charges associated with this call.") - charge: ChargeDetails[]; + @doc("Type of this call.") + @example("relay_sip_call") + type: "relay_pstn_call" | "relay_sip_call" | "relay_webrtc_call"; + @doc("Details on charges associated with this call.") + charge: ChargeDetails[]; } - model ChargeDetails { + @doc("Description for this charge.") + description: string; - @doc("Description for this charge.") - description: string; - - @doc("Charged amount.") - amount: integer; - -} \ No newline at end of file + @doc("Charged amount.") + amount: integer; +} diff --git a/specs/signalwire-rest/calling-api/calls/models/examples.tsp b/specs/signalwire-rest/calling-api/calls/models/examples.tsp index 0e5e917f..346df7e3 100644 --- a/specs/signalwire-rest/calling-api/calls/models/examples.tsp +++ b/specs/signalwire-rest/calling-api/calls/models/examples.tsp @@ -1,9 +1,8 @@ /** * Operation examples for the Calling API - * + * * These examples can be imported and used with @opExample decorator on operations */ - const callId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"; // Hangup Call Examples @@ -11,26 +10,16 @@ const hangupCallExample = #{ request: #{ id: callId, command: "calling.end", - params: #{ - reason: "hangup" - } - } + params: #{ reason: "hangup" }, + }, }; const holdCallExample = #{ - request: #{ - id: callId, - command: "calling.ai_hold", - params: #{} - } + request: #{ id: callId, command: "calling.ai_hold", params: #{} }, }; const unholdCallExample = #{ - request: #{ - id: callId, - command: "calling.ai_unhold", - params: #{} - } + request: #{ id: callId, command: "calling.ai_unhold", params: #{} }, }; const aiMessageExample = #{ @@ -39,9 +28,9 @@ const aiMessageExample = #{ command: "calling.ai_message", params: #{ role: "system", - message_text: "You are now in expert mode. Provide detailed technical responses and use industry terminology." - } - } + message_text: "You are now in expert mode. Provide detailed technical responses and use industry terminology.", + }, + }, }; const updateCallExample = #{ @@ -50,7 +39,7 @@ const updateCallExample = #{ params: #{ id: callId, url: "https://example.com/swml", - fallback_url: "https://example.com/fallback" - } - } + fallback_url: "https://example.com/fallback", + }, + }, }; diff --git a/specs/signalwire-rest/calling-api/calls/models/requests.tsp b/specs/signalwire-rest/calling-api/calls/models/requests.tsp index c61021c5..1d1a0ca2 100644 --- a/specs/signalwire-rest/calling-api/calls/models/requests.tsp +++ b/specs/signalwire-rest/calling-api/calls/models/requests.tsp @@ -1,15 +1,12 @@ import "@typespec/http"; import "@typespec/openapi3"; - using TypeSpec.Http; using TypeSpec.OpenAPI; - - const CallSWMLExample = "{'version': '1.0.0', 'sections': { 'main': [{ 'answer': { 'max_duration': 60 }},{ 'play': { 'urls': ['silence:2', 'say:Hello from SignalWire!']}}]}}"; -const CallFallbackURLExample = "https://example.com/fallback"; +const CallFallbackURLExample = "https://example.com/fallback"; const CallSWMLURLExample = "https://example.com/swml"; @@ -23,210 +20,189 @@ const paramsDescription = "An object of parameters to that will be utilized by t alias CallCreateRequestAlias = CallCreateParamsURL | CallCreateParamsSWML; - @summary("Hangup call") model CallHangupRequest { - @doc(uuidDescription) - @example(CallIdExample) - id: uuid; - - @doc("The `calling.end` command is used to hang up a call.") - @example("calling.end") - command: "calling.end"; - - @doc(paramsDescription) - params: { - @doc("Set the reason why the call was hung up.") - @example("hangup") - reason?: "hangup" | "busy" - }; + @doc(uuidDescription) + @example(CallIdExample) + id: uuid; + + @doc("The `calling.end` command is used to hang up a call.") + @example("calling.end") + command: "calling.end"; + + @doc(paramsDescription) + params: { + @doc("Set the reason why the call was hung up.") + @example("hangup") + reason?: "hangup" | "busy"; + }; } @summary("Hold call") model CallHoldRequest { - @doc(uuidDescription) - @example(CallIdExample) - id: uuid; + @doc(uuidDescription) + @example(CallIdExample) + id: uuid; - @doc("The `calling.ai_hold` command is used to hold a call.") - @example("calling.ai_hold") - command: "calling.ai_hold"; + @doc("The `calling.ai_hold` command is used to hold a call.") + @example("calling.ai_hold") + command: "calling.ai_hold"; - @doc(paramsDescription) - params: {} + @doc(paramsDescription) + params: {}; } @summary("Unhold call") model CallUnholdRequest { - @doc(uuidDescription) - @example(CallIdExample) - id: uuid; + @doc(uuidDescription) + @example(CallIdExample) + id: uuid; - @doc("The `calling.ai_unhold` command is used to unhold a call.") - @example("calling.ai_unhold") - command: "calling.ai_unhold"; + @doc("The `calling.ai_unhold` command is used to unhold a call.") + @example("calling.ai_unhold") + command: "calling.ai_unhold"; - @doc(paramsDescription) - params: {}; + @doc(paramsDescription) + params: {}; } @summary("Inject AI message") model CallAIMessageRequest { - @doc(uuidDescription) - @example(CallIdExample) - id: uuid; - - @doc("The `calling.ai_message` command is used to inject a message into the AI conversation.") - @example("calling.ai_message") - command: "calling.ai_message"; + @doc(uuidDescription) + @example(CallIdExample) + id: uuid; - @doc(paramsDescription) - params: { - @doc(""" - The role that the message is from. Each role type has a different purpose and will influence how the AI will interpret the message. - - `system`: Inject instructions or context that modify the AI's behavior mid-conversation without the caller hearing it. This could change the AI's personality, add new constraints, provide context about the conversation, or give the AI information it should know going forward. - - `user`: Inject a message as if the caller said it. This would appear in the conversation history as coming from the caller, and the AI would respond to it as if the caller just spoke it. - - `assistant`: Inject a message as if the AI said it. This would appear as an AI response in the conversation history. The AI would treat this as its own previous response when generating future replies. - """) - @example("system") - role: "system" | "user" | "assistant", + @doc("The `calling.ai_message` command is used to inject a message into the AI conversation.") + @example("calling.ai_message") + command: "calling.ai_message"; + @doc(paramsDescription) + params: { + @doc(""" + The role that the message is from. Each role type has a different purpose and will influence how the AI will interpret the message. + - `system`: Inject instructions or context that modify the AI's behavior mid-conversation without the caller hearing it. This could change the AI's personality, add new constraints, provide context about the conversation, or give the AI information it should know going forward. + - `user`: Inject a message as if the caller said it. This would appear in the conversation history as coming from the caller, and the AI would respond to it as if the caller just spoke it. + - `assistant`: Inject a message as if the AI said it. This would appear as an AI response in the conversation history. The AI would treat this as its own previous response when generating future replies. + """) + @example("system") + role: "system" | "user" | "assistant"; - @doc(""" - The text content that will be sent to the AI. - """) - @example("You are now in expert mode. Provide detailed technical responses.") - message_text: string - } + @doc(""" + The text content that will be sent to the AI. + """) + @example("You are now in expert mode. Provide detailed technical responses.") + message_text: string; + }; } - - @summary("Create call") model CallCreateRequest { - @doc("The `dial` command is used to create a new call.") - @example("dial") - command: "dial"; + @doc("The `dial` command is used to create a new call.") + @example("dial") + command: "dial"; - - @doc(paramsDescription) - params: CallCreateRequestAlias; + @doc(paramsDescription) + params: CallCreateRequestAlias; } model CallCreateParamsBase { - - @doc("The address that initiated the call. Can be either a E.164 formatted number (`+xxxxxxxxxxx`), or a SIP endpoint (`sip:xxx@yyy.zzz`).") - @example("sip:from-sip@example-112233445566.sip.signalwire.com") - from: string; - - @doc("The address that received the call. Can be either a E.164 formatted number (`+xxxxxxxxxxx`), or a SIP endpoint (`sip:xxx@yyy.zzz`).") - @example("sip:from-sip@example-112233445567.sip.signalwire.com") - to: string; + @doc("The address that initiated the call. Can be either a E.164 formatted number (`+xxxxxxxxxxx`), or a SIP endpoint (`sip:xxx@yyy.zzz`).") + @example("sip:from-sip@example-112233445566.sip.signalwire.com") + from: string; - @doc("The number, in E.164 format, or identifier of the caller.") - @example("+1234567890") - caller_id?: string; + @doc("The address that received the call. Can be either a E.164 formatted number (`+xxxxxxxxxxx`), or a SIP endpoint (`sip:xxx@yyy.zzz`).") + @example("sip:from-sip@example-112233445567.sip.signalwire.com") + to: string; - @doc("The Fallback URL to handle the call. This parameter allows you to specify a backup webhook or different route in your code containing SWML instructions for handling the call.") - @example(CallFallbackURLExample) - fallback_url?: string; + @doc("The number, in E.164 format, or identifier of the caller.") + @example("+1234567890") + caller_id?: string; + @doc("The Fallback URL to handle the call. This parameter allows you to specify a backup webhook or different route in your code containing SWML instructions for handling the call.") + @example(CallFallbackURLExample) + fallback_url?: string; } @summary("Create call (URL)") model CallCreateParamsURL is CallCreateParamsBase { - - @doc(""" - The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing SWML instructions for handling the call. - Either `url` or `swml` must be included for a new call. - """) - @example(CallSWMLURLExample) - url: string; - + @doc(""" + The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing SWML instructions for handling the call. + Either `url` or `swml` must be included for a new call. + """) + @example(CallSWMLURLExample) + url: string; } -@summary("Create call (SWML)") +@summary("Create call (SWML)") model CallCreateParamsSWML is CallCreateParamsBase { - - @doc("Inline SWML, passed as a string, containing SWML instructions for handling the call. Either `url` or `swml` must be included for a new call.") - @example(CallSWMLExample) - swml: string; + @doc("Inline SWML, passed as a string, containing SWML instructions for handling the call. Either `url` or `swml` must be included for a new call.") + @example(CallSWMLExample) + swml: string; } @summary("Update call") model CallUpdateParamsBase { + @doc(uuidDescription) + @example(CallIdExample) + id: string; - @doc(uuidDescription) - @example(CallIdExample) - id: string; - - @doc(""" - The Fallback URL to handle the call. - This parameter allows you to specify a backup webhook or different route in your code containing SWML instructions for handling the call. - """) - @example(CallFallbackURLExample) - fallback_url?: string; - - @doc("Either `canceled` (to cancel a not yet connected call) or `completed` (to end a call that is in progress).") - @example("canceled") - status?: "canceled" | "completed"; + @doc(""" + The Fallback URL to handle the call. + This parameter allows you to specify a backup webhook or different route in your code containing SWML instructions for handling the call. + """) + @example(CallFallbackURLExample) + fallback_url?: string; + @doc("Either `canceled` (to cancel a not yet connected call) or `completed` (to end a call that is in progress).") + @example("canceled") + status?: "canceled" | "completed"; } - -@summary("Update call (SWML)") +@summary("Update call (SWML)") model CallUpdateParamsSWML is CallUpdateParamsBase { - - @doc("Inline SWML, passed as a string, containing SWML instructions for handling the call. Either `url` or `swml` must be included for a new call.") - @example(CallSWMLExample) - swml: string; + @doc("Inline SWML, passed as a string, containing SWML instructions for handling the call. Either `url` or `swml` must be included for a new call.") + @example(CallSWMLExample) + swml: string; } @summary("Update call (URL)") model CallUpdateParamsURL is CallUpdateParamsBase { - - @doc(""" - The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing SWML instructions for handling the call. - Either `url` or `swml` must be included for a new call. - """) - @example(CallSWMLURLExample) - url: string; - + @doc(""" + The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing SWML instructions for handling the call. + Either `url` or `swml` must be included for a new call. + """) + @example(CallSWMLURLExample) + url: string; } @summary("Update call") @oneOf union UpdateCurrentCallRequest { - CallUpdateSWMLRequest; - CallUpdateURLRequest; + CallUpdateSWMLRequest, + CallUpdateURLRequest, } union CallUpdateRequest { - UpdateCurrentCallRequest; - CallHangupRequest; - CallHoldRequest; - CallUnholdRequest; - CallAIMessageRequest; + UpdateCurrentCallRequest, + CallHangupRequest, + CallHoldRequest, + CallUnholdRequest, + CallAIMessageRequest, } - model CallUpdateRequestBase { - @doc(updateCommandDescription) - @example("update") - command: "update"; + @doc(updateCommandDescription) + @example("update") + command: "update"; } @summary("Update call (SWML)") model CallUpdateSWMLRequest is CallUpdateRequestBase { - - @doc(paramsDescription) - params: CallUpdateParamsSWML; + @doc(paramsDescription) + params: CallUpdateParamsSWML; } @summary("Update call (URL)") model CallUpdateURLRequest is CallUpdateRequestBase { - - @doc(paramsDescription) - params: CallUpdateParamsURL; + @doc(paramsDescription) + params: CallUpdateParamsURL; } - - diff --git a/specs/signalwire-rest/calling-api/calls/models/responses.tsp b/specs/signalwire-rest/calling-api/calls/models/responses.tsp index 554a6e37..3146acfc 100644 --- a/specs/signalwire-rest/calling-api/calls/models/responses.tsp +++ b/specs/signalwire-rest/calling-api/calls/models/responses.tsp @@ -4,17 +4,21 @@ import "../../../types/status-codes"; using Types.StatusCodes; using TypeSpec.Http; -model CallResponse {...Call} +model CallResponse { + ...Call; +} @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "missing_required_parameter", message: "url must be a valid http or https url", attribute: "url", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#http_url_required" - }], - }) + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#http_url_required", + } + ], +}) model CallCreate422Error is Types.StatusCodes.StatusCode422; -model CallUpdate422Error is CallCreate422Error; \ No newline at end of file +model CallUpdate422Error is CallCreate422Error; diff --git a/specs/signalwire-rest/calling-api/main.tsp b/specs/signalwire-rest/calling-api/main.tsp index 01aa2dd5..4e78060a 100644 --- a/specs/signalwire-rest/calling-api/main.tsp +++ b/specs/signalwire-rest/calling-api/main.tsp @@ -2,20 +2,20 @@ import "@typespec/http"; import "../types"; import "./calls"; - - using TypeSpec.Http; using Types.StatusCodes; -@service(#{ - title: "Calling API", -}) -@server("https://{space_name}.signalwire.com/api/calling", "Endpoint", { - space_name: string = "{Your_Space_Name}"; -}) +@service(#{ title: "Calling API" }) +@server( + "https://{space_name}.signalwire.com/api/calling", + "Endpoint", + { + space_name: string = "{Your_Space_Name}", + } +) @useAuth(BasicAuth) @doc(""" - API to create/manage SignalWire's Calls. - To create a new Call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`. - """) -namespace CallingAPI; \ No newline at end of file + API to create/manage SignalWire's Calls. + To create a new Call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`. + """) +namespace CallingAPI; diff --git a/specs/signalwire-rest/calling-api/tsp-output/@typespec/openapi3/openapi.yaml b/specs/signalwire-rest/calling-api/tsp-output/@typespec/openapi3/openapi.yaml index 84575e33..bef49cfb 100644 --- a/specs/signalwire-rest/calling-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/specs/signalwire-rest/calling-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -24,19 +24,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -66,19 +62,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -531,6 +523,24 @@ components: amount: type: integer description: Charged amount. + Types.StatusCodes.StatusCode401: + type: object + required: + - error + properties: + error: + type: string + enum: + - Unauthorized + Types.StatusCodes.StatusCode404: + type: object + required: + - error + properties: + error: + type: string + enum: + - Not Found Types.StatusCodes.StatusCode422Error: type: object required: diff --git a/specs/signalwire-rest/chat-api/main.tsp b/specs/signalwire-rest/chat-api/main.tsp index 86e8e030..4d3f08b4 100644 --- a/specs/signalwire-rest/chat-api/main.tsp +++ b/specs/signalwire-rest/chat-api/main.tsp @@ -2,20 +2,19 @@ import "@typespec/http"; import "../types"; import "./tokens"; - - - using TypeSpec.Http; using Types.StatusCodes; -@service(#{ - title: "Chat API", -}) -@server("https://{space_name}.signalwire.com/api/chat", "Endpoint", { - space_name: string = "{Your_Space_Name}"; -}) +@service(#{ title: "Chat API" }) +@server( + "https://{space_name}.signalwire.com/api/chat", + "Endpoint", + { + space_name: string = "{Your_Space_Name}", + } +) @useAuth(BasicAuth) @doc(""" - An API to programmatically create your own Chat Applications. - """) -namespace ChatAPI; \ No newline at end of file + An API to programmatically create your own Chat Applications. + """) +namespace ChatAPI; diff --git a/specs/signalwire-rest/chat-api/tokens/main.tsp b/specs/signalwire-rest/chat-api/tokens/main.tsp index bbcbf2bf..96fae099 100644 --- a/specs/signalwire-rest/chat-api/tokens/main.tsp +++ b/specs/signalwire-rest/chat-api/tokens/main.tsp @@ -4,32 +4,30 @@ import "./models/core.tsp"; import "./models/requests.tsp"; import "./models/responses.tsp"; - - using TypeSpec.Http; using Types.StatusCodes; @route("/tokens") namespace ChatAPI.Tokens { - - @tag("Tokens") - @friendlyName("Tokens") - interface ChatTokens { - - @summary("Generate a new Chat Token") - @doc(""" - Generate a Chat Token to be used to authenticate clients to the Chat Service. - - - #### Permissions - - The API token must include the following scopes: `Chat`. - """) - create(...NewChatToken): - { @statusCode statusCode: 201; @body call: ChatToken; } | - StatusCode401 | - StatusCode404 | - ChatToken422Error; - } - + @tag("Tokens") + @friendlyName("Tokens") + interface ChatTokens { + @summary("Generate a new Chat Token") + @doc(""" + Generate a Chat Token to be used to authenticate clients to the Chat Service. + + + #### Permissions + + The API token must include the following scopes: `Chat`. + """) + create(...NewChatToken): + | { + @statusCode statusCode: 201; + @body call: ChatToken; + } + | StatusCode401 + | StatusCode404 + | ChatToken422Error; + } } diff --git a/specs/signalwire-rest/chat-api/tokens/models/core.tsp b/specs/signalwire-rest/chat-api/tokens/models/core.tsp index c6e7e8c8..b4469d21 100644 --- a/specs/signalwire-rest/chat-api/tokens/models/core.tsp +++ b/specs/signalwire-rest/chat-api/tokens/models/core.tsp @@ -1,9 +1,5 @@ - - model ChatToken { - - @doc("The generated Chat Token.") - @example("eyJ0eXAiOiJWUlQiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2MjIxMjAxMjMsI...wMCwicnNlIjo5MDB9-BqG-DqC5LhpsdMWEFjhVkTBpQ") - token: string; - -} \ No newline at end of file + @doc("The generated Chat Token.") + @example("eyJ0eXAiOiJWUlQiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2MjIxMjAxMjMsI...wMCwicnNlIjo5MDB9-BqG-DqC5LhpsdMWEFjhVkTBpQ") + token: string; +} diff --git a/specs/signalwire-rest/chat-api/tokens/models/requests.tsp b/specs/signalwire-rest/chat-api/tokens/models/requests.tsp index 1f7ce957..4a7457a3 100644 --- a/specs/signalwire-rest/chat-api/tokens/models/requests.tsp +++ b/specs/signalwire-rest/chat-api/tokens/models/requests.tsp @@ -1,48 +1,49 @@ /* Model is used to work-around a bug in the rest api plugin, not a TypeSpec issue. Duplicate description must be present and usage of a model is required. Otherwise the property will render a additionalProperty with the exact same description as the top level property holding additionalProperties. */ @doc("An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.") -@example(#{key: "value", key2: "value2"}) +@example(#{ key: "value", key2: "value2" }) model ChatState is Record; model NewChatToken { - @minValue(1) - @maxValue(43200) - @example(60) - @doc("The maximum time, in minutes, that the access token will be valid for. Between 1 and 43,200 (30 days).") - ttl: integer; + @minValue(1) + @maxValue(43200) + @example(60) + @doc("The maximum time, in minutes, that the access token will be valid for. Between 1 and 43,200 (30 days).") + ttl: integer; + channels: ChatChannel; - channels: ChatChannel; + @doc("The unique identifier of the member. Up to 250 characters. If not specified, a random UUID will be generated.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + member_id?: string; - @doc("The unique identifier of the member. Up to 250 characters. If not specified, a random UUID will be generated.") - @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") - member_id?: string; - - /* Model is used to work-around a bug in the rest api plugin, not a TypeSpec issue. Duplicate description must be present and usage of a model is required. + /* Model is used to work-around a bug in the rest api plugin, not a TypeSpec issue. Duplicate description must be present and usage of a model is required. Otherwise the property will render a additionalProperty with the exact same description as the top level property holding additionalProperties. */ - @doc("An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.") - state?: ChatState; - + @doc("An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.") + state?: ChatState; } - @doc(""" -User-defined channel names. Each channel is a object with `read` and `write` properties. -Max of 500 channels inside main `channels`. Either `read`, `write`, or both are required inside each channel and default to `false`. -Each channel name can be up to 250 characters. Must be valid JSON. -""") -@example(#{channel1: #{read: true, write: true}, channel2: #{read: true, write: false}}) -model ChatChannel { - ...ChatPermissions; -}; + User-defined channel names. Each channel is a object with `read` and `write` properties. + Max of 500 channels inside main `channels`. Either `read`, `write`, or both are required inside each channel and default to `false`. + Each channel name can be up to 250 characters. Must be valid JSON. + """) +@example(#{ + channel1: #{ read: true, write: true }, + channel2: #{ read: true, write: false }, +}) +model ChatChannel { + ...ChatPermissions; +} @doc("Chat Permissions for a channel.") -model ChatPermissions is Record<{ - +model ChatPermissions + is Record<{ @doc("Gives the token read access to the channel.") @example(true) read: boolean; + @doc("Gives the token write access to the channel.") @example(false) write: boolean; -}>; \ No newline at end of file + }>; diff --git a/specs/signalwire-rest/chat-api/tokens/models/responses.tsp b/specs/signalwire-rest/chat-api/tokens/models/responses.tsp index c368783c..8c9f48c4 100644 --- a/specs/signalwire-rest/chat-api/tokens/models/responses.tsp +++ b/specs/signalwire-rest/chat-api/tokens/models/responses.tsp @@ -1,12 +1,14 @@ import "../../../types/status-codes"; @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "missing_required_parameter", message: "A required parameter is missing from the request. Please refer to the technical reference for a complete list of parameters.", attribute: "ttl", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter" - }], - }) -model ChatToken422Error is Types.StatusCodes.StatusCode422; \ No newline at end of file + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model ChatToken422Error is Types.StatusCodes.StatusCode422; diff --git a/specs/signalwire-rest/chat-api/tsp-output/@typespec/openapi3/openapi.yaml b/specs/signalwire-rest/chat-api/tsp-output/@typespec/openapi3/openapi.yaml index fbb673dd..c6108abf 100644 --- a/specs/signalwire-rest/chat-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/specs/signalwire-rest/chat-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -28,19 +28,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -140,6 +136,24 @@ components: allOf: - $ref: '#/components/schemas/ChatState' description: An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters. + Types.StatusCodes.StatusCode401: + type: object + required: + - error + properties: + error: + type: string + enum: + - Unauthorized + Types.StatusCodes.StatusCode404: + type: object + required: + - error + properties: + error: + type: string + enum: + - Not Found Types.StatusCodes.StatusCode422Error: type: object required: diff --git a/specs/signalwire-rest/datasphere-api/document/main.tsp b/specs/signalwire-rest/datasphere-api/document/main.tsp index 657a9956..b8804a0f 100644 --- a/specs/signalwire-rest/datasphere-api/document/main.tsp +++ b/specs/signalwire-rest/datasphere-api/document/main.tsp @@ -14,73 +14,71 @@ namespace DatasphereAPI.Documents { interface Documents { @doc("A list of Datasphere Documents") @summary("List Documents") - list(): - DocumentListResponse | - StatusCode401 | - StatusCode404; + list(): DocumentListResponse | StatusCode401 | StatusCode404; @doc("Creates a Datasphere Document") @summary("Create a Document") - @post create(@body body: DocumentCreateRequest): - { @statusCode statusCode: 201; @body document: Document; } | - StatusCode401 | - StatusCode404 | - CreateStatusCode422; + @post + create(@body body: DocumentCreateRequest): + | { + @statusCode statusCode: 201; + @body document: Document; + } + | StatusCode401 + | StatusCode404 + | CreateStatusCode422; @doc("Updates a Datasphere Document by ID") @summary("Update a Document") - @patch(#{ implicitOptionality: true }) update(...PathID, ...DocumentUpdateRequest): { - @statusCode statusCode: 200; @body document: Document; - } | - StatusCode401 | - StatusCode404 | - SearchStatusCode422; + @patch(#{ implicitOptionality: true }) + update(...PathID, ...DocumentUpdateRequest): + | { + @statusCode statusCode: 200; + @body document: Document; + } + | StatusCode401 + | StatusCode404 + | SearchStatusCode422; @doc("Deletes a Datasphere Document by ID") @summary("Delete a Document") - @delete delete(...PathID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; + @delete + delete(...PathID): { + @statusCode statusCode: 204; + } | StatusCode401 | StatusCode404; @doc("Search Datasphere Documents") @route("/search") @summary("Search Documents") - @post search(...DocumentSearchRequest): - Chunk[] | - StatusCode401 | - StatusCode404 | - SearchStatusCode422; - } + @post + search(...DocumentSearchRequest): + | Chunk[] + | StatusCode401 + | StatusCode404 + | SearchStatusCode422; + } } namespace DatasphereAPI.Chunks { @route("/documents/{documentId}/chunks") @tag("Chunks") @friendlyName("Chunks") - interface Chunks { @doc("A list of chunks for a Datasphere Document.") @summary("List Chunks") - list(...DocumentPathID): - ChunkListResponse | - StatusCode401 | - StatusCode404; + list(...DocumentPathID): ChunkListResponse | StatusCode401 | StatusCode404; @doc("Retrieves a specific chunk for a Datasphere Document by ID.") @summary("Retrieve Chunk") @route("/{chunkId}") - get(...ChunkPathID): - ChunkResponse | - StatusCode401 | - StatusCode404; + get(...ChunkPathID): ChunkResponse | StatusCode401 | StatusCode404; @doc("Deletes a specific chunk for a Datasphere Document by ID.") @summary("Delete Chunk") @route("/{chunkId}") - @delete delete(...ChunkPathID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } + @delete + delete(...ChunkPathID): { + @statusCode statusCode: 204; + } | StatusCode401 | StatusCode404; + } } diff --git a/specs/signalwire-rest/datasphere-api/document/models/core.tsp b/specs/signalwire-rest/datasphere-api/document/models/core.tsp index 69808605..b2964a7c 100644 --- a/specs/signalwire-rest/datasphere-api/document/models/core.tsp +++ b/specs/signalwire-rest/datasphere-api/document/models/core.tsp @@ -9,9 +9,8 @@ scalar docid extends string; model PathID { @doc("Unique ID of a Document.") - @path - id: docid + id: docid; } model ChunkPathID { diff --git a/specs/signalwire-rest/datasphere-api/document/models/errors.tsp b/specs/signalwire-rest/datasphere-api/document/models/errors.tsp index a719f1e9..204d0582 100644 --- a/specs/signalwire-rest/datasphere-api/document/models/errors.tsp +++ b/specs/signalwire-rest/datasphere-api/document/models/errors.tsp @@ -3,23 +3,27 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ - type: "validation_error", - code: "invalid_parameter", - message: "Invalid chunking_strategy", - attribute: "chunking_strategy", - url: "https://developer.signalwire.com/rest/overview/error-codes#{code}" - }], + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter", + message: "Invalid chunking_strategy", + attribute: "chunking_strategy", + url: "https://developer.signalwire.com/rest/overview/error-codes#{code}", + } + ], }) model CreateStatusCode422 is StatusCode422; @example(#{ - errors: #[#{ - type: "validation_error", - code: "invalid_parameter", - message: "Invalid tags", - attribute: "tags", - url: "https://developer.signalwire.com/rest/overview/error-codes#{code}" - }], + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter", + message: "Invalid tags", + attribute: "tags", + url: "https://developer.signalwire.com/rest/overview/error-codes#{code}", + } + ], }) model SearchStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/datasphere-api/document/models/requests.tsp b/specs/signalwire-rest/datasphere-api/document/models/requests.tsp index 1a22d55a..0eee8ca3 100644 --- a/specs/signalwire-rest/datasphere-api/document/models/requests.tsp +++ b/specs/signalwire-rest/datasphere-api/document/models/requests.tsp @@ -46,13 +46,10 @@ model DocumentCreateRequestBase { @doc("Document tags.") @example(#["sports", "football", "game"]) tags?: string[]; - } - @summary("Sentence strategy") model DocumentCreateSentenceRequest extends DocumentCreateRequestBase { - @doc("Maximum number of sentences per chunk.") @example(40) max_sentences_per_chunk?: integer = 50; @@ -86,7 +83,6 @@ model DocumentCreateSlidingRequest extends DocumentCreateRequestBase { overlap_size?: integer = 10; } - @summary("Page strategy") model DocumentCreatePageRequest extends DocumentCreateRequestBase { @doc("Strategy for chunking the document") @@ -96,21 +92,19 @@ model DocumentCreatePageRequest extends DocumentCreateRequestBase { @summary("Paragraph strategy") model DocumentCreateParagraphRequest extends DocumentCreateRequestBase { - @doc("Strategy for chunking the document") @example(ChunkingStrategy.Paragraph) chunking_strategy?: ChunkingStrategy.Paragraph; -} +} @oneOf union DocumentCreateRequest { DocumentCreateSentenceRequest, DocumentCreateSlidingRequest, DocumentCreatePageRequest, - DocumentCreateParagraphRequest + DocumentCreateParagraphRequest, } - model DocumentUpdateRequest { @doc("Document tags.") @example(#["sports", "football", "game"]) diff --git a/specs/signalwire-rest/datasphere-api/main.tsp b/specs/signalwire-rest/datasphere-api/main.tsp index c6c3c676..48d2aeca 100644 --- a/specs/signalwire-rest/datasphere-api/main.tsp +++ b/specs/signalwire-rest/datasphere-api/main.tsp @@ -5,12 +5,14 @@ import "./document"; using TypeSpec.Http; using Types.StatusCodes; -@service(#{ - title: "Datasphere API", -}) -@server("https://{space_name}.signalwire.com/api/datasphere", "Endpoint", { - space_name: string = "{Your_Space_Name}" -}) +@service(#{ title: "Datasphere API" }) +@server( + "https://{space_name}.signalwire.com/api/datasphere", + "Endpoint", + { + space_name: string = "{Your_Space_Name}", + } +) @useAuth(BasicAuth) @doc("An AI-powered API for document search.") namespace DatasphereAPI; diff --git a/specs/signalwire-rest/datasphere-api/tsp-output/@typespec/openapi3/openapi.yaml b/specs/signalwire-rest/datasphere-api/tsp-output/@typespec/openapi3/openapi.yaml index b93c75ef..431808ba 100644 --- a/specs/signalwire-rest/datasphere-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/specs/signalwire-rest/datasphere-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -23,19 +23,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Documents post: @@ -53,19 +49,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -98,19 +90,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -142,19 +130,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Chunks /documents/{documentId}/chunks/{chunkId}: @@ -175,19 +159,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Chunks delete: @@ -203,19 +183,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Chunks /documents/{id}: @@ -235,19 +211,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: @@ -274,19 +246,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Documents security: @@ -747,6 +715,24 @@ components: message: Invalid tags attribute: tags url: https://developer.signalwire.com/rest/overview/error-codes#{code} + Types.StatusCodes.StatusCode401: + type: object + required: + - error + properties: + error: + type: string + enum: + - Unauthorized + Types.StatusCodes.StatusCode404: + type: object + required: + - error + properties: + error: + type: string + enum: + - Not Found Types.StatusCodes.StatusCode422Error: type: object required: diff --git a/specs/signalwire-rest/fabric-api/_category_.yaml b/specs/signalwire-rest/fabric-api/_category_.yaml deleted file mode 100644 index 98485b91..00000000 --- a/specs/signalwire-rest/fabric-api/_category_.yaml +++ /dev/null @@ -1,5 +0,0 @@ -label: Fabric API -collapsible: false # make the category collapsible -collapsed: false # keep the category open by default -className: menu-category -position: 1 diff --git a/specs/signalwire-rest/fabric-api/_shared/const.tsp b/specs/signalwire-rest/fabric-api/_shared/const.tsp new file mode 100644 index 00000000..f412b8f8 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/_shared/const.tsp @@ -0,0 +1,11 @@ +const SWML_EXAMPLE = """ + { "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}}; + """; + +const CXML_EXAMPLE = """ + Hello World + """; + +const UTC_TIME_EXAMPLE = utcDateTime.fromISO(""" + 2024-05-06T12:20:00Z + """); diff --git a/specs/signalwire-rest/fabric-api/enums.tsp b/specs/signalwire-rest/fabric-api/_shared/enums.tsp similarity index 66% rename from specs/signalwire-rest/fabric-api/enums.tsp rename to specs/signalwire-rest/fabric-api/_shared/enums.tsp index 52b21446..9421eccd 100644 --- a/specs/signalwire-rest/fabric-api/enums.tsp +++ b/specs/signalwire-rest/fabric-api/_shared/enums.tsp @@ -42,8 +42,25 @@ enum HandleCallsUsing { ExternalUrl: "external_url", } +enum FabricResponseType { + AiAgent: "ai_agent", + DialogflowAgent: "dialogflow_agent", + CallFlow: "call_flow", + SwmlWebhook: "swml_webhook", + FreeswitchConnector: "freeswitch_connector", + CxmlApplication: "cxml_application", + CxmlScript: "cxml_script", + CxmlWebhook: "cxml_webhook", + RelayApplication: "relay_application", + SipEndpoint: "sip_endpoint", + SipGateway: "sip_gateway", + Subscriber: "subscriber", + SwmlScript: "swml_script", + ConferenceRoom: "video_room", +} + union AddressChannel { AudioChannel, MessagingChannel, - VideoChannel + VideoChannel, } diff --git a/specs/signalwire-rest/fabric-api/_shared/fabric-address/main.tsp b/specs/signalwire-rest/fabric-api/_shared/fabric-address/main.tsp new file mode 100644 index 00000000..141c4bbc --- /dev/null +++ b/specs/signalwire-rest/fabric-api/_shared/fabric-address/main.tsp @@ -0,0 +1 @@ +import "./models/responses.tsp"; diff --git a/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/core.tsp b/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/core.tsp new file mode 100644 index 00000000..62e6fb59 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/core.tsp @@ -0,0 +1,86 @@ +import "@typespec/openapi3"; +import "../../../../types"; +import "../../enums.tsp"; +import "../../const.tsp"; + +using TypeSpec.Http; + +model FabricAddressID { + @doc("Unique ID of a FabricAddress.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model FabricAddress { + @doc("Unique ID of the Fabric Address.") + @example("691af061-cd86-4893-a605-173f47afc4c2") + @format("uuid") + id: uuid; + + @doc("Name of the Fabric Address.") + @example("justice-league") + name: string; + + @doc("Display name of the Fabric Address.") + @example("Justice League") + display_name: string; + + @doc("Cover url of the Fabric Address.") + @example("https://coverurl.com") + cover_url: string; + + @doc("Preview url of the Fabric Address.") + @example("https://previewurl.com") + preview_url: string; + + @doc("Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls.") + @example(true) + locked: boolean; + + @doc("Channels of the Fabric Address.") + channels: AddressChannel; + + @doc("Fabric Address Creation Date.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + type: DisplayTypes; +} + +@summary("Application Address") +model FabricAddressApp { + ...OmitProperties; + + @doc("The display type of a fabric address pointing to an application.") + @example(DisplayTypes.App) + type: DisplayTypes.App; +} + +@summary("Room Address") +model FabricAddressRoom { + ...OmitProperties; + + @doc("The display type of a fabric address pointing to a Conference Room.") + @example(DisplayTypes.Room) + type: DisplayTypes.Room; +} + +@summary("Call Address") +model FabricAddressCall { + ...OmitProperties; + + @doc("The display type of a fabric address pointing to call.") + @example(DisplayTypes.Call) + type: DisplayTypes.Call; +} + +@summary("Subscriber Address") +model FabricAddressSubscriber { + ...OmitProperties; + + @doc("The display type of a fabric address pointing to a Subscriber.") + @example(DisplayTypes.Subscriber) + type: DisplayTypes.Subscriber; +} diff --git a/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/responses.tsp b/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/responses.tsp new file mode 100644 index 00000000..916254c0 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/_shared/fabric-address/models/responses.tsp @@ -0,0 +1,27 @@ +import "./core.tsp"; + +model FabricAddressesResponse { + @doc("An array of objects containing a list of Resource Addresses") + data: FabricAddress[]; + + @doc("Object containing pagination links") + links: FabricAddressPaginationResponse; +} + +model FabricAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/addresses?page_number=1&page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/addresses/main.tsp b/specs/signalwire-rest/fabric-api/addresses/main.tsp index 1bd8dd7d..91f2e167 100644 --- a/specs/signalwire-rest/fabric-api/addresses/main.tsp +++ b/specs/signalwire-rest/fabric-api/addresses/main.tsp @@ -1,8 +1,8 @@ import "@typespec/http"; import "@typespec/openapi"; -import "./models/core.tsp"; -import "./models/responses.tsp"; +import "../_shared/fabric-address"; import "../../types"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @@ -10,29 +10,32 @@ using Types.StatusCodes; @useAuth(BearerAuth) @route("/addresses") namespace FabricAPI.FabricAddresses { - @tag("Fabric Address") + @tag(FABRIC_ADDRESS_TAG) @friendlyName("Fabric Address") interface FabricAddresses { @summary("List Fabric Addresses") @doc(""" - A list of Fabric Addresses. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) wich can be - generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). - """) + A list of Fabric Addresses. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) which can be + generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). + """) list(): - FabricAddressesResponse | - StatusCode401 | - StatusCode404; + | FabricAddressesResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Get Fabric Address") @doc(""" - Returns a Fabric Address by ID. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) wich can be - generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). - """) - read(...FabricAddressID): { - @statusCode statusCode: 200; - @body fabric_address: FabricAddress; - } | - StatusCode401 | - StatusCode404; + Returns a Fabric Address by ID. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) which can be + generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). + """) + read(...FabricAddressID): + | { + @statusCode statusCode: 200; + @body fabric_address: FabricAddress; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; } } diff --git a/specs/signalwire-rest/fabric-api/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/addresses/models/core.tsp deleted file mode 100644 index 60c9347a..00000000 --- a/specs/signalwire-rest/fabric-api/addresses/models/core.tsp +++ /dev/null @@ -1,49 +0,0 @@ -import "@typespec/openapi3"; -import "../../../types"; -import "../../enums.tsp"; - -using TypeSpec.Http; -using TypeSpec.OpenAPI; - -model FabricAddressID { - @doc("Unique ID of a FabricAddress.") - @path - id: uuid -} - -model FabricAddress { - @doc("Unique ID of the Fabric Address.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - id: uuid; - - @doc("Name of the Fabric Address.") - @example("justice-league") - name: string; - - @doc("Display name of the Fabric Address.") - @example("Justice League") - display_name: string; - - @doc("Type of the Fabric Address.") - @example(DisplayTypes.App) - type: DisplayTypes; - - @doc("Cover url of the Fabric Address.") - @example("https://coverurl.com") - cover_url: string; - - @doc("Preview url of the Fabric Address.") - @example("https://previewurl.com") - preview_url: string; - - @doc("Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls.") - @example(true) - locked: boolean; - - @doc("Channels of the Fabric Address.") - channel: AddressChannel; - - @doc("Fabric Address Creation Date.") - @example(utcDateTime.fromISO("2024-05-06T12:20-12Z")) - created_at: utcDateTime; -} diff --git a/specs/signalwire-rest/fabric-api/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/addresses/models/responses.tsp deleted file mode 100644 index 1eeb4867..00000000 --- a/specs/signalwire-rest/fabric-api/addresses/models/responses.tsp +++ /dev/null @@ -1,18 +0,0 @@ -model FabricAddressesResponse { - data: FabricAddress[]; - links: FabricAddressPaginationResponse; -} - -model FabricAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/addresses?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/addresses?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} diff --git a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/core.tsp deleted file mode 100644 index 4e28de16..00000000 --- a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/core.tsp +++ /dev/null @@ -1,45 +0,0 @@ -import "@typespec/openapi3"; -import "./enums.tsp"; -import "../../../types"; - -using TypeSpec.Http; -using TypeSpec.OpenAPI; - -model AIAgentIDPath { - @doc("Unique ID of a AI Agent.") - @path - ai_agent_id: uuid -} - -model AIAgentAddress { - @doc("Unique ID of the Fabric Address.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - id: uuid; - - @doc("Fabric resource ID that the Fabric Address belongs to.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - resource_id: uuid; - - @doc("Name of the Fabric Address.") - @example("justice-league") - name: string; - - @doc("Display name of the Fabric Address.") - @example("Justice League") - display_name: string; - - @doc("Type of the Fabric Address.") - @example(DisplayTypes.App) - type: DisplayTypes; - - @doc("Cover url of the Fabric Address.") - @example("https://coverurl.com") - cover_url: string; - - @doc("Preview url of the Fabric Address.") - @example("https://previewurl.com") - preview_url: string; - - @doc("Channels of the Fabric Address.") - channel: AddressChannel; -} diff --git a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/enums.tsp deleted file mode 100644 index e7475bbe..00000000 --- a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/enums.tsp +++ /dev/null @@ -1 +0,0 @@ -import "./../../enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/responses.tsp deleted file mode 100644 index b25f0665..00000000 --- a/specs/signalwire-rest/fabric-api/ai-agent-addresses/models/responses.tsp +++ /dev/null @@ -1,18 +0,0 @@ -model AIAgentAddressListResponse { - data: AIAgentAddress[]; - links: AIAgentAddressPaginationResponse; -} - -model AIAgentAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} diff --git a/specs/signalwire-rest/fabric-api/ai-agent-addresses/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/addresses/main.tsp similarity index 51% rename from specs/signalwire-rest/fabric-api/ai-agent-addresses/main.tsp rename to specs/signalwire-rest/fabric-api/ai-agent/addresses/main.tsp index cc002fc0..9d9ea2b4 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent-addresses/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/addresses/main.tsp @@ -2,22 +2,22 @@ import "@typespec/http"; import "@typespec/openapi"; import "./models/core.tsp"; import "./models/responses.tsp"; -import "../../types"; +import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/ai_agents/{ai_agent_id}/addresses") -namespace FabricAPI.AIAgentAddresses { - @tag("AI Agent") - @friendlyName("AI Agent") +namespace FabricAPI.AIAgent.Addresses { + @tag(AI_CUSTOM_TAG) interface AIAgentAddresses { @summary("List AI Agent Addresses") - @doc("A list of AI Agent Addresses") + @doc("This endpoint returns a list of addresses associated with a specific AI Agent.") list(...AIAgentIDPath): - AIAgentAddressListResponse | - StatusCode401 | - StatusCode404; + | AIAgentAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; } } - diff --git a/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/core.tsp new file mode 100644 index 00000000..17ab6581 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/core.tsp @@ -0,0 +1,14 @@ +import "@typespec/openapi3"; +import "./enums.tsp"; +import "../../../../types"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +model AIAgentIDPath { + @doc("Unique ID of a AI Agent.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + ai_agent_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/enums.tsp new file mode 100644 index 00000000..36ac661a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/enums.tsp @@ -0,0 +1 @@ +import "../../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/responses.tsp new file mode 100644 index 00000000..692308b8 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/ai-agent/addresses/models/responses.tsp @@ -0,0 +1,27 @@ +import "../../../_shared/fabric-address"; + +model AIAgentAddressListResponse { + @doc("An array of objects containing the address data") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: AIAddressPaginationResponse; +} + +model AIAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=ai_agent") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=ai_agent") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/ai-agent/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/main.tsp index a8f70c5c..c31723a5 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/main.tsp @@ -4,52 +4,68 @@ import "./models/core.tsp"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "./addresses"; import "../../types"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/ai_agents") namespace FabricAPI.AIAgents { - @tag("AI Agents: Custom") + @tag(AI_CUSTOM_TAG) @friendlyName("AI Agent: Custom") interface AIAgents { @summary("List AI Agents") @doc("A list of AI Agents") - list(): - AIAgentListResponse | - StatusCode401 | - StatusCode404; + list(): AIAgentListResponse | StatusCode401 | StatusCode404 | StatusCode500; @summary("Get AI Agent") @doc("Returns an AI Agent by ID") read(...AIAgentPathID): - { @statusCode statusCode: 200; @body ai_agent: AIAgentResponse; } | - StatusCode401 | - StatusCode404; + | { + @statusCode statusCode: 200; + @body ai_agent: AIAgentResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Create AI Agent") @doc("Creates an AI Agent") - @post create(...AIAgentCreateRequest): - { @statusCode statusCode: 201; @body ai_agent: AIAgentResponse; } | - StatusCode401 | - StatusCode404 | - AIAgentCreateStatusCode422; + @post + create(...AIAgentCreateRequest): + | { + @statusCode statusCode: 201; + @body ai_agent: AIAgentResponse; + } + | StatusCode401 + | StatusCode404 + | AIAgentCreateStatusCode422 + | StatusCode500; @summary("Update AI Agent") @doc("Updates an AI Agent by ID") - @patch(#{ implicitOptionality: true }) update(...AIAgentPathID, ...AIAgentUpdateRequest): - { @statusCode statusCode: 200; @body ai_agent: AIAgentResponse; } | - StatusCode401 | - StatusCode404 | - AIAgentUpdateStatusCode422; + @patch(#{ implicitOptionality: true }) + update(...AIAgentPathID, ...AIAgentUpdateRequest): + | { + @statusCode statusCode: 200; + @body ai_agent: AIAgentResponse; + } + | StatusCode401 + | StatusCode404 + | AIAgentUpdateStatusCode422 + | StatusCode500; @summary("Delete AI Agent") @doc("Deletes an AI Agent by ID") - @delete delete(...AIAgentPathID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } + @delete + delete(...AIAgentPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } } - diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_languages.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_languages.tsp index 5865056f..c58bedf1 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_languages.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_languages.tsp @@ -26,5 +26,5 @@ model LanguagesWithFillers is LanguagesBase { @summary("languages") union Languages { - LanguagesWithFillers + LanguagesWithFillers, } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_params.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_params.tsp index afd1df3c..b862a2f0 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_params.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_params.tsp @@ -5,9 +5,10 @@ scalar IntegerOrZero extends integer; @summary("Direction enum") enum Direction { @doc("Sets the direction of the call to `inbound` for the assistant.") - "inbound", + inbound, + @doc("Sets the direction of the call to `outbound` for the assistant.") - "outbound" + outbound, } @summary("params object") @@ -21,7 +22,7 @@ model AIParams { ai_volume?: integer; @doc("Amount of time, in ms, to wait before prompting the user to respond. Allowed values from `10,000` - `600,000`. Set to `0` to disable.") - attention_timeout?: (IntegerOrZero | 0); + attention_timeout?: IntegerOrZero | 0; @doc("A custom prompt that is fed into the AI when the attention_timeout is reached.") @example("Ask if the user would like you to repeat yourself, or if they need more time to respond.") @@ -41,9 +42,9 @@ model AIParams { background_file_volume?: integer; @doc(""" - Takes a string, including a regular expression, defining barge behavior. - For example, this param can direct the AI to stop when the word 'hippopotomus' is input. - """) + Takes a string, including a regular expression, defining barge behavior. + For example, this param can direct the AI to stop when the word 'hippopotomus' is input. + """) @example("Cancel order") barge_match_string?: string; @@ -110,9 +111,9 @@ model AIParams { inactivity_timeout?: integer; @doc(""" - Check for input function with check_for_input. - Example use case: Feeding an inbound SMS to AI on a voice call, eg., for collecting an email address or other complex information. - """) + Check for input function with check_for_input. + Example use case: Feeding an inbound SMS to AI on a voice call, eg., for collecting an email address or other complex information. + """) input_poll_freq?: string; @doc("When enabled, barges agent upon any sound interruption longer than 1 second.") @@ -135,10 +136,10 @@ model AIParams { outbound_attention_timeout?: integer; @doc(""" - Send a summary of the conversation after the call ends. - This requires a `post_url` to be set in the ai parameters and the `conversation_id` defined below. - This eliminates the need for a `post_prompt` in the ai parameters. - """) + Send a summary of the conversation after the call ends. + This requires a `post_url` to be set in the ai parameters and the `conversation_id` defined below. + This eliminates the need for a `post_prompt` in the ai parameters. + """) save_conversation?: boolean; @doc("Allows tweaking any of the indicated settings, such as `barge_match_string`, using the returned SWML from the SWAIG function.") diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/main.tsp index 208ac38d..f995a0dd 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/main.tsp @@ -6,17 +6,17 @@ import "./swaig"; @summary("AI object") model AI { - @doc("Create a new AI agent.") @summary("ai") ai: { - @doc(""" - A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script - or from the SWML `set_global_data` action. This data can be referenced `globally`. - All contained information can be accessed and expanded within the prompt - for example, by using a template string. - """) - global_data?: {...TypeSpec.Record}; + A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script + or from the SWML `set_global_data` action. This data can be referenced `globally`. + All contained information can be accessed and expanded within the prompt - for example, by using a template string. + """) + global_data?: { + ...TypeSpec.Record; + }; @doc("An array of hints (as strings) to provide context to the dialogue.") @example(#["pizza", "pepperoni"]) @@ -44,4 +44,4 @@ model AI { @doc("An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue.") SWAIG?: SWAIG; }; -}; +} diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/contexts/steps.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/contexts/steps.tsp index 3dcd1d6b..8582f429 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/contexts/steps.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/contexts/steps.tsp @@ -2,57 +2,57 @@ model ContextStepsBase { @doc("The name of the step. The name must be unique within the context. The name is used for referencing the step in the context.") @example("Take Pizza order") - name: string, + name: string; @doc("The prompt or instructions given to the AI at this step.") @example("Your name is Franklin and you are taking orders for Franklin's Pizza.") - text: string, + text: string; @doc(""" - The conditions that must be met for the conversation to proceed to the next step. - If a condition is not met, the conversation will not proceed to the next step. - It's **highly** recommended you create a custom criteria for the step to get the intended behavior. - """) + The conditions that must be met for the conversation to proceed to the next step. + If a condition is not met, the conversation will not proceed to the next step. + It's **highly** recommended you create a custom criteria for the step to get the intended behavior. + """) @example("Customer wants to order Pizza") - step_criteria?: string, + step_criteria?: string; @doc("An array of SWAIG.functions that can be executed from this step.") @example(#["Take Order", "Confirm Order", "Confirm Address"]) - functions?: string[], + functions?: string[]; @doc("An array of valid contexts that the conversation can transition to from this step.") @example(#["Place Order", "Confirm Order"]) - valid_contexts?: string[], + valid_contexts?: string[]; @doc("A boolean value that, when true, will skip the user's turn to respond in the conversation and proceed to the next step.") - skip_user_turn?: boolean, + skip_user_turn?: boolean; } @summary("ContextStepsEnd object") model ContextStepsEnd is ContextStepsBase { @doc("A boolean value that, when true, will end the contexts conversation and transition to a normal interaction.") - end?: boolean, + end?: boolean; } @summary("ContextStepsValidSteps object") model ContextStepsValidSteps is ContextStepsBase { @doc(""" - An array of valid steps that the conversation can proceed to from this step. - If the array is empty, or the `valid_steps` key is not present, the conversation will proceed to the next step in the context. - """) + An array of valid steps that the conversation can proceed to from this step. + If the array is empty, or the `valid_steps` key is not present, the conversation will proceed to the next step in the context. + """) @example(#["get order", "confirm order"]) - valid_steps?: string[], + valid_steps?: string[]; } @summary("ContextSteps object") model ContextSteps { @summary("steps") @doc("An array of objects that define the steps in the context. These steps are used to define the flow of the conversation.") - steps: ContextStepsParams[] + steps: ContextStepsParams[]; } @summary("ContextStepsParams union") union ContextStepsParams { ContextStepsEnd, - ContextStepsValidSteps + ContextStepsValidSteps, } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/main.tsp index cabc2560..dd857651 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/prompt/main.tsp @@ -17,9 +17,9 @@ model AIPromptBase { top_p?: float; @doc(""" - Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. - Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. - """) + Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. + Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. + """) @minValue(0.0) @maxValue(1.0) confidence?: float; @@ -38,12 +38,12 @@ model AIPromptBase { @summary("prompt") model AIPrompt is AIPromptBase { @doc(""" - An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. - Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. - Additionally, more context steps can be defined as any other key in the object. - """) + An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. + Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. + Additionally, more context steps can be defined as any other key in the object. + """) contexts?: Contexts; } @summary("post_prompt") -model AIPostPrompt is AIPromptBase {} +model AIPostPrompt is AIPromptBase; diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/context_switch.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/context_switch.tsp index 1d451dcc..fee467b2 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/context_switch.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/context_switch.tsp @@ -10,10 +10,10 @@ model ContextSwitchAction { consolidate?: boolean; @doc(""" - A string serving as simulated user input for the AI Agent. - During a context_switch in the AI's prompt, the user_prompt offers the AI pre-established context or guidance. - Default is not set - """) + A string serving as simulated user input for the AI Agent. + During a context_switch in the AI's prompt, the user_prompt offers the AI pre-established context or guidance. + Default is not set + """) user_prompt?: string; - } + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/playback_bg.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/playback_bg.tsp index d69eeb6c..e6881a23 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/playback_bg.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/playback_bg.tsp @@ -1,5 +1,3 @@ - - @summary("PlaybackBGAction object") model PlaybackBGAction { @doc("A JSON object containing the audio file to play.") @@ -11,5 +9,5 @@ model PlaybackBGAction { @doc("Whether to wait for the audio file to finish playing before continuing. Default is `false`.") wait?: boolean; - }, + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/say.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/say.tsp index f735d355..1a7e40d0 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/say.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/say.tsp @@ -1,8 +1,7 @@ - @summary("SayAction object") model SayAction { @doc("A message to be spoken by the AI agent.") @summary("say") @example("Welcome to Franklin's Pizza.") - say: string, + say: string; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_global_data.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_global_data.tsp index 35b64119..b8700cbc 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_global_data.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_global_data.tsp @@ -1,8 +1,9 @@ - @summary("SetGlobalDataAction object") model SetGlobalDataAction { @doc("A JSON object containing any global data, as a key-value map. This action sets the data in the `global_data` to be globally referenced.") @summary("set_global_data") - @example(#{small_size: "8 Inch", large_size : "12 Inch", closed: "Monday"}) - set_global_data: {...TypeSpec.Record}, + @example(#{ small_size: "8 Inch", large_size: "12 Inch", closed: "Monday" }) + set_global_data: { + ...TypeSpec.Record; + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_meta_data.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_meta_data.tsp index e97eadeb..e4d95128 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_meta_data.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/set_meta_data.tsp @@ -2,6 +2,8 @@ model SetMetaDataAction { @summary("set_meta_data") @doc("A JSON object containing any metadata, as a key-value map. This action sets the data in the `meta_data` to be referenced locally in the function.") - @example(#{ extra_cheese: "Can't do", extra_large_pizza: "Only on Friday"}) - set_meta_data: {...TypeSpec.Record}, + @example(#{ extra_cheese: "Can't do", extra_large_pizza: "Only on Friday" }) + set_meta_data: { + ...TypeSpec.Record; + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop.tsp index 09a9d829..1fa6d67a 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop.tsp @@ -2,5 +2,5 @@ model StopAction { @summary("stop") @doc("Whether to stop the conversation.") - stop: boolean, + stop: boolean; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop_playback_bg.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop_playback_bg.tsp index 4059f268..5fb08dd8 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop_playback_bg.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/stop_playback_bg.tsp @@ -1,7 +1,6 @@ - @summary("StopPlaybackBGAction object") model StopPlaybackBGAction { @summary("stop_playback_bg") @doc("Whether to stop the background audio file.") - stop_playback_bg: boolean, + stop_playback_bg: boolean; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/toggle_functions.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/toggle_functions.tsp index 372b2c18..6241390c 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/toggle_functions.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/toggle_functions.tsp @@ -1,15 +1,13 @@ - @summary("ToggleFunctionsAction object") model ToggleFunctionsAction { @summary("toggle_functions") @doc("Whether to toggle the functions on or off.") toggle_functions: { - @doc("Whether to activate or deactivate the functions. Default is `true`") active: boolean; @doc("The function names to toggle.") @example("Discount") function: string | string[]; - }[], + }[]; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_global_data.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_global_data.tsp index 0a2630d5..9080a1e9 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_global_data.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_global_data.tsp @@ -3,5 +3,5 @@ model UnsetGlobalDataAction { @summary("unset_global_data") @doc("The key of the global data to unset from the `global_data`. You can also reset the `global_data` by passing in a new object.") @example("closed") - unset_global_data: string | {}, + unset_global_data: string | {}; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_meta_data.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_meta_data.tsp index 895e3098..3cae33d5 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_meta_data.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/unset_meta_data.tsp @@ -1,8 +1,7 @@ - @summary("UnsetMetaDataAction object") model UnsetMetaDataAction { @summary("unset_meta_data") @doc("The key of the local data to unset from the `meta_data`. You can also reset the `meta_data` by passing in a new object.") @example("extra_cheese") - unset_meta_data: string | {}, + unset_meta_data: string | {}; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/user_input.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/user_input.tsp index 4c60d242..039576b2 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/user_input.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/actions/user_input.tsp @@ -3,5 +3,5 @@ model UserInputAction { @summary("user_input") @doc("Used to inject text into the users queue as if they input the data themselves.") @example("I want a tasty Pizza.") - user_input: string, + user_input: string; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/expression.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/expression.tsp index 124e578c..7accd11d 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/expression.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/expression.tsp @@ -13,5 +13,5 @@ model Expression { pattern: string; ...Output; - }[] + }[]; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/main.tsp index 6b9a4d6a..eedf0f6d 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/main.tsp @@ -9,11 +9,11 @@ using TypeSpec.OpenAPI; @summary("DataMap union") union DataMap { @doc("An object that defines the output of the SWAIG function.") - Output; + Output, @doc("An array of objects that define patterns and corresponding actions.") - Expression; + Expression, @doc("An array of objects that define external API calls.") - Webhook; + Webhook, } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/output.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/output.tsp index cfd88674..5fb0a345 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/output.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/output.tsp @@ -11,5 +11,5 @@ model Output { @doc("A list of actions to be performed upon matching.") action?: Action[]; - } + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/webhook.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/webhook.tsp index 805cb14c..86884c47 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/webhook.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/data_map/webhook.tsp @@ -31,16 +31,18 @@ model Webhook { max?: integer; @doc(""" - The values to append to the output_key. - Properties from the object can be referenced and added to the output_key by using the following syntax: - \${this.property_name}. - The `this` keyword is used to reference the current object in the array. - """) + The values to append to the output_key. + Properties from the object can be referenced and added to the output_key by using the following syntax: + \${this.property_name}. + The `this` keyword is used to reference the current object in the array. + """) append: string; }; @doc("Any necessary headers for the API call.") - headers?: {...TypeSpec.Record}; + headers?: { + ...TypeSpec.Record; + }; @doc("The HTTP method (GET, POST, etc.) for the API call.") method?: "GET" | "POST" | "PUT" | "DELETE"; @@ -49,11 +51,13 @@ model Webhook { input_args_as_params?: boolean; @doc("An object of any necessary parameters for the API call. The key is the parameter name and the value is the parameter value.") - params?: {...TypeSpec.Record}; + params?: { + ...TypeSpec.Record; + }; @doc("A string or array of strings that represent the `arguments` that are required to make the webhook request.") require_args?: string | string[]; ...Output; - }[] -} \ No newline at end of file + }[]; +} diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/main.tsp index 0e10fec0..fedb5ed6 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/main.tsp @@ -19,20 +19,22 @@ model SWAIGFunction { active?: boolean; @doc(""" - A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. - This data can be referenced locally to the function. - All contained information can be accessed and expanded within the prompt - for example, by using a template string. - Default is not set. - """) - meta_data?: {...TypeSpec.Record}; + A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. + This data can be referenced locally to the function. + All contained information can be accessed and expanded within the prompt - for example, by using a template string. + Default is not set. + """) + meta_data?: { + ...TypeSpec.Record; + }; @doc("Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire.") meta_data_token?: string; @doc(""" - An object containing properties to process or validate the input, - perform actions based on the input, or connect to external APIs or services in a serverless fashion. - """) + An object containing properties to process or validate the input, + perform actions based on the input, or connect to external APIs or services in a serverless fashion. + """) data_map?: DataMap; @doc("Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.`") diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/parameters.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/parameters.tsp index 0290df1d..1b9138e5 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/parameters.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/functions/parameters.tsp @@ -3,16 +3,16 @@ import "../../../../../../types"; using TypeSpec.OpenAPI; enum StringFormat { - "date_time", - "time", - "date", - "duration", - "email", - "hostname", - "ipv4", - "ipv6", - "uri", - "uuid" + date_time, + time, + date, + duration, + email, + hostname, + ipv4, + ipv6, + uri, + uuid, } model FunctionParameters { @@ -20,20 +20,21 @@ model FunctionParameters { type: "object"; @doc(""" - An object containing the property definitions that are passed to the function. - - A property definition is a valid JSON schema type with dynamic property names, where: - - Keys: User-defined strings, that set the property names. - - Values: A valid property type, which can be one of the following: `string`, `integer`, `number`, `boolean`, `array`, `object`, or `null`. - """) - properties: {...TypeSpec.Record}; + An object containing the property definitions that are passed to the function. + + A property definition is a valid JSON schema type with dynamic property names, where: + - Keys: User-defined strings, that set the property names. + - Values: A valid property type, which can be one of the following: `string`, `integer`, `number`, `boolean`, `array`, `object`, or `null`. + """) + properties: { + ...TypeSpec.Record; + }; @doc("An array of required property names from the `properties` object.") @example(#["name1", "name2"]) required?: string[]; } - @summary("Function Parameters Type Union") @oneOf union SchemaType { @@ -47,10 +48,9 @@ union SchemaType { OneOfProperty, AllOfProperty, AnyOfProperty, - ConstProperty + ConstProperty, } - @doc("Base interface for all property types") model FunctionBaseProperty { @doc("A description of the property.") @@ -143,7 +143,6 @@ model AnyOfProperty { anyOf: SchemaType[]; } - @summary("Array Function Property") model ArrayProperty is FunctionBaseProperty { @doc("The type of parameter(s) the AI is passing to the function.") @@ -162,10 +161,14 @@ model ObjectProperty is FunctionBaseProperty { type: "object"; @doc("The default object value") - default?: {...TypeSpec.Record}; + default?: { + ...TypeSpec.Record; + }; @doc("Nested properties") - properties?: {...TypeSpec.Record}; + properties?: { + ...TypeSpec.Record; + }; @doc("Required property names") @example(#["name1", "name2"]) diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/includes.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/includes.tsp index 60a8bda1..3fbd317c 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/includes.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/includes.tsp @@ -9,5 +9,7 @@ model SWAIGIncludes { url: string; @doc("") - meta_data?: {...TypeSpec.Record}; + meta_data?: { + ...TypeSpec.Record; + }; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/main.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/main.tsp index 30174b85..7fbe5212 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/main.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/main.tsp @@ -12,14 +12,14 @@ model SWAIG { native_functions?: SWAIGNativeFunction[]; @doc(""" - An array of objects to include remote function signatures. - The object fields are url to specify where the remote functions are defined and functions which is an array of the function names as strings. - """) + An array of objects to include remote function signatures. + The object fields are url to specify where the remote functions are defined and functions which is an array of the function names as strings. + """) includes?: SWAIGIncludes[]; @doc(""" - An array of JSON objects to define functions that can be executed during the interaction with the AI. Default is not set. - The fields of this object are the six following. - """) + An array of JSON objects to define functions that can be executed during the interaction with the AI. Default is not set. + The fields of this object are the six following. + """) functions?: SWAIGFunction[]; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/native_functions.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/native_functions.tsp index 49ac8907..65fca79b 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/native_functions.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/ai/swaig/native_functions.tsp @@ -1,8 +1,8 @@ @summary("native_functions") enum SWAIGNativeFunction { @doc("Returns the current time for the time zone set in ai.local_tz.") - "check_time", + check_time, @doc("Waits for the given time") - "wait_seconds" + wait_seconds, } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/core.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/core.tsp index ea9088d4..9f58cf6a 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/core.tsp @@ -7,16 +7,18 @@ using TypeSpec.Http; model AIAgentPathID { @doc("Unique ID of an AI Agent.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid + id: uuid; } -model AIAgentID { +model AIAgent { @doc("Unique ID of an AI Agent.") - agent_id: uuid -} + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + agent_id: uuid; -model AIAgent { @doc("Name of the AI Agent.") @example("My AI Agent") name: string; @@ -43,8 +45,3 @@ model AIAgent { @doc("A JSON object to create user-defined functions/endpoints that can be executed during the dialogue.") SWAIG?: SWAIG; } - -model AIAgentWithID { - ...AIAgentID, - ...AIAgent -} diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/enums.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/enums.tsp index e7475bbe..604e6c7b 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/enums.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/enums.tsp @@ -1 +1 @@ -import "./../../enums.tsp"; +import "../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/errors.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/errors.tsp index 91fe4385..0949f5af 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/errors.tsp @@ -3,14 +3,16 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "missing_required_parameter", message: "Name can't be blank", attribute: "name", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter" - }], - }) - model AIAgentCreateStatusCode422 is StatusCode422; + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model AIAgentCreateStatusCode422 is StatusCode422; - model AIAgentUpdateStatusCode422 is AIAgentCreateStatusCode422; +model AIAgentUpdateStatusCode422 is AIAgentCreateStatusCode422; diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/requests.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/requests.tsp index 6104990c..1ade2c67 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/requests.tsp @@ -1,7 +1,7 @@ model AIAgentCreateRequest { - ...AIAgent + ...AIAgent; } model AIAgentUpdateRequest { - ...AIAgent + ...AIAgent; } diff --git a/specs/signalwire-rest/fabric-api/ai-agent/models/responses.tsp b/specs/signalwire-rest/fabric-api/ai-agent/models/responses.tsp index 2d47e8c0..e7a45271 100644 --- a/specs/signalwire-rest/fabric-api/ai-agent/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/ai-agent/models/responses.tsp @@ -1,10 +1,16 @@ +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; +import "../../_shared/fabric-address"; + model AIAgentResponse { @doc("Unique ID of the AIAgent.") @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + @format("uuid") id: uuid; @doc("Unique ID of the Project.") @example("99151cf8-9548-4860-ba70-a8de824f3312") + @format("uuid") project_id: uuid; @doc("Display name of the AIAgent Fabric Resource") @@ -12,36 +18,43 @@ model AIAgentResponse { display_name: string; @doc("Type of the Fabric Resource") - @example("external_laml_handler") - type: string; + @example(FabricResponseType.AiAgent) + type: FabricResponseType.AiAgent; @doc("Date and time when the resource was created.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) created_at: utcDateTime; @doc("Date and time when the resource was updated.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) updated_at: utcDateTime; @doc("AIAgent data.") - ai_agent: AIAgentWithID; + ai_agent: AIAgent; } model AIAgentListResponse { + @doc("An array of objects containing the list of AI Agent data.") data: AIAgentResponse[]; + + @doc("Object containing pagination links") links: AIAgentPaginationResponse; } model AIAgentPaginationResponse { @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&type=ai_agent") self: url; @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&type=ai_agent") first: url; @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; + @example("https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/call-flows/addresses/main.tsp b/specs/signalwire-rest/fabric-api/call-flows/addresses/main.tsp new file mode 100644 index 00000000..6e7fea22 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/call_flow/{id}/addresses") +namespace FabricAPI.CallFlow.Addresses { + @tag(CALL_FLOWS_TAG) + interface CallFlowAddresses { + @summary("List Call Flow Addresses") + @doc("This endpoint returns a list of addresses associated with a specific Call Flow.") + list(...CallFlowAddressPathID): + | CallFlowAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/call-flows/addresses/models/core.tsp new file mode 100644 index 00000000..b0f7caa0 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model CallFlowAddressPathID { + @doc("The unique identifier of the Call Flow.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/call-flows/addresses/models/responses.tsp new file mode 100644 index 00000000..916f7fd3 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/addresses/models/responses.tsp @@ -0,0 +1,31 @@ +import "../../addresses/models/core.tsp"; +import "../../../_shared/fabric-address"; +import "../../../../types"; + +using Types.StatusCodes; + +model CallFlowAddressListResponse { + @doc("An array of objects containing a list of Call Flow Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: CallFlowAddressPaginationResponse; +} + +model CallFlowAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=call_flow") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=call_flow") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=call_flow") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=call_flow") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/main.tsp b/specs/signalwire-rest/fabric-api/call-flows/main.tsp new file mode 100644 index 00000000..a7dc1dba --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/main.tsp @@ -0,0 +1,76 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "./versions"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/call_flows") +namespace FabricAPI.CallFlows { + @tag(CALL_FLOWS_TAG) + @friendlyName("Call Flows") + interface CallFlows { + @summary("List Call Flows") + @doc("A list of Call Flows") + list(): + | CallFlowListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get Call Flow") + @doc("Returns a Call Flow by ID") + read(...CallFlowPathID): + | { + @statusCode statusCode: 200; + @body call_flow: CallFlowResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create Call Flow") + @doc("Creates a Call Flow") + @post + create(@body request: CallFlowCreateRequest): + | { + @statusCode statusCode: 201; + @body call_flow: CallFlowResponse; + } + | StatusCode401 + | StatusCode404 + | CallFlowCreateStatusCode422 + | StatusCode500; + + @summary("Update Call Flow") + @doc("Updates a Call Flow by ID") + @put + update(...CallFlowPathID, @body request: CallFlowUpdateRequest): + | { + @statusCode statusCode: 200; + @body call_flow: CallFlowResponse; + } + | StatusCode401 + | StatusCode404 + | CallFlowUpdateStatusCode422 + | StatusCode500; + + @summary("Delete Call Flow") + @doc("Deletes a Call Flow by ID") + @delete + delete(...CallFlowPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/models/core.tsp b/specs/signalwire-rest/fabric-api/call-flows/models/core.tsp new file mode 100644 index 00000000..96a98c29 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/models/core.tsp @@ -0,0 +1,35 @@ +import "../../../types"; +import "../../_shared/const.tsp"; + +using TypeSpec.Http; + +model CallFlowPathID { + @doc("Unique ID of a Call Flow.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model CallFlow { + @doc("Unique ID of a Call Flow.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The name of the Call Flow") + @example("Booking Assistant") + title: string; + + @doc("Call flow data as JSON string") + @example("{}") + flow_data?: string; + + @doc("A SWML document. For more information on SWML, please go to https://developer.signalwire.com/swml") + @example(SWML_EXAMPLE) + relayml?: string; + + @doc("The current revision of the call flow. Every update must increase this number.") + @example(1) + document_version?: int32; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/models/errors.tsp b/specs/signalwire-rest/fabric-api/call-flows/models/errors.tsp new file mode 100644 index 00000000..e261cb5e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "title is required", + attribute: "title", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model CallFlowCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "document_version must be greater than current version", + attribute: "document_version", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model CallFlowUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/call-flows/models/requests.tsp b/specs/signalwire-rest/fabric-api/call-flows/models/requests.tsp new file mode 100644 index 00000000..61d00fbc --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/models/requests.tsp @@ -0,0 +1,17 @@ +import "./core.tsp"; + +model CallFlowCreateRequest { + @doc("The name of the Call Flow") + @example("Booking Assistant") + title: string; +} + +model CallFlowUpdateRequest { + @doc("The name of the Call Flow") + @example("Booking Assistant") + title?: string; + + @doc("The current revision of the call flow. Every update must increase this number.") + @example(1) + document_version?: int32; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/models/responses.tsp b/specs/signalwire-rest/fabric-api/call-flows/models/responses.tsp new file mode 100644 index 00000000..33e0611c --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/models/responses.tsp @@ -0,0 +1,78 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model CallFlowResponse { + @doc("Unique ID of the Call Flow.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the Call Flow Fabric Resource") + @example("Booking Assistant") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.CallFlow) + type: FabricResponseType.CallFlow; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("Call Flow data.") + call_flow: CallFlow; +} + +model CallFlowListResponse { + @doc("Object containing pagination links") + links: CallFlowAddressPaginationResponse; + + @doc("An array of objects containing the CallFlow listing response") + data: CallFlowResponse[]; +} + +model CallFlowVersionResponse { + @doc("Version number of the Call Flow") + @example(1) + version: int32; + + @doc("Date and time when the version was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Call Flow data structure") + @example("{}") + flow_data?: string; + + @doc("SWML document for this version") + @example(SWML_EXAMPLE) + relayml?: string; +} + +model CallFlowPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/call_flows?page_number=0&page_size=50&type=call_flow") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/call_flows?page_size=50&type=call_flow") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/call_flows?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/call_flows?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/versions/main.tsp b/specs/signalwire-rest/fabric-api/call-flows/versions/main.tsp new file mode 100644 index 00000000..28d13f8d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/versions/main.tsp @@ -0,0 +1,40 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/call_flow/{id}/versions") +namespace FabricAPI.CallFlow.Versions { + @tag(CALL_FLOWS_TAG) + interface CallFlowVersions { + @summary("List Call Flow Versions") + @doc("Returns a list of versions of a Call Flow.") + list(...CallFlowVersionPathID): + | CallFlowVersionListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Deploy a Call Flow Version") + @doc("Deploys a specific version of a Call Flow.") + @post + deploy( + ...CallFlowVersionPathID, + @body request: CallFlowVersionDeployRequest, + ): + | { + @statusCode statusCode: 201; + @body response: CallFlowVersionDeployResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode422 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/versions/models/core.tsp b/specs/signalwire-rest/fabric-api/call-flows/versions/models/core.tsp new file mode 100644 index 00000000..ecb46ca6 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/versions/models/core.tsp @@ -0,0 +1,10 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model CallFlowVersionPathID { + @doc("The unique identifier of the Call Flow.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/versions/models/requests.tsp b/specs/signalwire-rest/fabric-api/call-flows/versions/models/requests.tsp new file mode 100644 index 00000000..fe8465fd --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/versions/models/requests.tsp @@ -0,0 +1,25 @@ +import "@typespec/http"; +import "@typespec/openapi3"; + +using TypeSpec.OpenAPI; + +@oneOf +union CallFlowVersionDeployRequest { + CallFlowVersionDeployByDocumentVersion, + CallFlowVersionDeployByVersionId, +} + +@summary("Deploy by document version") +model CallFlowVersionDeployByDocumentVersion { + @doc("The current revision of the call flow.") + @example(2) + document_version: int32; +} + +@summary("Deploy by version ID") +model CallFlowVersionDeployByVersionId { + @doc("Any call flow version ID for this call flow.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + call_flow_version_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/call-flows/versions/models/responses.tsp b/specs/signalwire-rest/fabric-api/call-flows/versions/models/responses.tsp new file mode 100644 index 00000000..c57d2d28 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/call-flows/versions/models/responses.tsp @@ -0,0 +1,81 @@ +import "../../../../types"; +import "../../../_shared/const.tsp"; + +model CallFlowVersion { + @doc("The unique identifier of the version.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The version number.") + @example("1.0.0") + version: string; + + @doc("The creation timestamp.") + @example("2023-01-01T12:00:00Z") + created_at: string; + + @doc("The last update timestamp.") + @example("2023-01-01T12:00:00Z") + updated_at: string; + + @doc("Call Flow data structure") + @example("{}") + flow_data?: string; + + @doc("SWML document for this version") + @example("{}") + relayml?: string; +} + +model CallFlowVersionListResponse { + @doc("List of Call Flow Versions") + data: CallFlowVersion[]; + + links: CallFlowVersionsPaginationResponse; +} + +model CallFlowVersionDeployResponse { + @doc("The unique identifier of the deployed Call Flow Version.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("The creation timestamp.") + @example("2024-01-02T00:00:00Z") + created_at: string; + + @doc("The last update timestamp.") + @example("2024-01-02T00:00:00Z") + updated_at: string; + + @doc("The document version.") + @example(2) + document_version: int32; + + @doc("Call Flow data structure") + @example("{}") + flow_data?: string; + + @doc("SWML document for this version") + @example(SWML_EXAMPLE) + relayml?: string; +} + +model CallFlowVersionsPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&type=call_flow") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&type=call_flow") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/call_flows/versions?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow") + next: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/addresses/main.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/main.tsp new file mode 100644 index 00000000..bcfac192 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/conference_room/{id}/addresses") +namespace FabricAPI.ConferenceRoom.Addresses { + @tag(CONFERENCE_ROOM_TAG) + interface ConferenceRoomAddresses { + @summary("List Conference Room Addresses") + @doc("This endpoint returns a list of addresses associated with a specific Conference Room.") + list(...ConferenceRoomAddressPathID): + | ConferenceRoomAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/core.tsp new file mode 100644 index 00000000..b852f4bd --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model ConferenceRoomAddressPathID { + @doc("The unique identifier of the Conference Room.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/responses.tsp new file mode 100644 index 00000000..3713f129 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../addresses/models/core.tsp"; +import "../../../_shared/fabric-address"; +import "../../../../types"; + +model ConferenceRoomAddressListResponse { + @doc("An array of objects containing list of Conference Room Addresses") + data: FabricAddressRoom[]; + + @doc("Object containing pagination links") + links: ConferenceRoomAddressPaginationResponse; +} + +model ConferenceRoomAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=conference_room") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=conference_room") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=conference_room") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=conference_room") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/main.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/main.tsp new file mode 100644 index 00000000..96db39be --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/main.tsp @@ -0,0 +1,78 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/conference_rooms") +namespace FabricAPI.ConferenceRooms { + @tag(CONFERENCE_ROOM_TAG) + @friendlyName("Conference Rooms") + interface ConferenceRooms { + @summary("List Conference Rooms") + @doc("Returns a list of conference rooms.") + list(): + | ConferenceRoomListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get Conference Room") + @doc("Returns a Conference Room by ID") + read(...ConferenceRoomPathID): + | { + @statusCode statusCode: 200; + @body conference_room: ConferenceRoomResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create Conference Room") + @doc("Creates a Conference Room") + @post + create(@body request: ConferenceRoomCreateRequest): + | { + @statusCode statusCode: 200; + @body conference_room: ConferenceRoomResponse; + } + | StatusCode401 + | StatusCode404 + | ConferenceRoomCreateStatusCode422 + | StatusCode500; + + @summary("Update Conference Room") + @doc("Updates a Conference Room by ID") + @put + update( + ...ConferenceRoomPathID, + @body request: ConferenceRoomUpdateRequest, + ): + | { + @statusCode statusCode: 200; + @body conference_room: ConferenceRoomResponse; + } + | StatusCode401 + | StatusCode404 + | ConferenceRoomUpdateStatusCode422 + | StatusCode500; + + @summary("Delete Conference Room") + @doc("Deletes a Conference Room by ID") + @delete + delete(...ConferenceRoomPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/models/core.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/models/core.tsp new file mode 100644 index 00000000..7eb4f5e1 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/models/core.tsp @@ -0,0 +1,101 @@ +import "../../../types"; + +using TypeSpec.Http; + +model ConferenceRoomPathID { + @doc("Unique ID of a Conference Room.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model ConferenceRoom { + @doc("The unique id of the Conference Room") + @example("1bd571e4-5ea4-4a70-a3c8-2bab5d20e754") + @format("uuid") + id: uuid; + + @doc("The name of the Conference Room") + @example("coffee_cafe") + name: string; + + @doc("The descrption of the Conference Room") + @example("This room is for coffee, no shop talk") + @maxLength(3000) + description: string; + + @doc("Display name of the Conference Room") + @example("Reception") + @maxLength(200) + display_name: string; + + @doc("Maximum number of members allowed in the conference room") + @example(30) + @minValue(0) + @maxValue(300) + max_members: int32; + + @doc("The viudeo quality of the Conference Room.") + @example("1080p") + quality: "1080p" | "720p" = "720p"; + + @doc("The frames-per-second (fps) of the participants videos in the conference.") + @example(30) + fps: 30 | 20; + + @doc("The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_from: utcDateTime | null; + + @doc("The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_until: utcDateTime | null; + + @doc("The time to remove all participants from the conference.") + @example(UTC_TIME_EXAMPLE) + remove_at: utcDateTime | null; + + @doc("The amount of time in seconds to remove a particpant from a conference after they join.") + @minValue(0) + @maxValue(200000) + remove_after_seconds_elapsed: int32 | null; + + @doc("The video layout of the conference.") + @example(Layout.Layout_Grid_Reponsive) + layout: Layout; + + @doc("Starts recording when the conference starts.") + @example(true) + record_on_start: boolean; + + @doc("Plays a tone when a participant joins or leaves the conference.") + @example(true) + tone_on_entry_and_exit: boolean; + + @doc("Turns the conference video off when the participant joins the room if `true`.") + @example(true) + room_join_video_off: boolean; + + @doc("Turns the participants video off when the participant joins the room if `true`.") + @example(true) + user_join_video_off: boolean; + + @doc("Enables live video room previews for the conference.") + @example(true) + enable_room_previews: boolean; + + @doc("Syncs the participants audio and video.") + @example(true) + sync_audio_video: boolean | null; + + @doc("Metadata of the conference.") + @example(#{ foo: "bar" }) + meta: { + ...Record; + }; + + @doc("Indicator if the Conference Room will prioritize showing participants utilizing the hand raised feature.") + @example(false) + prioritize_handraise: boolean; +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/models/enums.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/models/enums.tsp new file mode 100644 index 00000000..03e62e97 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/models/enums.tsp @@ -0,0 +1,15 @@ +enum Layout { + Layout_Grid_Reponsive: "grid-responsive", + Layout_Grid_Responsive_Mobile: "grid-responsive-mobile", + Layout_Highlight_1_responsive: "highlight-1-responsive", + Layout_1_X_1: "1x1", + Layout_2_X_1: "2x1", + Layout_2_X_2: "2x2", + Layout_5_Up: "5up", + Layout_3_X_3: "3x3", + Layout_4_X_4: "4x4", + Layout_5_X_5: "5x5", + Layout_6_X_6: "6x6", + Layout_8_X_8: "8x8", + Layout_10_X_10: "10x10", +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/models/errors.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/models/errors.tsp new file mode 100644 index 00000000..7dec21e3 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "display_name is required", + attribute: "display_name", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model ConferenceRoomCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "max_members must be greater than 0", + attribute: "max_members", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model ConferenceRoomUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/models/requests.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/models/requests.tsp new file mode 100644 index 00000000..5b377453 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/models/requests.tsp @@ -0,0 +1,156 @@ +import "./core.tsp"; +import "./enums.tsp"; + +model ConferenceRoomCreateRequest { + @doc("The name of the Conference Room") + @example("coffee_cafe") + name: string; + + @doc("Display name of the Conference Room") + @example("Reception") + @maxLength(200) + display_name?: string; + + @doc("The descrption of the Conference Room") + @example("This room is for coffee, no shop talk") + @maxLength(3000) + description?: string; + + @doc("The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_from?: utcDateTime; + + @doc("The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_until?: utcDateTime; + + @doc("Maximum number of members allowed in the conference room") + @example(30) + @minValue(0) + @maxValue(300) + max_members?: int32; + + @doc("The viudeo quality of the Conference Room.") + @example("1080p") + quality?: "1080p" | "720p" = "720p"; + + @doc("The time to remove all participants from the conference.") + @example(UTC_TIME_EXAMPLE) + remove_at?: utcDateTime; + + @doc("The amount of time in seconds to remove a particpant from a conference after they join.") + @minValue(0) + @maxValue(200000) + remove_after_seconds_elapsed?: int32; + + @doc("The video layout of the conference.") + @example(Layout.Layout_Grid_Reponsive) + layout?: Layout; + + @doc("Starts recording when the conference starts.") + @example(true) + record_on_start?: boolean; + + @doc("Enables live video room previews for the conference.") + @example(true) + enable_room_previews: boolean; + + @doc("Metadata of the conference.") + @example(#{ foo: "bar" }) + meta?: { + ...Record; + }; + + @doc("Syncs the participants audio and video.") + @example(true) + sync_audio_video?: boolean; + + @doc("Plays a tone when a participant joins or leaves the conference.") + @example(true) + tone_on_entry_and_exit?: boolean; + + @doc("Turns the conference video off when the participant joins the room if `true`.") + @example(true) + room_join_video_off?: boolean; + + @doc("Turns the participants video off when the participant joins the room if `true`.") + @example(true) + user_join_video_off?: boolean; +} + +model ConferenceRoomUpdateRequest { + @doc("The name of the Conference Room") + @example("coffee_cafe") + name?: string; + + @doc("Display name of the Conference Room") + @example("Reception") + @maxLength(200) + display_name?: string; + + @doc("The descrption of the Conference Room") + @example("This room is for coffee, no shop talk") + @maxLength(3000) + description?: string; + + @doc("The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_from?: utcDateTime; + + @doc("The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference.") + @example(UTC_TIME_EXAMPLE) + join_until?: utcDateTime; + + @doc("Maximum number of members allowed in the conference room") + @example(30) + @minValue(0) + @maxValue(300) + max_members?: int32; + + @doc("The viudeo quality of the Conference Room.") + @example("1080p") + quality?: "1080p" | "720p" = "720p"; + + @doc("The time to remove all participants from the conference.") + @example(UTC_TIME_EXAMPLE) + remove_at?: utcDateTime; + + @doc("The amount of time in seconds to remove a particpant from a conference after they join.") + @minValue(0) + @maxValue(200000) + remove_after_seconds_elapsed?: int32; + + @doc("The video layout of the conference.") + @example(Layout.Layout_Grid_Responsive_Mobile) + layout?: Layout = Layout.Layout_Grid_Reponsive; + + @doc("Starts recording when the conference starts.") + @example(true) + record_on_start?: boolean; + + @doc("Enables live video room previews for the conference.") + @example(true) + enable_room_previews: boolean; + + @doc("Metadata of the conference.") + @example(#{ foo: "bar" }) + meta?: { + ...Record; + }; + + @doc("Syncs the participants audio and video.") + @example(true) + sync_audio_video: boolean; + + @doc("Plays a tone when a participant joins or leaves the conference.") + @example(true) + tone_on_entry_and_exit?: boolean; + + @doc("Turns the conference video off when the participant joins the room if `true`.") + @example(true) + room_join_video_off?: boolean; + + @doc("Turns the participants video off when the participant joins the room if `true`.") + @example(true) + user_join_video_off?: boolean; +} diff --git a/specs/signalwire-rest/fabric-api/conference-rooms/models/responses.tsp b/specs/signalwire-rest/fabric-api/conference-rooms/models/responses.tsp new file mode 100644 index 00000000..c34bce7e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/conference-rooms/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model ConferenceRoomListResponse { + @doc("Object containing pagination links") + links: ConferenceRoomAddressPaginationResponse; + + @doc("An array of objects containing the Conference Room data") + data: ConferenceRoomResponse[]; +} + +model ConferenceRoomResponse { + @doc("Unique ID of the Conference Room.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the Conference Room Fabric Resource") + @example("Reception") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.ConferenceRoom) + type: FabricResponseType.ConferenceRoom; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("Conference Room data.") + conference_room: ConferenceRoom; +} + +model ConferenceRoomPagainationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/conference_rooms?page_number=0&page_size=50&type=conference_room") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/conference_rooms?page_size=50&type=conference_room") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/conference_rooms?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=conference_room") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/conference_rooms?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=conference_room") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/addresses/main.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/main.tsp new file mode 100644 index 00000000..ff642275 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_applications/{id}/addresses") +namespace FabricAPI.CxmlApplication.Addresses { + @tag(CXML_APPLICATIONS_TAG) + interface CxmlApplicationAddresses { + @summary("List cXML Application Addresses") + @doc("This endpoint returns a list of addresses associated with a specific LaML Application.") + list(...CxmlApplicationAddressPathID): + | CxmlApplicationAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/core.tsp new file mode 100644 index 00000000..df916af2 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model CxmlApplicationAddressPathID { + @doc("The unique identifier of the cXML Application.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/responses.tsp new file mode 100644 index 00000000..b0267897 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model CxmlApplicationAddressListResponse { + @doc("An array of objects that contain a list of Cxml Application Addresses") + data: FabricAddress[]; + + @doc("Object containing pagination links") + links: CxmlApplicationAddressPaginationResponse; +} + +model CxmlApplicationAddressPaginationResponse { + @doc("Self link for the current page") + @example("https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_application") + self: string; + + @doc("Link to the first page of results") + @example("https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_application") + first: string; + + @doc("Link to the next page of results") + @example("https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application") + next?: string; + + @doc("Link to the previous page of results") + @example("https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application") + prev?: string; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/main.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/main.tsp new file mode 100644 index 00000000..a78a7f2b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/main.tsp @@ -0,0 +1,65 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_applications") +namespace FabricAPI.CxmlApplications { + @tag(CXML_APPLICATIONS_TAG) + @friendlyName("cXML Applications") + interface CxmlApplications { + @summary("List cXML Applications") + @doc("A list of cXML Applications") + list(): + | CxmlApplicationListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get cXML Application") + @doc("Returns a cXML Application by ID") + read(...CxmlApplicationPathID): + | { + @statusCode statusCode: 200; + @body laml_application: CxmlApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Update cXML Application") + @doc("Updates a cXML Application by ID") + @put + update( + ...CxmlApplicationPathID, + @body request: CxmlApplicationUpdateRequest, + ): + | { + @statusCode statusCode: 200; + @body laml_application: CxmlApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | CxmlApplicationUpdateStatusCode422 + | StatusCode500; + + @summary("Delete LAML Application") + @doc("Deletes a LAML Application by ID") + @delete + delete(...CxmlApplicationPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/models/core.tsp new file mode 100644 index 00000000..f033410a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/models/core.tsp @@ -0,0 +1,77 @@ +import "../../../types"; +import "../../_shared/enums.tsp"; + +using TypeSpec.Http; + +model CxmlApplicationPathID { + @doc("Unique ID of a cXML Application.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model CxmlApplication { + + @doc("Unique ID of the cXML Application.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + id: uuid; + + @doc("Project ID for the cXML Application") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + project_id: uuid; + + + @doc("Display name of the cXML Application") + @example("Reception App") + friendly_name: string; + + @doc("URL to handle incoming calls") + @example("https://example.com/voice/incoming") + voice_url: string | null; + + @doc("HTTP method for voice URL") + @example(UrlMethodType.Get) + voice_method: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for voice errors") + @example("https://example.com/voice/fallback") + voice_fallback_url: string | null; + + @doc("HTTP method for voice fallback URL") + @example(UrlMethodType.Get) + voice_fallback_method: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive status callbacks") + @example("https://example.com/voice/status") + status_callback: url | null; + + @doc("HTTP method for status callbacks") + @example(UrlMethodType.Get) + status_callback_method: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to handle incoming messages") + @example("https://example.com/message/incoming") + sms_url: string | null; + + @doc("HTTP method for SMS URL") + @example(UrlMethodType.Get) + sms_method: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for SMS errors") + @example("https://example.com/message/fallback") + sms_fallback_url: string | null; + + @doc("HTTP method for SMS fallback URL") + @example(UrlMethodType.Get) + sms_fallback_method: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive SMS status callbacks") + @example("https://example.com/message/status") + sms_status_callback: string | null; + + @doc("HTTP method for SMS status callbacks") + @example(UrlMethodType.Get) + sms_status_callback_method: UrlMethodType.Get | UrlMethodType.Post; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/models/errors.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/models/errors.tsp new file mode 100644 index 00000000..40584e9b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "display_name is required", + attribute: "display_name", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model CxmlApplicationCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "voice_url must be a valid URL", + attribute: "voice_url", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model CxmlApplicationUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/models/requests.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/models/requests.tsp new file mode 100644 index 00000000..04047478 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/models/requests.tsp @@ -0,0 +1,119 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; + +model CxmlApplicationCreateRequest { + @doc("Display name of the cXML Application") + @example("Reception App") + display_name: string; + + @doc("Project ID for the cXML Application") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + project_id?: uuid; + + @doc("URL to handle incoming calls") + @example("https://example.com/voice/incoming") + voice_url?: string; + + @doc("HTTP method for voice URL") + @example(UrlMethodType.Post) + voice_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for voice errors") + @example("https://example.com/voice/fallback") + voice_fallback_url?: string; + + @doc("HTTP method for voice fallback URL") + @example(UrlMethodType.Post) + voice_fallback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive status callbacks") + @example("https://example.com/voice/status") + status_callback?: string; + + @doc("HTTP method for status callbacks") + @example(UrlMethodType.Post) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to handle incoming messages") + @example("https://example.com/message/incoming") + sms_url?: string; + + @doc("HTTP method for SMS URL") + @example(UrlMethodType.Post) + sms_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for SMS errors") + @example("https://example.com/message/fallback") + sms_fallback_url?: string; + + @doc("HTTP method for SMS fallback URL") + @example(UrlMethodType.Post) + sms_fallback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive SMS status callbacks") + @example("https://example.com/message/status") + sms_status_callback?: string; + + @doc("HTTP method for SMS status callbacks") + @example(UrlMethodType.Post) + sms_status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; +} + +model CxmlApplicationUpdateRequest { + @doc("Display name of the cXML Application") + @example("Reception App") + display_name?: string; + + @doc("Project ID for the cXML Application") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + account_sid?: uuid; + + @doc("URL to handle incoming calls") + @example("https://example.com/voice/incoming") + voice_url?: string; + + @doc("HTTP method for voice URL") + @example(UrlMethodType.Post) + voice_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for voice errors") + @example("https://example.com/voice/fallback") + voice_fallback_url?: string; + + @doc("HTTP method for voice fallback URL") + @example(UrlMethodType.Post) + voice_fallback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive status callbacks") + @example("https://example.com/voice/status") + status_callback?: string; + + @doc("HTTP method for status callbacks") + @example(UrlMethodType.Post) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to handle incoming messages") + @example("https://example.com/message/incoming") + sms_url?: string; + + @doc("HTTP method for SMS URL") + @example(UrlMethodType.Post) + sms_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("Fallback URL for SMS errors") + @example("https://example.com/message/fallback") + sms_fallback_url?: string; + + @doc("HTTP method for SMS fallback URL") + @example(UrlMethodType.Post) + sms_fallback_method?: UrlMethodType.Get | UrlMethodType.Post; + + @doc("URL to receive SMS status callbacks") + @example("https://example.com/message/status") + sms_status_callback?: string; + + @doc("HTTP method for SMS status callbacks") + @example(UrlMethodType.Post) + sms_status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-applications/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-applications/models/responses.tsp new file mode 100644 index 00000000..501c4f1b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-applications/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model CxmlApplicationResponse { + @doc("Unique ID of the cXML Application.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the cXML Application Fabric Resource") + @example("Reception App") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.CxmlApplication) + type: FabricResponseType.CxmlApplication; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("cXML Application data.") + cxml_application: CxmlApplication; +} + +model CxmlApplicationListResponse { + @doc("An array of objects containing the list of cXML Application(s) data.") + data: CxmlApplicationResponse[]; + + @doc("Object containing pagination links") + links: CxmlApplicationPaginationResponse; +} + +model CxmlApplicationPaginationResponse { + @doc("Linmk to the current page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=0&page_size=50&type=cxml_application") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_applications?page_size=50&type=cxml_application") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/main.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/main.tsp new file mode 100644 index 00000000..fdfec781 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_scripts/{id}/addresses") +namespace FabricAPI.CXMLScript.Addresses { + @tag(CXML_SCRIPTS_TAG) + interface CXMLScriptAddresses { + @summary("List cXML Script Addresses") + @doc("This endpoint returns a list of addresses associated with a specific cXML Script.") + list(...CXMLScriptAddressPathID): + | CXMLScriptAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/core.tsp new file mode 100644 index 00000000..cddec115 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model CXMLScriptAddressPathID { + @doc("The unique identifier of the cXML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/responses.tsp new file mode 100644 index 00000000..8e25b3c4 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address/models/core.tsp"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model CXMLScriptAddressListResponse { + @doc("An array of objects that contain a list of cXML Script Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: CXMLScriptAddressPaginationResponse; +} + +model CXMLScriptAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&type=cxml_script") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_size=50&type=cxml_script") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=1&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/main.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/main.tsp new file mode 100644 index 00000000..4c8ba64a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/main.tsp @@ -0,0 +1,76 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_scripts") +namespace FabricAPI.CXMLScripts { + @tag(CXML_SCRIPTS_TAG) + @friendlyName("CXML Scripts") + @summary("CXML Scripts") + interface CXMLScripts { + @summary("List cXML Scripts") + @doc("A list of cXML Scripts") + list(): + | CXMLScriptListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get cXML Script") + @doc("Returns a cXML Script by ID") + read(...CXMLScriptPathID): + | { + @statusCode statusCode: 200; + @body cxml_script: CXMLScriptResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create cXML Script") + @doc("Creates a cXML Script") + @post + create(@body request: CXMLScriptCreateRequest): + | { + @statusCode statusCode: 200; + @body cxml_script: CXMLScriptResponse; + } + | StatusCode401 + | StatusCode404 + | CXMLScriptCreateStatusCode422 + | StatusCode500; + + @summary("Update cXML Script") + @doc("Updates a cXML Script by ID") + @put + update(...CXMLScriptPathID, @body request: CXMLScriptUpdateRequest): + | { + @statusCode statusCode: 200; + @body cxml_script: CXMLScriptResponse; + } + | StatusCode401 + | StatusCode404 + | CXMLScriptUpdateStatusCode422 + | StatusCode500; + + @summary("Delete cXML Script") + @doc("Deletes a cXML Script by ID") + @delete + delete(...CXMLScriptPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/models/core.tsp new file mode 100644 index 00000000..5b77010c --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/models/core.tsp @@ -0,0 +1,50 @@ +import "../../../types"; + +using TypeSpec.Http; + +model CXMLScriptPathID { + @doc("Unique ID of a cXML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model CXMLScript { + @doc("Unique ID of a cXML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The cXML script contents") + @example("Hello World") + contents: string; + + @doc("The amout of times the cXML script has been requested") + @example(5) + request_count: int32; + + @doc("The date and time when the cXML script was last accessed") + @example(utcDateTime.fromISO("2023-10-01T12:00:00Z")) + last_accessed_at: utcDateTime | null; + + @doc("The URL where the cXML script can be accessed") + @example("https://example.signalwire.com/laml-bins/2537c89e-2606-48c2-b3c2-bb601d863d1e") + request_url: url; + + @doc("The script type the cXML Script is used for") + @example("calling") + script_type: "calling" | "messaging"; + + @doc("Display name of the cXML Script Fabric Resource") + @example("Booking Assistant Script") + display_name: string; + + @doc("The url that will send status updates for the cXML Script") + @example("https://example.com/cxml/status") + status_callback_url?: url | null; + + @doc("HTTP method for status callback URL") + @example(UrlMethodType.Post) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/models/errors.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/models/errors.tsp new file mode 100644 index 00000000..4ea8d6f1 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "contents is required", + attribute: "contents", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model CXMLScriptCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "contents must be valid cXML", + attribute: "contents", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model CXMLScriptUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/models/requests.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/models/requests.tsp new file mode 100644 index 00000000..2a385917 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/models/requests.tsp @@ -0,0 +1,41 @@ +import "./core.tsp"; +import "../../_shared/const.tsp"; +import "../../_shared/enums.tsp"; + +model CXMLScriptCreateRequest { + @doc("Display name of the cXML Script") + @example("Reception Script") + display_name: string; + + @doc("The cXML script contents") + @example(CXML_EXAMPLE) + contents: string; + + @doc("URL to send status callbacks to") + @example("https://example.com/status") + @format("uri") + status_callback_url?: url; + + @doc("HTTP method to use for status callbacks") + @example(UrlMethodType.Get) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; +} + +model CXMLScriptUpdateRequest { + @doc("Display name of the cXML Script") + @example("Reception Script") + display_name?: string; + + @doc("The cXML script contents") + @example(CXML_EXAMPLE) + contents?: string; + + @doc("URL to send status callbacks to") + @example("https://example.com/status") + @format("uri") + status_callback_url?: url; + + @doc("HTTP method to use for status callbacks") + @example(UrlMethodType.Get) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-scripts/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-scripts/models/responses.tsp new file mode 100644 index 00000000..48e12859 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-scripts/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model CXMLScriptResponse { + @doc("Unique ID of the cXML Script.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the cXML Script Fabric Resource") + @example("Reception Script") + name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.CxmlScript) + type: FabricResponseType.CxmlScript; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("cXML Script data.") + cxml_script: CXMLScript; +} + +model CXMLScriptListResponse { + @doc("An array of objects containing a list of cXML Script data") + data: CXMLScriptResponse[]; + + @doc("Object containing pagination links") + links: CXMLScriptAddressPaginationResponse; +} + +model CXMLScriptPaginationResponse { + @doc("Link to the current page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&type=cxml_script") + self: url; + + @doc("Link to the first page") + @example("https://devspace.signalwire.com/api/fabric/resources/cxml_scripts?page_size=50&type=cxml_script") + first: url; + + @doc("Link to the next page") + @example("https://devspace.signalwire.com/api/fabric/resources/cxml_scripts?page_number=1&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script") + next?: url; + + @doc("Link to the previous page") + @example("https://devspace.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/core.tsp deleted file mode 100644 index dd6f4258..00000000 --- a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/core.tsp +++ /dev/null @@ -1,45 +0,0 @@ -import "@typespec/openapi3"; -import "./enums.tsp"; -import "../../../types"; - -using TypeSpec.Http; -using TypeSpec.OpenAPI; - -model CXMLWebhookIDPath { - @doc("Unique ID of a CXML Webhook.") - @path - cxml_webhook_id: uuid -} - -model CXMLWebhookAddress { - @doc("Unique ID of the Fabric Address.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - id: uuid; - - @doc("Fabric resource ID that the Fabric Address belongs to.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - resource_id: uuid; - - @doc("Name of the Fabric Address.") - @example("justice-league") - name: string; - - @doc("Display name of the Fabric Address.") - @example("Justice League") - display_name: string; - - @doc("Type of the Fabric Address.") - @example(DisplayTypes.App) - type: DisplayTypes; - - @doc("Cover url of the Fabric Address.") - @example("https://coverurl.com") - cover_url: string; - - @doc("Preview url of the Fabric Address.") - @example("https://previewurl.com") - preview_url: string; - - @doc("Channels of the Fabric Address.") - channel: AddressChannel; -} diff --git a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/enums.tsp deleted file mode 100644 index e7475bbe..00000000 --- a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/enums.tsp +++ /dev/null @@ -1 +0,0 @@ -import "./../../enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/responses.tsp deleted file mode 100644 index 5bae2200..00000000 --- a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/models/responses.tsp +++ /dev/null @@ -1,18 +0,0 @@ -model CXMLWebhookAddressListResponse { - data: CXMLWebhookAddress[]; - links: CXMLWebhookAddressPaginationResponse; -} - -model CXMLWebhookAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} diff --git a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/main.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/main.tsp similarity index 53% rename from specs/signalwire-rest/fabric-api/cxml-webhook-addresses/main.tsp rename to specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/main.tsp index 7f93c250..fd8e4ed5 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhook-addresses/main.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/main.tsp @@ -2,22 +2,23 @@ import "@typespec/http"; import "@typespec/openapi"; import "./models/core.tsp"; import "./models/responses.tsp"; -import "../../types"; +import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/cxml_webhooks/{cxml_webhook_id}/addresses") -namespace FabricAPI.CXMLWebhookAddresses { - @tag("cXML Webhook") +namespace FabricAPI.CXMLWebhook.Addresses { + @tag(CXML_WEBHOOK_TAG) @friendlyName("cXML Webhooks") interface CXMLWebhookAddresses { @summary("List cXML Webhook Addresses") - @doc("A list of cXML Webhook Addresses") + @doc("This endpoint returns a list of addresses associated with a specific cXML Webhook.") list(...CXMLWebhookIDPath): - CXMLWebhookAddressListResponse | - StatusCode401 | - StatusCode404; + | CXMLWebhookAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; } } - diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/core.tsp new file mode 100644 index 00000000..ea5197e5 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/core.tsp @@ -0,0 +1,14 @@ +import "@typespec/openapi3"; +import "./enums.tsp"; +import "../../../../types"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +model CXMLWebhookIDPath { + @doc("Unique ID of a CXML Webhook.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + cxml_webhook_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/enums.tsp new file mode 100644 index 00000000..36ac661a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/enums.tsp @@ -0,0 +1 @@ +import "../../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/responses.tsp new file mode 100644 index 00000000..67899063 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/addresses/models/responses.tsp @@ -0,0 +1,24 @@ +import "../../../_shared/fabric-address"; + +model CXMLWebhookAddressListResponse { + data: FabricAddressApp[]; + links: CXMLWebhookAddressPaginationResponse; +} + +model CXMLWebhookAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_webhook") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_webhook") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook") + next: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/main.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/main.tsp index 7ff5acd5..b8d63ae1 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/main.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/main.tsp @@ -4,55 +4,72 @@ import "./models/core.tsp"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "./addresses"; import "../../types"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/cxml_webhooks") namespace FabricAPI.CXMLWebhooks { - @tag("cXML Webhook") + @tag(CXML_WEBHOOK_TAG) @friendlyName("cXML Webhooks") interface CXMLWebhooks { @summary("List cXML Webhooks") @doc("A list of cXML Webhooks") list(): - CXMLWebhookListResponse | - StatusCode401 | - StatusCode404; + | CXMLWebhookListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Get cXML Webhook") @doc("Returns an cXML Webhook by ID") - read(...CXMLWebhookID): { - @statusCode statusCode: 200; - @body cxml_webhook: CXMLWebhookResponse; - } | - StatusCode401 | - StatusCode404; + read(...CXMLWebhookID): + | { + @statusCode statusCode: 200; + @body cxml_webhook: CXMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Create cXML Webhook") @doc("Creates an cXML Webhook") - @post create(...CXMLWebhookCreateRequest): - { @statusCode statusCode: 201; @body cxml_webhook: CXMLWebhookResponse; } | - StatusCode401 | - StatusCode404 | - CXMLWebhookCreateStatusCode422; + @post + create(...CXMLWebhookCreateRequest): + | { + @statusCode statusCode: 201; + @body cxml_webhook: CXMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | CXMLWebhookCreateStatusCode422 + | StatusCode500; @summary("Update cXML Webhook") @doc("Updates an cXML Webhook by ID") - @patch(#{ implicitOptionality: true }) update(...CXMLWebhookID, ...CXMLWebhookUpdateRequest): { - @statusCode statusCode: 200; @body cxml_webhook: CXMLWebhookResponse; - } | - StatusCode401 | - StatusCode404 | - CXMLWebhookUpdateStatusCode422; + @patch(#{ implicitOptionality: true }) + update(...CXMLWebhookID, ...CXMLWebhookUpdateRequest): + | { + @statusCode statusCode: 200; + @body cxml_webhook: CXMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | CXMLWebhookUpdateStatusCode422 + | StatusCode500; @summary("Delete cXML Webhook") @doc("Deletes an cXML Webhook by ID") - @delete delete(...CXMLWebhookID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } + @delete + delete(...CXMLWebhookID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } } - diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/core.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/core.tsp index 60ee2699..fbc1c440 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/core.tsp @@ -5,13 +5,16 @@ using TypeSpec.Http; model CXMLWebhookID { @doc("Unique ID of a CXML Webhook.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid + id: uuid; } model CXMLWebhook { @doc("Unique ID of the CXML Webhook.") @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + @format("uuid") id: uuid; @doc("Name of the CXML Webhook.") @@ -24,25 +27,25 @@ model CXMLWebhook { @doc("Primary request url of the CXML Webhook.") @example("https://primary.com") - primary_request_url: string; + primary_request_url: url; @doc("Primary request method of the CXML Webhook.") @example(UrlMethodType.Get) - primary_request_method: UrlMethodType; + primary_request_method: UrlMethodType.Get | UrlMethodType.Post; @doc("Fallback request url of the CXML Webhook.") @example("https://fallback.com") - fallback_request_url: string; + fallback_request_url: url | null; @doc("Fallback request method of the CXML Webhook.") @example(UrlMethodType.Get) - fallback_request_method: UrlMethodType; + fallback_request_method: UrlMethodType.Get | UrlMethodType.Post; @doc("Status callback url of the CXML Webhook.") @example("https://callback.com") - status_callback_url: string; + status_callback_url: url | null; @doc("Status callback method of the CXML Webhook.") @example(UrlMethodType.Post) - status_callback_method: UrlMethodType; + status_callback_method: UrlMethodType.Get | UrlMethodType.Post; } diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/enums.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/enums.tsp index e7475bbe..604e6c7b 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/enums.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/enums.tsp @@ -1 +1 @@ -import "./../../enums.tsp"; +import "../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/errors.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/errors.tsp index 797111b1..08957012 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/errors.tsp @@ -3,14 +3,16 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "http_url_required", message: "This value must be an HTTP or HTTPS URL.", attribute: "status_callback_url", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required" - }], - }) - model CXMLWebhookCreateStatusCode422 is StatusCode422; + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required", + } + ], +}) +model CXMLWebhookCreateStatusCode422 is StatusCode422; - model CXMLWebhookUpdateStatusCode422 is CXMLWebhookCreateStatusCode422; +model CXMLWebhookUpdateStatusCode422 is CXMLWebhookCreateStatusCode422; diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/requests.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/requests.tsp index 4030752e..09b06ca8 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/requests.tsp @@ -1,35 +1,37 @@ +import "../../_shared/enums.tsp"; + model CXMLWebhookCreateRequest { @doc("Name of the CXML Webhook.") @example("My CXML Webhook") name?: string; @doc("Used for of the CXML Webhook.") - @example("calling") - used_for?: "calling" | "messaging" = "calling"; + @example(UsedForType.Calling) + used_for?: UsedForType = UsedForType.Calling; @doc("Primary request url of the CXML Webhook.") @example("https://primary.com") - primary_request_url: string; + primary_request_url: url; @doc("Primary request method of the CXML Webhook.") - @example("GET") - primary_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + primary_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Fallback request url of the CXML Webhook.") @example("https://fallback.com") - fallback_request_url?: string; + fallback_request_url?: url; @doc("Fallback request method of the CXML Webhook.") - @example("GET") - fallback_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + fallback_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Status callback url of the CXML Webhook.") @example("https://callback.com") - status_callback_url?: string; + status_callback_url?: url; @doc("Status callback method of the CXML Webhook.") - @example("POST") - status_callback_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; } model CXMLWebhookUpdateRequest { @@ -38,30 +40,30 @@ model CXMLWebhookUpdateRequest { name?: string; @doc("Used for of the CXML Webhook.") - @example("calling") - used_for?: "calling" | "messaging" = "calling"; + @example(UsedForType.Calling) + used_for?: UsedForType = UsedForType.Calling; @doc("Primary request url of the CXML Webhook.") @example("https://primary.com") - primary_request_url?: string; + primary_request_url?: url; @doc("Primary request method of the CXML Webhook.") - @example("GET") - primary_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + primary_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Fallback request url of the CXML Webhook.") @example("https://fallback.com") - fallback_request_url?: string; + fallback_request_url?: url; @doc("Fallback request method of the CXML Webhook.") - @example("GET") - fallback_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + fallback_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Status callback url of the CXML Webhook.") @example("https://callback.com") - status_callback_url?: string; + status_callback_url?: url; @doc("Status callback method of the CXML Webhook.") - @example("POST") - status_callback_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Post) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; } diff --git a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/responses.tsp b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/responses.tsp index 1bbf8cfe..2f82a7a7 100644 --- a/specs/signalwire-rest/fabric-api/cxml-webhooks/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/cxml-webhooks/models/responses.tsp @@ -1,11 +1,15 @@ +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; model CXMLWebhookResponse { @doc("Unique ID of the CXMLWebhook.") @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + @format("uuid") id: uuid; @doc("Unique ID of the Project.") @example("99151cf8-9548-4860-ba70-a8de824f3312") + @format("uuid") project_id: uuid; @doc("Display name of the CXMLWebhook Fabric Resource") @@ -13,15 +17,15 @@ model CXMLWebhookResponse { display_name: string; @doc("Type of the Fabric Resource") - @example("cxml_webhook") - type: string; + @example(FabricResponseType.CxmlWebhook) + type: FabricResponseType.CxmlWebhook; @doc("Date and time when the resource was created.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) created_at: utcDateTime; @doc("Date and time when the resource was updated.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) updated_at: utcDateTime; @doc("CXMLWebhook data.") @@ -29,20 +33,27 @@ model CXMLWebhookResponse { } model CXMLWebhookListResponse { + @doc("An array of objects containing a list of cXML Webhook data") data: CXMLWebhookResponse[]; + + @doc("Object containing pagination links") links: CXMLWebhookPaginationResponse; } model CXMLWebhookPaginationResponse { @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&type=cxml_webhook") self: url; @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&type=cxml_webhook") first: url; @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook") next: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/main.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/main.tsp new file mode 100644 index 00000000..6808bc09 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/dialogflow_agents/{id}/addresses") +namespace FabricAPI.DialogflowAgent.Addresses { + @tag(AI_DIALOGFLOW_TAG) + interface DialogflowAgentAddresses { + @summary("List Dialogflow Agent Addresses") + @doc("This endpoint returns a list of addresses associated with a specific Dialogflow Agent.") + list(...DialogflowAgentAddressPathID): + | DialogflowAgentAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/core.tsp new file mode 100644 index 00000000..200a8f52 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model DialogflowAgentAddressPathID { + @doc("The unique identifier of the Dialogflow Agent Address.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/responses.tsp new file mode 100644 index 00000000..91620a8b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model DialogflowAgentAddressListResponse { + @doc("An array of objects that contain a list of Dialogflow Agent Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: DialogflowAgentAddressPaginationResponse; +} + +model DialogflowAgentAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&type=dialogflow_agent") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&type=dialogflow_agent") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/main.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/main.tsp new file mode 100644 index 00000000..afd3568e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/main.tsp @@ -0,0 +1,64 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/dialogflow_agents") +namespace FabricAPI.DialogflowAgents { + @tag(AI_DIALOGFLOW_TAG) + interface DialogflowAgents { + @summary("List Dialogflow Agents") + @doc("A list of Dialogflow Agents") + list(): + | DialogflowAgentListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get Dialogflow Agent") + @doc("Returns a Dialogflow Agent by ID") + read(...DialogflowAgentPathID): + | { + @statusCode statusCode: 200; + @body dialogflow_agent: DialogflowAgentResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Update Dialogflow Agent") + @doc("Updates a Dialogflow Agent by ID") + @put + update( + ...DialogflowAgentPathID, + @body request: DialogflowAgentUpdateRequest, + ): + | { + @statusCode statusCode: 200; + @body dialogflow_agent: DialogflowAgentResponse; + } + | StatusCode401 + | StatusCode404 + | DialogflowAgentUpdateStatusCode422 + | StatusCode500; + + @summary("Delete Dialogflow Agent") + @doc("Deletes a Dialogflow Agent by ID") + @delete + delete(...DialogflowAgentPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/models/core.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/core.tsp new file mode 100644 index 00000000..beba08dc --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/core.tsp @@ -0,0 +1,43 @@ +import "../../../types"; + +using TypeSpec.Http; + +model DialogflowAgentPathID { + @doc("Unique ID of a Dialogflow Agent.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model DialogflowAgent { + @doc("Unique ID of a Dialogflow Agent.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("Whether to enable the 'say' feature") + @example(true) + say_enabled?: boolean; + + @doc("Default message to say") + @example("Welcome to the Booking Assistant") + say?: string; + + @doc("Voice to use for speech") + @example("en-US-Wavenet-D") + voice?: string; + + @doc("Display name of the Dialogflow Agent") + @example("Booking Assistant") + display_name?: string; + + @doc("Dialogflow reference ID") + @example("12345678-1234-1234-1234-1234567890ab") + @format("uuid") + dialogflow_reference_id?: uuid; + + @doc("Dialogflow reference name") + @example("my dialogflow agent") + dialogflow_reference_name?: string; +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/models/errors.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/errors.tsp new file mode 100644 index 00000000..25029d2c --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "project_id is required", + attribute: "project_id", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model DialogflowAgentCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "language_code must be a valid language code", + attribute: "language_code", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model DialogflowAgentUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/models/requests.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/requests.tsp new file mode 100644 index 00000000..51d7265b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/requests.tsp @@ -0,0 +1,40 @@ +import "./core.tsp"; + +model DialogflowAgentCreateRequest { + @doc("Display name of the Dialogflow Agent") + @example("Customer Service Agent") + display_name: string; + + @doc("Dialogflow project ID") + @example("my-project-12345") + project_id: string; + + @doc("Dialogflow agent language code") + @example("en-US") + language_code: string; + + @doc("Initial event name to trigger") + @example("welcome") + initial_event?: string; + + @doc("Optional session parameters") + session_params?: Record; +} + +model DialogflowAgentUpdateRequest { + @doc("Name of the Dialogflow Agent") + @example("Booking Assistant") + name?: string; + + @doc("Whether to enable the 'say' feature") + @example(true) + say_enabled?: boolean; + + @doc("Default message to say") + @example("Welcome to the Booking Assistant") + say?: string; + + @doc("Voice to use for speech") + @example("en-US-Wavenet-D") + voice?: string; +} diff --git a/specs/signalwire-rest/fabric-api/dialogflow-agents/models/responses.tsp b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/responses.tsp new file mode 100644 index 00000000..ec02e44e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/dialogflow-agents/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model DialogflowAgentResponse { + @doc("Unique ID of the Dialogflow Agent.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the Dialogflow Agent Fabric Resource") + @example("Customer Service Agent") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.DialogflowAgent) + type: FabricResponseType.DialogflowAgent; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("Dialogflow Agent data.") + dialogflow_agent: DialogflowAgent; +} + +model DialogflowAgentListResponse { + @doc("An array of objects that contain a list of Dialogflow Agent data") + data: DialogflowAgentResponse[]; + + @doc("Object containing pagination links") + links: DialogFlowPaginationResponse; +} + +model DialogFlowPaginationResponse { + @doc("Link to the current page") + @example("https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=0&page_size=50&type=dialogflow_agent") + self: url; + + @doc("Link to the first page") + @example("https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_size=50&type=dialogflow_agent") + first: url; + + @doc("Link to the next page") + @example("https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent") + next?: url; + + @doc("Link to the previous page") + @example("https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/domain-applications/main.tsp b/specs/signalwire-rest/fabric-api/domain-applications/main.tsp new file mode 100644 index 00000000..5e0884d6 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/domain-applications/main.tsp @@ -0,0 +1,38 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/{id}/domain_applications") +namespace FabricAPI.DomainApplications { + @tag(DOMAIN_APPLICATIONS_TAG) + interface DomainApplications { + @summary("Assign a resource as a call handler for a Domain Application.") + @doc(""" + This endpoint assigns a specific resource to a Domain Application, allowing inbound calls to be handled by the resource. + :::important + Currently only supports `calling` as a handler and automatically defaults to it. + ::: + """) + @post + assign( + ...DomainApplicationPathID, + @body request: DomainApplicationAssignRequest, + ): + | { + @statusCode statusCode: 200; + @body domain_application: DomainApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | DomainApplicationCreateStatusCode422 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/domain-applications/models/core.tsp b/specs/signalwire-rest/fabric-api/domain-applications/models/core.tsp new file mode 100644 index 00000000..d12a6ea0 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/domain-applications/models/core.tsp @@ -0,0 +1,12 @@ +import "@typespec/http"; +import "../../_shared/enums.tsp"; + +using TypeSpec.Http; + +model DomainApplicationPathID { + @doc("The unique identifier of the Resource.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/domain-applications/models/errors.tsp b/specs/signalwire-rest/fabric-api/domain-applications/models/errors.tsp new file mode 100644 index 00000000..90c93755 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/domain-applications/models/errors.tsp @@ -0,0 +1,16 @@ +import "../../../types"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "name is required", + attribute: "name", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model DomainApplicationCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/domain-applications/models/requests.tsp b/specs/signalwire-rest/fabric-api/domain-applications/models/requests.tsp new file mode 100644 index 00000000..e1df2a7d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/domain-applications/models/requests.tsp @@ -0,0 +1,6 @@ +model DomainApplicationAssignRequest { + @doc("The id of the domain application you wish to assign a resource to.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + domain_application_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/domain-applications/models/responses.tsp b/specs/signalwire-rest/fabric-api/domain-applications/models/responses.tsp new file mode 100644 index 00000000..f0e775e8 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/domain-applications/models/responses.tsp @@ -0,0 +1,4 @@ +import "./core.tsp"; +import "../../_shared/fabric-address"; + +model DomainApplicationResponse is FabricAddressApp; diff --git a/specs/signalwire-rest/fabric-api/embeds-tokens/main.tsp b/specs/signalwire-rest/fabric-api/embeds-tokens/main.tsp index 04852338..3285cc61 100644 --- a/specs/signalwire-rest/fabric-api/embeds-tokens/main.tsp +++ b/specs/signalwire-rest/fabric-api/embeds-tokens/main.tsp @@ -3,25 +3,33 @@ import "@typespec/http"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; -@server("https://embeds.signalwire.com/api/fabric/", "Endpoint") // Define the API path for embeds -@useAuth({ type: Http.AuthType.noAuth }) +@useAuth({ + type: Http.AuthType.noAuth, +}) @route("/embeds/tokens") +@server("https://embeds.signalwire.com/api/fabric", "Embeds Endpoint") namespace FabricAPI.EmbedsTokens { - @tag("Embeds Tokens") - @friendlyName("Embeds Tokens") - interface EmbedsTokens { - @summary("Create Embeds Tokens") - @doc("Exchanges a public Click-to-Call (C2C) token for a short-lived, private embed guest token used to authorize a call. This allows secure activation of the C2C widget without exposing sensitive credentials.") - @post - create(@body body: EmbedsTokensRequest): - { @statusCode statusCode: 201; @body subscriber: EmbedsTokensResponse; } | - StatusCode401 | - StatusCode404 | - StatusCode403; - } + @tag(EMBEDS_TOKENS_TAG) + @friendlyName("Embeds Tokens") + interface EmbedsTokens { + @summary("Create Embeds Tokens") + @doc("Exchanges a public Click-to-Call (C2C) token for a short-lived, private embed guest token used to authorize a call. This allows secure activation of the C2C widget without exposing sensitive credentials.") + @post + create(@body body: EmbedsTokensRequest): + | { + @statusCode statusCode: 201; + @body subscriber: EmbedsTokensResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode403 + | EmbedTokenCreateStatusCode422 + | StatusCode500; + } } diff --git a/specs/signalwire-rest/fabric-api/embeds-tokens/models/errors.tsp b/specs/signalwire-rest/fabric-api/embeds-tokens/models/errors.tsp index 23da8817..95fd7b18 100644 --- a/specs/signalwire-rest/fabric-api/embeds-tokens/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/embeds-tokens/models/errors.tsp @@ -1,3 +1,16 @@ import "../../../types/status-codes"; using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "token is required", + attribute: "token", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model EmbedTokenCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/embeds-tokens/models/requests.tsp b/specs/signalwire-rest/fabric-api/embeds-tokens/models/requests.tsp index f6d49f43..5e908ee9 100644 --- a/specs/signalwire-rest/fabric-api/embeds-tokens/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/embeds-tokens/models/requests.tsp @@ -3,7 +3,7 @@ import "@typespec/http"; using TypeSpec.Http; model EmbedsTokensRequest { - @doc("Click to Call Token") - @example("c2c_7acc0e5e968706a032983cd80cdca219") - token: string; + @doc("Click to Call Token") + @example("c2c_7acc0e5e968706a032983cd80cdca219") + token: string; } diff --git a/specs/signalwire-rest/fabric-api/embeds-tokens/models/responses.tsp b/specs/signalwire-rest/fabric-api/embeds-tokens/models/responses.tsp index ec001b59..ccbccc58 100644 --- a/specs/signalwire-rest/fabric-api/embeds-tokens/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/embeds-tokens/models/responses.tsp @@ -1,5 +1,6 @@ model EmbedsTokensResponse { @doc("Encrypted guest token.") @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0..") + @format("jwt") token: string; } diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/main.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/main.tsp new file mode 100644 index 00000000..f2160333 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/freeswitch_connectors/{id}/addresses") +namespace FabricAPI.FreeswitchConnectorAddresses { + @tag(FREESWITCH_CONNECTOR_TAG) + interface FreeswitchConnectorAddresses { + @summary("List FreeSWITCH Connector Addresses") + @doc("This endpoint returns a list of addresses associated with a specific FreeSWITCH Connector.") + list(...FreeswitchConnectorAddressPathID): + | FreeswitchConnectorAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/core.tsp new file mode 100644 index 00000000..f147615e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model FreeswitchConnectorAddressPathID { + @doc("The unique identifier of the FreeSWITCH Connector.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/responses.tsp new file mode 100644 index 00000000..843b2b54 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model FreeswitchConnectorAddressListResponse { + @doc("An array of objects containing a list of FreeSWITCH Connector Addresses") + data: FabricAddressCall[]; + + @doc("Object containing pagination links") + links: FreeswitchConnectorAddressPaginationResponse; +} + +model FreeswitchConnectorAddressPaginationResponse { + @doc("Link to the current page") + @example("https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=freeswitch_connector") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=freeswitch_connector") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/main.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/main.tsp new file mode 100644 index 00000000..f2933eec --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/main.tsp @@ -0,0 +1,78 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/freeswitch_connectors") +namespace FabricAPI.FreeswitchConnectors { + @tag(FREESWITCH_CONNECTOR_TAG) + @friendlyName("FreeSWITCH Connectors") + interface FreeswitchConnectors { + @summary("List FreeSWITCH Connectors") + @doc("A list of FreeSWITCH Connectors") + list(): + | FreeswitchConnectorListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get FreeSWITCH Connector") + @doc("Returns a FreeSWITCH Connector by ID") + read(...FreeswitchConnectorPathID): + | { + @statusCode statusCode: 200; + @body freeswitch_connector: FreeswitchConnectorResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create FreeSWITCH Connector") + @doc("Creates a FreeSWITCH Connector") + @post + create(@body request: FreeswitchConnectorCreateRequest): + | { + @statusCode statusCode: 200; + @body freeswitch_connector: FreeswitchConnectorResponse; + } + | StatusCode401 + | StatusCode404 + | FreeswitchConnectorCreateStatusCode422 + | StatusCode500; + + @summary("Update FreeSWITCH Connector") + @doc("Updates a FreeSWITCH Connector by ID") + @put + update( + ...FreeswitchConnectorPathID, + @body request: FreeswitchConnectorUpdateRequest, + ): + | { + @statusCode statusCode: 200; + @body freeswitch_connector: FreeswitchConnectorResponse; + } + | StatusCode401 + | StatusCode404 + | FreeswitchConnectorUpdateStatusCode422 + | StatusCode500; + + @summary("Delete FreeSWITCH Connector") + @doc("Deletes a FreeSWITCH Connector by ID") + @delete + delete(...FreeswitchConnectorPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/core.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/core.tsp new file mode 100644 index 00000000..9bb8d7dc --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/core.tsp @@ -0,0 +1,30 @@ +import "../../../types"; + +using TypeSpec.Http; + +model FreeswitchConnectorPathID { + @doc("Unique ID of a FreeSWITCH Connector.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model FreeswitchConnector { + @doc("Unique ID of a FreeSWITCH Connector.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("Name of the FreeSWITCH Connector") + @example("Booking Assistant") + name?: string; + + @doc("Caller ID for the connector") + @example("123456") + caller_id?: string | null; + + @doc("Send as identifier") + @example("123456") + send_as?: string | null; +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/errors.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/errors.tsp new file mode 100644 index 00000000..c253ddd3 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "host is required", + attribute: "host", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model FreeswitchConnectorCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "port must be between 1 and 65535", + attribute: "port", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model FreeswitchConnectorUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/requests.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/requests.tsp new file mode 100644 index 00000000..be9c07e7 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/requests.tsp @@ -0,0 +1,26 @@ +import "./core.tsp"; + +model FreeswitchConnectorCreateRequest { + @doc("Name of the FreeSWITCH Connector") + @example("Booking Assistant") + name: string; + + @doc("FreeSWITCH token") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + token: uuid; +} + +model FreeswitchConnectorUpdateRequest { + @doc("Name of the FreeSWITCH Connector") + @example("Booking Assistant") + name?: string; + + @doc("Caller ID for the connector") + @example("123456") + caller_id?: string; + + @doc("Send as identifier") + @example("123456") + send_as?: string; +} diff --git a/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/responses.tsp b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/responses.tsp new file mode 100644 index 00000000..bd278d7a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/freeswitch-connectors/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model FreeswitchConnectorResponse { + @doc("Unique ID of the FreeSWITCH Connector.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the FreeSWITCH Connector Fabric Resource") + @example("Main FreeSWITCH Server") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.FreeswitchConnector) + type: FabricResponseType.FreeswitchConnector; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("FreeSWITCH Connector data.") + freeswitch_connector: FreeswitchConnector; +} + +model FreeswitchConnectorListResponse { + @doc("Object containing pagination links") + links: FreeswitchConectorPaginationResponse; + + @doc("An array of objects containing a list of FreeSWITCH connector data") + data: FreeswitchConnectorResponse[]; +} + +model FreeswitchConectorPaginationResponse { + @doc("The link of the current page") + @example("https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=0&page_size=50&type=freeswitch_connector") + self: url; + + @doc("The link of the first page") + @example("https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_size=50&type=freeswitch_connector") + first: url; + + @doc("The link of the next page") + @example("https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector") + next?: url; + + @doc("The link of the previous page") + @example("https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/main.tsp b/specs/signalwire-rest/fabric-api/main.tsp index 03a01a4d..80f1a59e 100644 --- a/specs/signalwire-rest/fabric-api/main.tsp +++ b/specs/signalwire-rest/fabric-api/main.tsp @@ -1,29 +1,71 @@ import "@typespec/http"; +import "@typespec/openapi3"; import "../types"; -import "./addresses"; -import "./subscribers"; -import "./subscriber-guest-token"; -import "./subscriber-invite-token"; -import "./subscriber-refresh-token"; -import "./swml-webhook"; -import "./swml-webhook-addresses"; import "./ai-agent"; -import "./ai-agent-addresses"; +import "./dialogflow-agents"; +import "./call-flows"; +import "./conference-rooms"; +import "./cxml-scripts"; import "./cxml-webhooks"; -import "./cxml-webhook-addresses"; import "./embeds-tokens"; +import "./addresses"; +import "./freeswitch-connectors"; +import "./cxml-applications"; +import "./relay-applications"; +import "./resources"; +import "./sip-endpoints"; import "./sip_gateways"; - +import "./subscribers"; +import "./swml-scripts"; +import "./swml-webhook"; +import "./domain-applications"; +import "./phone-routes"; +import "../_globally_shared/const.tsp"; +import "./tags.tsp"; using TypeSpec.Http; -using Types.StatusCodes; +using TypeSpec.OpenAPI; -@service(#{ +@tagMetadata(AI_CUSTOM_TAG, AI_CUSTOM_TAG_METADATA) +@tagMetadata(AI_DIALOGFLOW_TAG, AI_DIALOGFLOW_TAG_METADATA) +@tagMetadata(CALL_FLOWS_TAG, CALL_FLOWS_TAG_METADATA) +@tagMetadata(EMBEDS_TOKENS_TAG, EMBEDS_TOKENS_TAG_METADATA) +@tagMetadata(SWML_WEBHOOK_TAG, SMWL_WEBHOOK_TAG_METADATA) +@tagMetadata(FABRIC_ADDRESS_TAG, FABRIC_ADDRESS_TAG_METADATA) +@tagMetadata(FREESWITCH_CONNECTOR_TAG, FREESWITCH_CONNECTOR_TAG_METADATA) +@tagMetadata(CXML_APPLICATIONS_TAG, CXML_APPLICATIONS_TAG_METADATA) +@tagMetadata(CXML_SCRIPTS_TAG, CXML_SCRIPTS_TAG_METADATA) +@tagMetadata(CXML_WEBHOOK_TAG, CXML_WEBHOOK_TAG_METADATA) +@tagMetadata(RELAY_APPLICATION_TAG, RELAY_APPLICATION_TAG_METADATA) +@tagMetadata(RESOURCES_TAG, RESOURCES_TAG_METADATA) +@tagMetadata(SIP_ENDPOINTS_TAG, SIP_ENDPOINTS_TAG_METADATA) +@tagMetadata(SIP_GATEWAY_TAG, SIP_GATEWAY_TAG_METADATA) +@tagMetadata(SUBSCRIBERS_TAG, SUBSCRIBERS_TAG_METADATA) +@tagMetadata(SUBSCRIBERS_TOKENS_TAG, SUBSCRIBERS_TOKENS_TAG_METADATA) +@tagMetadata(SUBSCRIBER_SIP_ENDPOINT_TAG, SUBSCRIBER_SIP_ENDPOINT_TAG_METADATA) +@tagMetadata(SWML_SCRIPTS_TAG, SWML_SCRIPTS_TAG_METADATA) +@tagMetadata(CONFERENCE_ROOM_TAG, CONFERENCE_ROOM_TAG_METADATA) +@tagMetadata(DOMAIN_APPLICATIONS_TAG, DOMAIN_APPLICATIONS_TAG_METADATA) +@tagMetadata(PHONE_ROUTES_TAG, PHONE_ROUTES_TAG_METADATA) +@service(#{ title: "Call Fabric API" }) +@externalDocs( + "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric", + "The Fabric API holds a collection of endpoints that will help you in managing and creating your SignalWire Resources." +) +@info(#{ title: "Call Fabric API", + version: "1.0.0", + contact: CONTACT_INFO, + license: LICENSE_INFO, + termsOfService: TERMS_OF_SERVICE, }) -@server("https://{space_name}.signalwire.com/api/fabric/", "Endpoint", { - space_name: string = "{Your_Space_Name}"; -}) +@server( + "https://{space_name}.${SERVER_URL}/fabric/", + "Endpoint", + { + space_name: string = "{Your_Space_Name}", + } +) @useAuth(BasicAuth) @doc("API to access/manage SignalWire's Call Fabric objects.") namespace FabricAPI; diff --git a/specs/signalwire-rest/fabric-api/phone-routes/main.tsp b/specs/signalwire-rest/fabric-api/phone-routes/main.tsp new file mode 100644 index 00000000..599f480e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/phone-routes/main.tsp @@ -0,0 +1,33 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/{id}/phone_routes") +namespace FabricAPI.PhoneRoutes { + @tag(PHONE_ROUTES_TAG) + @friendlyName("Phone Routes") + interface PhoneRoutes { + @summary("Assign a Resource to a Phone Route") + @doc(""" + This endpoint assigns a specific resource to a phone route, allowing inbound calls & messages to be handled by the resource. + """) + @post + assign(...PhoneRoutePathID, @body request: PhoneRouteAssignRequest): + | { + @statusCode statusCode: 200; + @body phone_route: PhoneRouteResponse; + } + | StatusCode401 + | StatusCode404 + | PhoneRouteCreateStatusCode422 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/phone-routes/models/core.tsp b/specs/signalwire-rest/fabric-api/phone-routes/models/core.tsp new file mode 100644 index 00000000..5b4764a7 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/phone-routes/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model PhoneRoutePathID { + @doc("The unique identifier of the Resource.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/phone-routes/models/errors.tsp b/specs/signalwire-rest/fabric-api/phone-routes/models/errors.tsp new file mode 100644 index 00000000..9a8dd436 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/phone-routes/models/errors.tsp @@ -0,0 +1,16 @@ +import "../../../types"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "phone_number is required", + attribute: "phone_number", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model PhoneRouteCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/phone-routes/models/requests.tsp b/specs/signalwire-rest/fabric-api/phone-routes/models/requests.tsp new file mode 100644 index 00000000..f60f48b1 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/phone-routes/models/requests.tsp @@ -0,0 +1,12 @@ +import "../../_shared/enums.tsp"; + +model PhoneRouteAssignRequest { + @doc("The id of the phone route.") + @example("691af061-cd86-4893-a605-173f47afc4c2") + @format("uuid") + phone_route_id: uuid; + + @doc("Indicates if the resource should be assigned to a `calling` or `messaging` handler.") + @example(UsedForType.Calling) + handler: UsedForType; +} diff --git a/specs/signalwire-rest/fabric-api/phone-routes/models/responses.tsp b/specs/signalwire-rest/fabric-api/phone-routes/models/responses.tsp new file mode 100644 index 00000000..06d1a95e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/phone-routes/models/responses.tsp @@ -0,0 +1,4 @@ +import "./core.tsp"; +import "../../_shared/fabric-address"; + +model PhoneRouteResponse is FabricAddressApp; diff --git a/specs/signalwire-rest/fabric-api/relay-applications/addresses/main.tsp b/specs/signalwire-rest/fabric-api/relay-applications/addresses/main.tsp new file mode 100644 index 00000000..ae045c0a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/relay_applications/{id}/addresses") +namespace FabricAPI.RelayApplication.Addresses { + @tag(RELAY_APPLICATION_TAG) + interface RelayApplicationAddresses { + @summary("List Relay Application Addresses") + @doc("This endpoint returns a paginated list of addresses associated with a Relay Application.") + list(...RelayApplicationAddressPathID): + | RelayApplicationAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/core.tsp new file mode 100644 index 00000000..7b7b11f7 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model RelayApplicationAddressPathID { + @doc("The unique identifier of the Relay Application.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/responses.tsp new file mode 100644 index 00000000..bf0bb05d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model RelayApplicationAddressListResponse { + @doc("An array of objects that contain a list of Relay Application Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: RelayApplicationAddressPaginationResponse; +} + +model RelayApplicationAddressPaginationResponse { + @doc("Self link for the current page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=relay_application") + self: string; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=relay_application") + first: string; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=relay_application") + next?: string; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=relay_application") + prev?: string; +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/main.tsp b/specs/signalwire-rest/fabric-api/relay-applications/main.tsp new file mode 100644 index 00000000..a4bb864a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/main.tsp @@ -0,0 +1,78 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/relay_applications") +namespace FabricAPI.RelayApplications { + @tag(RELAY_APPLICATION_TAG) + @friendlyName("Relay Applications") + interface RelayApplications { + @summary("List Relay Applications") + @doc("A list of Relay Applications") + list(): + | RelayApplicationListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get Relay Application") + @doc("Returns a Relay Application by ID") + read(...RelayApplicationPathID): + | { + @statusCode statusCode: 200; + @body relay_application: RelayApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create Relay Application") + @doc("Creates a Relay Application") + @post + create(@body request: RelayApplicationCreateRequest): + | { + @statusCode statusCode: 200; + @body relay_application: RelayApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | RelayApplicationCreateStatusCode422 + | StatusCode500; + + @summary("Update Relay Application") + @doc("Updates a Relay Application by ID") + @put + update( + ...RelayApplicationPathID, + @body request: RelayApplicationUpdateRequest, + ): + | { + @statusCode statusCode: 200; + @body relay_application: RelayApplicationResponse; + } + | StatusCode401 + | StatusCode404 + | RelayApplicationUpdateStatusCode422 + | StatusCode500; + + @summary("Delete Relay Application") + @doc("Deletes a Relay Application by ID") + @delete + delete(...RelayApplicationPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/models/core.tsp b/specs/signalwire-rest/fabric-api/relay-applications/models/core.tsp new file mode 100644 index 00000000..b456243e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/models/core.tsp @@ -0,0 +1,30 @@ +import "../../../types"; + +using TypeSpec.Http; + +model RelayApplicationPathID { + @doc("Unique ID of a Relay Application.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model RelayApplication { + @doc("Unique ID of a Relay Application.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("Name of the Relay Application") + @example("Booking Assistant") + name: string; + + @doc("Topic of the Relay Application") + @example("booking") + topic: string; + + @doc("Call status callback URL") + @example("https://example.com/callbacks") + call_status_callback_url: url | null; +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/models/errors.tsp b/specs/signalwire-rest/fabric-api/relay-applications/models/errors.tsp new file mode 100644 index 00000000..bbbb1da1 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "name is required", + attribute: "name", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model RelayApplicationCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "webhook_url must be a valid URL", + attribute: "webhook_url", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model RelayApplicationUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/relay-applications/models/requests.tsp b/specs/signalwire-rest/fabric-api/relay-applications/models/requests.tsp new file mode 100644 index 00000000..e099ff7e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/models/requests.tsp @@ -0,0 +1,29 @@ +import "./core.tsp"; + +model RelayApplicationCreateRequest { + @doc("Name of the Relay Application") + @example("Booking Assistant") + name: string; + + @doc("Topic of the Relay Application") + @example("booking") + topic: string; + + @doc("Call status callback URL") + @example("https://booking.com/callbacks") + call_status_callback_url?: string; +} + +model RelayApplicationUpdateRequest { + @doc("Name of the Relay Application") + @example("Booking Assistant") + name?: string; + + @doc("Topic of the Relay Application") + @example("booking") + topic?: string; + + @doc("Call status callback URL") + @example("https://booking.com/callbacks") + call_status_callback_url?: string; +} diff --git a/specs/signalwire-rest/fabric-api/relay-applications/models/responses.tsp b/specs/signalwire-rest/fabric-api/relay-applications/models/responses.tsp new file mode 100644 index 00000000..a9519d66 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/relay-applications/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model RelayApplicationResponse { + @doc("Unique ID of the Relay Application.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the Relay Application Fabric Resource") + @example("Customer Service Bot") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.RelayApplication) + type: FabricResponseType.RelayApplication; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("Relay Application data.") + relay_application: RelayApplication; +} + +model RelayApplicationListResponse { + @doc("An array of objects that contain a list of Relay Application data") + data: RelayApplicationResponse[]; + + @doc("Object containing pagination links") + links: RelayApplicationAddressPaginationResponse; +} + +model RelayApplicationPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications?page_number=0&page_size=50&type=relay_application") + self: url; + + @doc("Link of the first page") + @example("https://example.signalwire.com/api/fabric/resources/relay_applications?page_size=50&type=relay_application") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources?page_number=1&page_size=50&page_token=PAc28a38e4-0ae7-49ab-9bf6-f41f1572e6e4&type=relay_application") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources?page_number=0&page_size=50&page_token=PAc28a38e4-0ae7-49ab-9bf6-f41f1572e6e4&type=relay_application") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/resources/addresses/main.tsp b/specs/signalwire-rest/fabric-api/resources/addresses/main.tsp new file mode 100644 index 00000000..914e7603 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/{id}/addresses") +namespace FabricAPI.Resource.Addresses { + @tag(RESOURCES_TAG) + interface ResourceAddresses { + @summary("List Resource Addresses") + @doc("This endpoint is used to retrieve addresses associated with a specific Resource.") + list(...ResourceAddressPathID): + | ResourceAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/resources/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/resources/addresses/models/core.tsp new file mode 100644 index 00000000..730559ad --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model ResourceAddressPathID { + @doc("The unique identifier of the Resource.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/resources/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/resources/addresses/models/responses.tsp new file mode 100644 index 00000000..fd535824 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/addresses/models/responses.tsp @@ -0,0 +1,28 @@ +import "../../../_shared/fabric-address"; +import "../../../../types"; + +model ResourceAddressListResponse { + @doc("An array opf objects that contain a list of Resource Addresses") + data: FabricAddress[]; + + @doc("Object containing pagination links") + links: ResourceAddressPaginationResponse; +} + +model ResourceAddressPaginationResponse { + @doc("Link to the current page of results") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page of results") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page of results") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("Link to the previous page of results") + @example("https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/resources/main.tsp b/specs/signalwire-rest/fabric-api/resources/main.tsp new file mode 100644 index 00000000..f30332ab --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/main.tsp @@ -0,0 +1,49 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources") +namespace FabricAPI.Resources { + @tag(RESOURCES_TAG) + @friendlyName("Resources") + interface Resources { + @summary("List Resources") + @doc("A list of Fabric Resources") + list(): + | ResourceListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get Resource") + @doc("Returns a Resource by ID") + read(...ResourcePathID): + | { + @statusCode statusCode: 200; + @body resource: ResourceResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Delete Resource") + @doc("Deletes a Resource by ID") + @delete + delete(...ResourcePathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/resources/models/core.tsp b/specs/signalwire-rest/fabric-api/resources/models/core.tsp new file mode 100644 index 00000000..bb2dbf82 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/models/core.tsp @@ -0,0 +1,11 @@ +import "../../../types"; + +using TypeSpec.Http; + +model ResourcePathID { + @doc("Unique ID of a Resource.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/resources/models/errors.tsp b/specs/signalwire-rest/fabric-api/resources/models/errors.tsp new file mode 100644 index 00000000..88e651ee --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/models/errors.tsp @@ -0,0 +1 @@ +import "../../../types/status-codes"; diff --git a/specs/signalwire-rest/fabric-api/resources/models/requests.tsp b/specs/signalwire-rest/fabric-api/resources/models/requests.tsp new file mode 100644 index 00000000..0485bbf4 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/models/requests.tsp @@ -0,0 +1 @@ +import "./core.tsp"; diff --git a/specs/signalwire-rest/fabric-api/resources/models/responses.tsp b/specs/signalwire-rest/fabric-api/resources/models/responses.tsp new file mode 100644 index 00000000..9c00ae8b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/resources/models/responses.tsp @@ -0,0 +1,232 @@ +import "./core.tsp"; +import "../../_shared/const.tsp"; +import "../../_shared/enums.tsp"; +import "../../ai-agent"; +import "../../call-flows"; +import "../../cxml-webhooks"; +import "../../cxml-scripts"; +import "../../cxml-applications"; +import "../../dialogflow-agents"; +import "../../freeswitch-connectors"; +import "../../relay-applications"; +import "../../sip-endpoints"; +import "../../sip_gateways"; +import "../../subscribers"; +import "../../subscribers/subscriber-sip-endpoint"; +import "../../swml-webhook"; +import "../../swml-scripts"; +import "../../conference-rooms"; +import "@typespec/http"; +import "@typespec/openapi3"; + +using TypeSpec.OpenAPI; + +const RESPONSE_TYPE_DESC = "The type of Resource"; + +model ResourceResponseBase { + @doc("Unique ID of the Resource.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the Resource") + @example("My Resource") + display_name: string; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; +} + +@summary("AI Agent") +model ResourceResponseAI is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.AiAgent) + type: FabricResponseType.AiAgent; + + @doc("An object containing the response data of the AI Agent") + ai_agent: AIAgent; +} + +@summary("Call Flow") +model ResourceResponseCallFlow is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.CallFlow) + type: FabricResponseType.CallFlow; + + @doc("An object containing the response data of the Call Flow") + call_flow: CallFlow; +} + +@summary("cXML Webhook") +model ResourceResponseCXMLWebhook is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.CxmlWebhook) + type: FabricResponseType.CxmlWebhook; + + @doc("An object containing the response data of the cXML Webhook") + cxml_webhook: CXMLWebhook; +} + +@summary("cXML Script") +model ResourceResponseCXMLScript is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.CxmlScript) + type: FabricResponseType.CxmlScript; + + @doc("An object containing the response data of the cXML Script") + cxml_script: CXMLScript; +} + +@summary("cXML Application") +model ResourceResponseCXMLApplication is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.CxmlApplication) + type: FabricResponseType.CxmlApplication; + + @doc("An object containing the response data of the cXML Application") + cxml_application: CxmlApplication; +} + +@summary("Dialogflow Agent") +model ResourceResponseDialogFlowAgent is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.DialogflowAgent) + type: FabricResponseType.DialogflowAgent; + + @doc("An object containing the response data of the Dialogflow Agent") + dialogflow_agent: DialogflowAgent; +} + +@summary("FreeSWITCH Connector") +model ResourceResponseFSConnector is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.FreeswitchConnector) + type: FabricResponseType.FreeswitchConnector; + + @doc("An object containing the response data of the FreeSWITCH Connector") + freeswitch_connector: FreeswitchConnector; +} + +@summary("Relay Application") +model ResourceResponseRelayApp is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.RelayApplication) + type: FabricResponseType.RelayApplication; + + @doc("An object containing the response data of the Relay Application") + relay_application: RelayApplication; +} + +@summary("SIP Endpoint") +model ResourceResponseSipEndpoint is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.SipEndpoint) + type: FabricResponseType.SipEndpoint; + + @doc("An object containing the response data of the SIP Endpoint") + sip_endpoint: SipEndpoint; +} + +@summary("SIP Gateway") +model ResourceResponseSipGateway is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.SipGateway) + type: FabricResponseType.SipGateway; + + @doc("An object containing the response data of the SIP Gateway") + sip_gateway: SipGateway; +} + +@summary("Subscriber") +model ResourceResponseSubscriber is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.Subscriber) + type: FabricResponseType.Subscriber; + + @doc("An object containing the response data of the Subscriber") + subscriber: Subscriber; +} + +@summary("SWML Webhook") +model ResourceResponseSWMLWebhook is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.SwmlWebhook) + type: FabricResponseType.SwmlWebhook; + + @doc("An object containing the response data of the SWML Webhook") + swml_webhook: SWMLWebhook; +} + +@summary("SWML Script") +model ResourceResponseSWMLScript is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.SwmlScript) + type: FabricResponseType.SwmlScript; + + @doc("An object containing the response data of the SWML Script") + swml_script: SwmlScript; +} + +@summary("Conference Room") +model ResourceResponseConferenceRoom is ResourceResponseBase { + @doc(RESPONSE_TYPE_DESC) + @example(FabricResponseType.SwmlScript) + type: FabricResponseType.SwmlScript; + + @doc("An object containing the response data of the Conference Room") + conference_room: ConferenceRoom; +} + +@oneOf +union ResourceResponse { + ResourceResponseAI, + ResourceResponseCallFlow, + ResourceResponseCXMLWebhook, + ResourceResponseCXMLScript, + ResourceResponseCXMLApplication, + ResourceResponseDialogFlowAgent, + ResourceResponseFSConnector, + ResourceResponseRelayApp, + ResourceResponseSipEndpoint, + ResourceResponseSipGateway, + ResourceResponseSubscriber, + ResourceResponseSWMLWebhook, + ResourceResponseSWMLScript, + ResourceResponseConferenceRoom, +} + +model ResourceListResponse { + @doc("An array of objects that contain a list of Resource data") + data: ResourceResponse[]; + + @doc("Object containing pagination links") + links: ResourcePaginationResponse; +} + +model ResourcePaginationResponse { + @doc("The link to the current page") + @example("https://devspace.signalwire.com/api/fabric/resources?page_number=0&page_size=50") + self: url; + + @doc("The link to the first page") + @example("https://devspace.signalwire.com/api/fabric/resources?page_size=50") + first: url; + + @doc("The link to the next page") + @example("https://devspace.signalwire.com/api/fabric/resources?page_number=1&page_size=50&page_token=PA0f2b7869-304c-45ac-8863-3455ccb34cdc") + next?: url; + + @doc("The link to the previous page") + @example("https://devspace.signalwire.com/api/fabric/resources?page_number=0&page_size=50&page_token=PA0f2b7869-304c-45ac-8863-3455ccb34cdc") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/main.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/main.tsp new file mode 100644 index 00000000..698635e8 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/sip_endpoints/{id}/addresses") +namespace FabricAPI.SipEndpoint.Addresses { + @tag(SIP_ENDPOINTS_TAG) + interface SipEndpointAddresses { + @summary("List SIP Endpoint Addresses") + @doc("A list of SIP Endpoint Addresses.") + list(...SipEndpointAddressPathID): + | SipEndpointAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/core.tsp new file mode 100644 index 00000000..207b5b85 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model SipEndpointAddressPathID { + @doc("The unique identifier of the SIP Endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/responses.tsp new file mode 100644 index 00000000..70576d76 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model SipEndpointAddressListResponse { + @doc("An array of objects that contain a list of SIP Endpoint Addresses") + data: FabricAddressCall[]; + + @doc("Object containing pagination links") + links: SipEndpointAddressPaginationResponse; +} + +model SipEndpointAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=0&page_size=50&type=sip_endpoint") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_size=50&type=sip_endpoint") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/enums.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/enums.tsp new file mode 100644 index 00000000..cfb09bef --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/enums.tsp @@ -0,0 +1,6 @@ +enum CallHandlerType { + Default: "default", + Passthrough: "passthrough", + BlockPstn: "block-pstn", + Resource: "resource", +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/main.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/main.tsp new file mode 100644 index 00000000..803110e3 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/main.tsp @@ -0,0 +1,77 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "./resource"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/sip_endpoints") +namespace FabricAPI.SipEndpoints { + @tag(SIP_ENDPOINTS_TAG) + @friendlyName("SIP Endpoints") + @doc("SIP Endpoints API category.") + interface SipEndpoints { + @summary("List SIP Endpoints") + @doc("A list of SIP Endpoints") + list(): + | SipEndpointListResponse[] + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get SIP Endpoint") + @doc("Returns a SIP Endpoint by ID") + read(...SipEndpointPathID): + | { + @statusCode statusCode: 200; + @body sip_endpoint: SipEndpointResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create SIP Endpoint") + @doc("Creates a SIP Endpoint") + @post + create(@body request: SipEndpointCreateRequest): + | { + @statusCode statusCode: 200; + @body sip_endpoint: SipEndpointResponse; + } + | StatusCode401 + | StatusCode404 + | ResourceSipEndpointCreateStatusCode422 + | StatusCode500; + + @summary("Update SIP Endpoint") + @doc("Updates a SIP Endpoint by ID") + @put + update(...SipEndpointPathID, @body request: SipEndpointUpdateRequest): + | { + @statusCode statusCode: 200; + @body sip_endpoint: SipEndpointResponse; + } + | StatusCode401 + | StatusCode404 + | ResourceSipEndpointUpdateStatusCode422 + | StatusCode500; + + @summary("Delete SIP Endpoint") + @doc("Deletes a SIP Endpoint by ID") + @delete + delete(...SipEndpointPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/models/core.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/models/core.tsp new file mode 100644 index 00000000..41905695 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/models/core.tsp @@ -0,0 +1,61 @@ +import "../../../types"; +import "../../../_globally_shared/enums.tsp"; +import "../enums.tsp"; + +using TypeSpec.Http; + +const callHandlerDescription = """ + Specify how the SIP endpoint will handle outbound calls. + These options will control if the call is simply passed to the destination or controlled by a resource. + - **default**: The default behavior for Sip Endpoints. passes the call to the destination with no additional logic. + - **passthrough**: Passes the call to the destination with no additional logic. + - **block-pstn**: Passes the call to the destination while blocking PSTN destination. + - **resource**: Sets a resource to handle the call logic. This allows users ot inject calling logic into the call when calling a destination. + """; + +model SipEndpointPathID { + @doc("Unique ID of a SIP Endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model SipEndpoint { + @doc("The id of the Sip Endpoint") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("The username of the Sip Endpoint") + @example("User") + username: string; + + @doc("The caller ID that will showup when dialing from this Sip Endpoint") + @example("123456789") + caller_id: string; + + @doc("The Sip username that will show up on the calle's side. Overrides the username.") + @example("Support") + send_as: string; + + @doc("Ciphers that can be enabled for calls on this Sip Endpoint.") + @example(#[Ciphers.AEAD_AES_256_GCM_8, Ciphers.AES_256_CM_HMAC_SHA1_32]) + ciphers: Ciphers[]; + + @doc("Codecs that can be enabled for calls on this Sip Endpoint.") + @example(#[Codecs.G722, Codecs.PCMA, Codecs.PCMU, Codecs.VP8]) + codecs: Codecs[]; + + @doc("The set encryption type on the Sip Endpoint.") + @example(Encryption.Default) + encryption: Encryption = Encryption.Default; + + @doc(callHandlerDescription) + @example(CallHandlerType.Default) + call_handler: CallHandlerType; + + @doc("If `call_handler` is set to `resource`, this field expects the id of the set resouce. Will be `null` otherwise.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + calling_handler_resource_id: uuid | null; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/models/errors.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/models/errors.tsp new file mode 100644 index 00000000..c67ef2e9 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "username is required", + attribute: "username", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model ResourceSipEndpointCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "encryption must be one of: disabled, optional, required", + attribute: "encryption", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model ResourceSipEndpointUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/models/requests.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/models/requests.tsp new file mode 100644 index 00000000..8e49e591 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/models/requests.tsp @@ -0,0 +1,40 @@ +import "./core.tsp"; +import "../../../_globally_shared/enums.tsp"; + +model SipEndpointCreateRequest { + ...SipEndpoint; +} + +model SipEndpointUpdateRequest { + @doc("The username of the Sip Endpoint") + @example("User") + username?: string; + + @doc("The caller ID that will showup when dialing from this Sip Endpoint") + @example("123456789") + caller_id?: string; + + @doc("The Sip username that will show up on the calle's side. Overrides the username.") + @example("Support") + send_as?: string; + + @doc("Ciphers that can be enabled for calls on this Sip Endpoint.") + @example(#[Ciphers.AEAD_AES_256_GCM_8, Ciphers.AES_256_CM_HMAC_SHA1_32]) + ciphers?: Ciphers[]; + + @doc("Codecs that can be enabled for calls on this Sip Endpoint.") + @example(#[Codecs.G722, Codecs.PCMA, Codecs.PCMU, Codecs.VP8]) + codecs?: Codecs[]; + + @doc("The set encryption type on the Sip Endpoint.") + @example(Encryption.Default) + encryption?: Encryption = Encryption.Default; + + @doc(callHandlerDescription) + @example(CallHandlerType.Default) + call_handler?: CallHandlerType; + + @doc("If `call_handler` is set to `resource`, this field will contain the id of the set resouce. Will be `null` otherwise.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + calling_handler_resource_id: uuid | null; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/models/responses.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/models/responses.tsp new file mode 100644 index 00000000..efe11e3d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/const.tsp"; +import "../../_shared/enums.tsp"; + +model SipEndpointResponse { + @doc("Unique ID of the SIP Endpoint.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the SIP Endpoint Fabric Resource") + @example("Conference Room Phone") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.SipEndpoint) + type: FabricResponseType.SipEndpoint; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("SIP Endpoint data.") + sip_endpoint: SipEndpoint; +} + +model SipEndpointListResponse { + @doc("An array of objects that contain a list of SIP Endpoint data") + data: SipEndpointResponse[]; + + @doc("Object containing pagination links") + links: SipEndpointPaginationResponse; +} + +model SipEndpointPaginationResponse { + @doc("Link to the current page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=0&page_size=50&type=sip_endpoint") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_size=50&type=sip_endpoint") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/resource/main.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/main.tsp new file mode 100644 index 00000000..5f468513 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/main.tsp @@ -0,0 +1,38 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/{id}/sip_endpoints") +namespace FabricAPI.SipEndpoints.Resource { + @tag(SIP_ENDPOINTS_TAG) + interface ResourceSipEndpoints { + @summary("Assign a Resource to a SIP endpoint") + @doc(""" + This endpoint assigns a specific resource to a SIP endpoint, allowing inbound calls to be handled by the resource. + :::important + Currently only supports `calling` as a handler and automatically defaults to it. + ::: + """) + @post + assign( + ...ResourceSipEndpointPathID, + @body request: ResourceSipEndpointAssignRequest, + ): + | { + @statusCode statusCode: 200; + @body sip_endpoint: ResourceSipEndpointResponse; + } + | StatusCode401 + | StatusCode404 + | ResourceSubSipEndpointCreateStatusCode422 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/core.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/core.tsp new file mode 100644 index 00000000..dec48661 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/core.tsp @@ -0,0 +1,38 @@ +import "@typespec/http"; +import "../../../_shared/enums.tsp"; + +using TypeSpec.Http; + +model ResourceSipEndpointPathID { + @doc("The unique identifier of the Resource.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model ResourceSipEndpoint { + @doc("The unique identifier of the SIP endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The name for the SIP endpoint.") + @example("sip_user") + name: string; + + @doc("The Resource type") + @example("room") + type: "room"; + + @doc("The cover URL for the SIP endpoint.") + @example("https://example.com/cover.jpg") + cover_url?: url; + + @doc("The preview URL for the SIP endpoint.") + @example("https://example.com/preview.jpg") + preview_url?: url; + + @doc("An object containing the resource addresses with the specified comunication channels") + channels: AddressChannel; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/errors.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/errors.tsp new file mode 100644 index 00000000..8286293d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/errors.tsp @@ -0,0 +1,16 @@ +import "../../../../types"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "username is required", + attribute: "username", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model ResourceSubSipEndpointCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/requests.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/requests.tsp new file mode 100644 index 00000000..dd82bf46 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/requests.tsp @@ -0,0 +1,7 @@ +@summary("Create resource SIP endpoint") +model ResourceSipEndpointAssignRequest { + @doc("The unique identifier of the SIP endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + sip_endpoint_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/responses.tsp b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/responses.tsp new file mode 100644 index 00000000..e1879d6d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip-endpoints/resource/models/responses.tsp @@ -0,0 +1,28 @@ +import "./core.tsp"; +import "../../../_shared/enums.tsp"; + +model ResourceSipEndpointResponse { + @doc("The unique identifier of the SIP endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The name for the SIP endpoint.") + @example("sip_user") + name: string; + + @doc("The Resource type") + @example(DisplayTypes.Call) + type: DisplayTypes.Call; + + @doc("The cover URL for the SIP endpoint.") + @example("https://example.com/cover.jpg") + cover_url: url | null; + + @doc("The preview URL for the SIP endpoint.") + @example("https://example.com/preview.jpg") + preview_url: url | null; + + @doc("An object containing the resource addresses with the specified comunication channels") + channels: AddressChannel; +} diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/addresses/main.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/main.tsp new file mode 100644 index 00000000..6d19b8a2 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/main.tsp @@ -0,0 +1,24 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "../../../types"; +import "./models/responses.tsp"; +import "./models/requests.tsp"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/sip_gateways/{resource_id}/addresses") +namespace FabricAPI.SipGateways.Addresses { + @tag(SIP_GATEWAY_TAG) + @friendlyName("SIP Gateway") + interface RelayApplicationAddresses { + @summary("List Fabric Addresses assigned to a SIP Gateway") + @doc("Returns a paginated list of Fabric Addresses associated with the specified SIP Gateway.") + readAddressesByResourceId(...SipGatewayAddressRequest): + | SipGatewayAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/requests.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/requests.tsp new file mode 100644 index 00000000..1ff48d87 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/requests.tsp @@ -0,0 +1,12 @@ +import "@typespec/http"; +import "@typespec/openapi3"; + +using TypeSpec.Http; + +model SipGatewayAddressRequest { + @doc("The unique identifier of the SIP Gateway.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + resource_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/responses.tsp new file mode 100644 index 00000000..442642c5 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/sip_gateways/addresses/models/responses.tsp @@ -0,0 +1,27 @@ +import "../../"; + +model SipGatewayAddressListResponse { + @doc("An array of objects containing a list of SIP Gateway Addresses") + data: FabricAddressCall[]; + + @doc("Object containing pagination links") + links: SipGatewayAddressPaginationResponse; +} + +model SipGatewayAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/main.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/main.tsp index 1fcc935c..d926b6b1 100644 --- a/specs/signalwire-rest/fabric-api/sip_gateways/main.tsp +++ b/specs/signalwire-rest/fabric-api/sip_gateways/main.tsp @@ -4,61 +4,71 @@ import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; import "../../types"; +import "./addresses"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/sip_gateways") namespace FabricAPI.SipGateways { - @tag("SIP Gateway") + @tag(SIP_GATEWAY_TAG) @friendlyName("SIP Gateway") interface SipGateways { @summary("List SIP Gateways") @doc("Returns a paginated list of SIP Gateways for the authenticated project.") list(): - SipGatewayListResponse | - StatusCode401 | - StatusCode404; + | SipGatewayListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Get SIP Gateway") @doc("Returns an SIP Gateway by ID") - read(...SipGatewayID): { - @statusCode statusCode: 200; - @body sip_gateway: SipGatewayResponse; - } | - StatusCode401 | - StatusCode404; + read(...SipGatewayID): + | { + @statusCode statusCode: 200; + @body sip_gateway: SipGatewayResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Create SIP Gateway") @doc("Creates a SIP Gateway that can be used to dial external SIP entities.") - @post create(...SipGatewayCreateRequest): - { @statusCode statusCode: 201; @body sip_gateway: SipGatewayCreateResponse; } | - StatusCode401 | - StatusCode404 | - SipGatewayCreateStatusCode422; + @post + create(...SipGatewayRequest): + | { + @statusCode statusCode: 201; + @body sip_gateway: SipGatewayResponse; + } + | StatusCode401 + | StatusCode404 + | SipGatewayCreateStatusCode422 + | StatusCode500; @summary("Update SIP Gateway") @doc("Updates a SIP Gateway by ID") - @patch(#{ implicitOptionality: true }) update(...SipGatewayID, ...SipGatewayUpdateRequest): { - @statusCode statusCode: 200; @body sip_gateway: SipGatewayUpdateResponse; - } | - StatusCode401 | - StatusCode404 | - SipGatewayCreateStatusCode422; + @patch(#{ implicitOptionality: true }) + update(...SipGatewayID, ...SipGatewayRequest): + | { + @statusCode statusCode: 200; + @body sip_gateway: SipGatewayResponse; + } + | StatusCode401 + | StatusCode404 + | SipGatewayCreateStatusCode422 + | StatusCode500; @summary("Delete SIP Gateway") @doc("Deletes a SIP Gateway} by ID") - @delete delete(...SipGatewayID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - - @summary("List Fabric Addresses assigned to a SIP Gateway") - @doc("Returns a paginated list of Fabric Addresses associated with the specified SIP Gateway.") - @route("/{resource_id}/addresses") - readAddressesByResourceId(@path resource_id: string): - SipGatewayAddressListResponse | - StatusCode401 | - StatusCode404; + @delete + delete(...SipGatewayID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; } } diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/models/core.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/models/core.tsp index ad8c02c2..2cf76568 100644 --- a/specs/signalwire-rest/fabric-api/sip_gateways/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/sip_gateways/models/core.tsp @@ -4,53 +4,8 @@ using TypeSpec.Http; model SipGatewayID { @doc("Unique ID of a SIP Gateway.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid -} - -model SipGatewayAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} - -model SipGatewayAddress { - @doc("Unique ID of the Fabric Address.") - @example("691af061-cd86-4893-a605-173f47afc4c2") id: uuid; - - @doc("Fabric resource ID that the Fabric Address belongs to.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - resource_id: uuid; - - @doc("Name of the Fabric Address.") - @example("justice-league") - name: string; - - @doc("Display name of the Fabric Address.") - @example("Justice League") - display_name: string; - - @doc("Type of the Fabric Address.") - @example(DisplayTypes.App) - type: DisplayTypes; - - @doc("Cover url of the Fabric Address.") - @example("https://coverurl.com") - cover_url: string; - - @doc("Preview url of the Fabric Address.") - @example("https://previewurl.com") - preview_url: string; - - @doc("Channels of the Fabric Address.") - channel: AddressChannel; } diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/models/errors.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/models/errors.tsp index 66dfb829..79d45a04 100644 --- a/specs/signalwire-rest/fabric-api/sip_gateways/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/sip_gateways/models/errors.tsp @@ -3,13 +3,14 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "missing_required_parameter", message: "Name can't be blank", attribute: "name", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter" - }], - }) - model SipGatewayCreateStatusCode422 is StatusCode422; - + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model SipGatewayCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/models/requests.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/models/requests.tsp index d495675f..9b4fcfe1 100644 --- a/specs/signalwire-rest/fabric-api/sip_gateways/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/sip_gateways/models/requests.tsp @@ -1,4 +1,6 @@ -model SipGatewayCreateRequest { +import "../../../_globally_shared/enums.tsp"; + +model SipGatewayRequest { @doc("Display name for the SIP Gateway.") @example("My SIP Gateway") name: string; @@ -8,16 +10,14 @@ model SipGatewayCreateRequest { uri: string; @doc("Specifies the encryption requirement for the SIP connection.") - @example("required") - encryption: "optional" | "required" | "disabled"; + @example(Encryption.Required) + encryption: Encryption; @doc("List of supported SIP ciphers.") - @example(#[ "AEAD_AES_256_GCM_8", "AES_256_CM_HMAC_SHA1_80" ]) - ciphers: string[]; + @example(#[Ciphers.AEAD_AES_256_GCM_8, Ciphers.AES_256_CM_HMAC_SHA1_80]) + ciphers: Ciphers[]; @doc("List of supported codecs for media transmission.") - @example(#["OPUS"]) - codecs: string[]; + @example(#[Codecs.OPUS]) + codecs: Codecs[]; } - -alias SipGatewayUpdateRequest = SipGatewayCreateRequest; diff --git a/specs/signalwire-rest/fabric-api/sip_gateways/models/responses.tsp b/specs/signalwire-rest/fabric-api/sip_gateways/models/responses.tsp index 5c7dd4dd..fa0a5b63 100644 --- a/specs/signalwire-rest/fabric-api/sip_gateways/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/sip_gateways/models/responses.tsp @@ -1,15 +1,22 @@ import "../../../types"; +import "@typespec/openapi3"; +import "../../_shared/fabric-address"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; +import "../../../_globally_shared/enums.tsp"; using TypeSpec.Http; using TypeSpec.OpenAPI; -model SipGatewayCreateResponse { +model SipGatewayResponse { @doc("Unique ID of the resource.") @example("0823a606-0aff-4c90-9eba-f88ba118fe05") + @format("uuid") id: string; @doc("Project ID associated with the resource.") @example("bc949800-7b40-43cf-8438-a85facfcbdd1") + @format("uuid") project_id: string; @doc("Display name of the SIP Gateway.") @@ -17,27 +24,25 @@ model SipGatewayCreateResponse { display_name: string; @doc("Type of the resource.") - @example("sip_gateway") - type: "sip_gateway"; + @example(FabricResponseType.SipGateway) + type: FabricResponseType.SipGateway; @doc("Timestamp when the resource was created.") - @example(utcDateTime.fromISO("2025-04-01T19:05:42Z")) + @example(UTC_TIME_EXAMPLE) created_at: utcDateTime; @doc("Timestamp when the resource was last updated.") - @example(utcDateTime.fromISO("2025-04-01T19:05:42Z")) + @example(UTC_TIME_EXAMPLE) updated_at: utcDateTime; @doc("SIP Gateway configuration details.") sip_gateway: SipGateway; } -model SipGatewayUpdateResponse extends SipGatewayCreateResponse {} -model SipGatewayResponse extends SipGatewayCreateResponse {} - model SipGateway { @doc("Unique ID of the SIP Gateway.") @example("cce59cad-104d-4c28-ada4-98cfd102ae09") + @format("uuid") id: string; @doc("The URI for the SIP Gateway.") @@ -49,41 +54,40 @@ model SipGateway { name: string; @doc("List of supported SIP ciphers.") - @example(#["AEAD_AES_256_GCM_8", "AES_256_CM_HMAC_SHA1_80"]) - ciphers: string[]; + @example(#[Ciphers.AEAD_AES_256_GCM_8]) + ciphers: Ciphers[]; @doc("List of supported codecs.") - @example(#["OPUS"]) - codecs: string[]; + @example(#[Codecs.OPUS]) + codecs: Codecs[]; @doc("Specifies the encryption requirement.") - @example("required") - encryption: "optional" | "required" | "disabled"; + @example(Encryption.Required) + encryption: Encryption; } model SipGatewayListResponse { - @doc("List of SIP Gateways.") - data: SipGatewayCreateResponse[]; + @doc("An array of objects that contain a list of SIP Gateway data") + data: SipGatewayResponse[]; @doc("Pagination links for the response.") links: SipGatewayPaginationResponse; } model SipGatewayPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") + @doc("Link to the current page of results") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") self: url; - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") + @doc("Link to the first page of results") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") first: url; - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} + @doc("Link to the next page of results") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; -model SipGatewayAddressListResponse { - data: SipGatewayAddress[]; - links: SipGatewayAddressPaginationResponse; + @doc("Link to the previous page of results") + @example("https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/subscriber-guest-token/main.tsp b/specs/signalwire-rest/fabric-api/subscriber-guest-token/main.tsp deleted file mode 100644 index dc744b63..00000000 --- a/specs/signalwire-rest/fabric-api/subscriber-guest-token/main.tsp +++ /dev/null @@ -1,24 +0,0 @@ -import "@typespec/http"; -import "./models/requests.tsp"; -import "./models/responses.tsp"; -import "./models/errors.tsp"; -import "../../types"; - -using TypeSpec.Http; -using Types.StatusCodes; - -@route("/guests/tokens") -namespace FabricAPI.SubscriberGuestTokens { - @tag("Subscribers: Tokens") - @friendlyName("Guest Token") - interface GuestTokens { - - @summary("Create Subscriber Guest Token") - @doc("Creates a Subscriber Guest Token to be used for server-side API calls. The token is authorized using an existing API token.") - @post create(...SubscriberGuestTokenCreateRequest): - { @statusCode statusCode: 201; @body subscriber_guest_token: SubscriberGuestTokenCreateResponse; } | - StatusCode401 | - StatusCode404 | - GuestTokenCreateStatusCode422; - } -} diff --git a/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/errors.tsp deleted file mode 100644 index 017fae2e..00000000 --- a/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/errors.tsp +++ /dev/null @@ -1,14 +0,0 @@ -import "../../../types/status-codes"; - -using Types.StatusCodes; - -@example(#{ - errors: #[#{ - type: "validation_error", - code: "must_belong_to_project", - message: "The addresses must belong to the project", - attribute: "allowed_addresses", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#must_belong_to_project" - }], -}) -model GuestTokenCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/main.tsp new file mode 100644 index 00000000..4f7bd6f9 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/main.tsp @@ -0,0 +1,29 @@ +import "@typespec/http"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/guests/tokens") +namespace FabricAPI.SubscriberGuestTokens { + @tag(SUBSCRIBERS_TOKENS_TAG) + @friendlyName("Guest Token") + interface GuestTokens { + @summary("Create Subscriber Guest Token") + @doc("Creates a Subscriber Guest Token. The token is authorized using an existing API token.") + @post + create(...SubscriberGuestTokenCreateRequest): + | { + @statusCode statusCode: 201; + @body subscriber_guest_token: SubscriberGuestTokenCreateResponse; + } + | StatusCode401 + | StatusCode404 + | GuestTokenCreateStatusCode422 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/errors.tsp new file mode 100644 index 00000000..c1847f0e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/errors.tsp @@ -0,0 +1,16 @@ +import "../../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "must_belong_to_project", + message: "The addresses must belong to the project", + attribute: "allowed_addresses", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#must_belong_to_project", + } + ], +}) +model GuestTokenCreateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/requests.tsp similarity index 100% rename from specs/signalwire-rest/fabric-api/subscriber-guest-token/models/requests.tsp rename to specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/requests.tsp diff --git a/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/responses.tsp similarity index 95% rename from specs/signalwire-rest/fabric-api/subscriber-guest-token/models/responses.tsp rename to specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/responses.tsp index 223c0976..ad3d96a4 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-guest-token/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/guest-tokens/models/responses.tsp @@ -1,9 +1,11 @@ model SubscriberGuestTokenCreateResponse { @doc("Guest Token") @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMuc2lnbmFsd2lyZS5jb20iLCJ0eXAiOiJTQVQifQ..8O4EJs349q97jAcd.H4GNrC6gsWdz91ArWF9ce00Cm62iHfsrFRRUUGW3e96j9C3IphiJXvHYHTmD4qMt8czZ8cniF8c53vVAIZF-yBQibejiMxwnqW6KkLct2EJoPUf9g-wQwM0-lGGj9iPx_7yprkQekFK-7svkLcKlo1voZyavxIsWQlXByppmR_ospVx2u8jbAab0ZjKJNEnr1yPF9oNkyMAnkpkS8k8PwKaxUHBc5SGumKlexUjL3ixZDR6UOcbApVXxrB-DmQBs3otOT7hzME7oKvR-6Xy0XJ1pt4Of7MEzNBUK5Z5NMjtFiA8IqwDlNJz3I5gn8hbjSZwSMJHRJGx2DKpNKiu6fcd-3i2VwCpnKHaNUybMJ5gV3cTNfTFJQBSearCLv-7gMx6Gqy9FF_Hm2bGlfnjTQ9BCsCqXBkQ9EQD6yboi2uUhPyLmpzPqlrBc9ik0c3qR5ey5Jym_VnZXaT_S5NxjzIjLzvs33GOKiooGMsBWOm6mzTPcf398xaSErT4dF2wXwtZANou7Dt4BoTKa.DcLVYpma-iItaGhaOStu9A") - token: string; + @format("jwt") + token: jwt; @doc("Refresh Token") @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiUmVmcmVzaCIsImNoIjoidGVzdHB1Yy5zaWduYWx3aXJlLmNvbSJ9..sHcQL_V1tZH2JEAh.FNKYe_49CazNthkgSphf-ov8_I2wGLGWKD6t2q7kiG0guBxBjGzpgD8Y-LM-Nu7ePRUg7Z6vBkKAvh3rjtZpkeXoRXobJ1lov9AO72l8tB9K9RLo-TnBxLDbh0BCDGWVBgGq8DOh9kzHz4Tot-_B8pHXY_bqXX5kC4UUszXCO9nhSi1a4rp6QMD_8b0Mm8pHDK9EtW8I-tfM0HPmXuPMuOnlft3hmZo3tiKN2CarWscveQPCGetufHfQJJssdHjjYup8USAX0gJM8dpsV7FpF9fxfpy4ZU7N9MJXgSYJM5cPrxpLLx3Lj291egob14jDkn7kZQpv7jbCtsGyYxC7HAi1FgGr_sw3AeGaf2esGCkaeE11MxL05_kwdiNYBSOaHqaY62kOzu5pIdfTKQekOogCS1fgiyBgisBZeSIEBWWF.neE9KnL5AzS165dXFXUqhQ") - refresh_token: string + @format("jwt") + refresh_token: jwt; } diff --git a/specs/signalwire-rest/fabric-api/subscriber-invite-token/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/main.tsp similarity index 57% rename from specs/signalwire-rest/fabric-api/subscriber-invite-token/main.tsp rename to specs/signalwire-rest/fabric-api/subscribers/invite-tokens/main.tsp index cce560ac..1587192c 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-invite-token/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/main.tsp @@ -2,23 +2,28 @@ import "@typespec/http"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; -import "../../types"; +import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/subscriber/invites") namespace FabricAPI.SubscriberInviteTokens { - @tag("Subscribers: Tokens") + @tag(SUBSCRIBERS_TOKENS_TAG) @friendlyName("Invite Token") interface InviteTokens { - @summary("Create a Subscriber Invite Token") @doc("Creates a Subscriber Invite Token to be used for client-side API calls. The token is authorized using a subscriber's SAT (Subscriber Access Token)") - @post create(...SubscriberInviteTokenCreateRequest): - { @statusCode statusCode: 201; @body subscriber_invite_token: SubscriberInviteTokenCreateResponse; } | - StatusCode401 | - StatusCode404 | - InviteTokenCreateStatusCode422; + @post + create(...SubscriberInviteTokenCreateRequest): + | { + @statusCode statusCode: 201; + @body subscriber_invite_token: SubscriberInviteTokenCreateResponse; + } + | StatusCode401 + | StatusCode404 + | InviteTokenCreateStatusCode422 + | StatusCode500; } } diff --git a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/errors.tsp similarity index 86% rename from specs/signalwire-rest/fabric-api/subscriber-invite-token/models/errors.tsp rename to specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/errors.tsp index 87ee0d42..9ae314f3 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/errors.tsp @@ -1,4 +1,4 @@ -import "../../../types/status-codes"; +import "../../../../types/status-codes"; using Types.StatusCodes; @@ -9,21 +9,21 @@ using Types.StatusCodes; code: "invalid_parameter", message: "Address is invalid", attribute: "address_id", - url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter" + url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter", }, #{ type: "validation_error", code: "invalid_parameter", message: "Expires At must be an integer", attribute: "expires_at", - url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter" + url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter", }, #{ type: "validation_error", code: "invalid_parameter", message: "Expires At must be greater than 1733254773", attribute: "expires_at", - url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter" + url: "https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter", } ], }) diff --git a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/requests.tsp similarity index 81% rename from specs/signalwire-rest/fabric-api/subscriber-invite-token/models/requests.tsp rename to specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/requests.tsp index 8f997a7d..9a25fef9 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/requests.tsp @@ -1,5 +1,7 @@ model SubscriberInviteTokenCreateRequest { @doc("Unique ID of a Subscriber Address") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") address_id: uuid; @doc("A unixtime (the number of seconds since 1970-01-01 00:00:00) at which the token should no longer be valid. Defaults to 'two hours from now'") diff --git a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/responses.tsp similarity index 96% rename from specs/signalwire-rest/fabric-api/subscriber-invite-token/models/responses.tsp rename to specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/responses.tsp index 436205d7..f0c54a55 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-invite-token/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/invite-tokens/models/responses.tsp @@ -1,5 +1,6 @@ model SubscriberInviteTokenCreateResponse { @doc("Invite Token") @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMuc2lnbmFsd2lyZS5jb20iLCJ0eXAiOiJTQVQifQ..8O4EJs349q97jAcd.H4GNrC6gsWdz91ArWF9ce00Cm62iHfsrFRRUUGW3e96j9C3IphiJXvHYHTmD4qMt8czZ8cniF8c53vVAIZF-yBQibejiMxwnqW6KkLct2EJoPUf9g-wQwM0-lGGj9iPx_7yprkQekFK-7svkLcKlo1voZyavxIsWQlXByppmR_ospVx2u8jbAab0ZjKJNEnr1yPF9oNkyMAnkpkS8k8PwKaxUHBc5SGumKlexUjL3ixZDR6UOcbApVXxrB-DmQBs3otOT7hzME7oKvR-6Xy0XJ1pt4Of7MEzNBUK5Z5NMjtFiA8IqwDlNJz3I5gn8hbjSZwSMJHRJGx2DKpNKiu6fcd-3i2VwCpnKHaNUybMJ5gV3cTNfTFJQBSearCLv-7gMx6Gqy9FF_Hm2bGlfnjTQ9BCsCqXBkQ9EQD6yboi2uUhPyLmpzPqlrBc9ik0c3qR5ey5Jym_VnZXaT_S5NxjzIjLzvs33GOKiooGMsBWOm6mzTPcf398xaSErT4dF2wXwtZANou7Dt4BoTKa.DcLVYpma-iItaGhaOStu9A") - token: string; + @format("jwt") + token: jwt; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/main.tsp index 6d370eaf..580ab6e3 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/main.tsp @@ -4,9 +4,13 @@ import "./models/core.tsp"; import "./subscriber-sip-endpoint"; import "./subscriber-addresses"; import "./subscriber-tokens"; +import "./guest-tokens"; +import "./invite-tokens"; +import "./refresh-tokens"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @@ -14,42 +18,63 @@ using Types.StatusCodes; // Define the API path for subscribers @route("/resources/subscribers") namespace FabricAPI.Subscribers { - @tag("Subscribers") - @friendlyName("Subscribers") - interface Subscribers { - @summary("List Subscribers") - list(): - SubscriberListResponse | - StatusCode401 | - StatusCode404; + @tag(SUBSCRIBERS_TAG) + @friendlyName("Subscribers") + interface Subscribers { + @summary("List Subscribers") + @doc("Retrieve a list of all subscribers") + list(): + | SubscriberListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; - @summary("Create Subscriber") - @post - create(@body body: SubscriberRequest): - { @statusCode statusCode: 201; @body subscriber: SubscriberResponse; } | - StatusCode401 | - StatusCode404 | - SubscriberCreateStatusCode422; + @summary("Create Subscriber") + @doc("Create a new Subscriber") + @post + create(@body body: SubscriberRequest): + | { + @statusCode statusCode: 201; + @body subscriber: SubscriberResponse; + } + | StatusCode401 + | StatusCode404 + | SubscriberCreateStatusCode422 + | StatusCode500; - @summary("Get Subscriber") - get(...SubscriberPathID): - { @statusCode statusCode: 200; @body body: SubscriberResponse; } | - StatusCode401 | - StatusCode404; + @summary("Get Subscriber") + @doc("Fetch an existing Subscriber") + get(...SubscriberPathID): + | { + @statusCode statusCode: 200; + @body body: SubscriberResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; - @summary("Update Subscriber") - @put - update(...SubscriberPathID, ...SubscriberRequest): - { @statusCode statusCode: 200; @body body: SubscriberResponse; } | - StatusCode401 | - StatusCode404 | - SubscriberUpdateStatusCode422; + @summary("Update Subscriber") + @doc("Update an existing Subsriber") + @put + update(...SubscriberPathID, ...SubscriberRequest): + | { + @statusCode statusCode: 200; + @body body: SubscriberResponse; + } + | StatusCode401 + | StatusCode404 + | SubscriberUpdateStatusCode422 + | StatusCode500; - @summary("Delete Subscriber") - @delete - delete(...SubscriberPathID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } -} \ No newline at end of file + @summary("Delete Subscriber") + @doc("Delete an existing Subscriber") + @delete + delete(...SubscriberPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/subscribers/models/core.tsp b/specs/signalwire-rest/fabric-api/subscribers/models/core.tsp index 81142e1a..19ed8a0e 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/models/core.tsp @@ -5,15 +5,17 @@ using Types; model SubscriberPathID { @doc("Unique ID of a Subscriber.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid - } - + id: uuid; +} model Subscriber { @doc("Unique ID of the Subscriber.") @example("d369a402-7b43-4512-8735-9d5e1f387814") - id: string; + @format("uuid") + id: uuid; @doc("Email of the Subscriber.") @example("johndoe@example.com") diff --git a/specs/signalwire-rest/fabric-api/subscribers/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/models/errors.tsp index ccbae972..734da2ca 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/models/errors.tsp @@ -3,15 +3,16 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ - type: "validation_error", - code: "missing_required_parameter", - message: "Required parameter is missing", - attribute: "password", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter" - }], + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "Required parameter is missing", + attribute: "password", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter", + } + ], }) model SubscriberCreateStatusCode422 is StatusCode422; model SubscriberUpdateStatusCode422 is SubscriberCreateStatusCode422; - diff --git a/specs/signalwire-rest/fabric-api/subscribers/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/models/requests.tsp index ad092397..c9cee6c6 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/models/requests.tsp @@ -4,48 +4,45 @@ import "@typespec/http"; using TypeSpec.Http; model SubscriberRequest { - - @doc("Password of the Subscriber. Defaults to a secure random password if not provided.") - @minLength(8) - @maxLength(72) - @example("password123") - password?: string; - - @doc("Email of the Subscriber.") - @example("johndoe@example.com") - email: string; - - @doc("First name of the Subscriber.") - @example("John") - first_name?: string; - - @doc("Last name of the Subscriber.") - @example("Doe") - last_name?: string; - - @doc("Display name of the Subscriber.") - @example("John Doe") - display_name?: string; - - @doc("Job title of the Subscriber.") - @example("Software Engineer") - job_title?: string; - - @doc("Timezone of the Subscriber.") - @example("America/New_York") - timezone?: string; - - @doc("Country of the Subscriber.") - @example("United States") - country?: string; - - @doc("Region of the Subscriber.") - @example("New York") - region?: string; - - @doc("Company name of the Subscriber.") - @example("SignalWire") - company_name?: string; - + @doc("Password of the Subscriber. Defaults to a secure random password if not provided.") + @minLength(8) + @maxLength(72) + @example("password123") + password?: string; + + @doc("Email of the Subscriber.") + @example("johndoe@example.com") + email: string; + + @doc("First name of the Subscriber.") + @example("John") + first_name?: string; + + @doc("Last name of the Subscriber.") + @example("Doe") + last_name?: string; + + @doc("Display name of the Subscriber.") + @example("John Doe") + display_name?: string; + + @doc("Job title of the Subscriber.") + @example("Software Engineer") + job_title?: string; + + @doc("Timezone of the Subscriber.") + @example("America/New_York") + timezone?: string; + + @doc("Country of the Subscriber.") + @example("United States") + country?: string; + + @doc("Region of the Subscriber.") + @example("New York") + region?: string; + + @doc("Company name of the Subscriber.") + @example("SignalWire") + company_name?: string; } - diff --git a/specs/signalwire-rest/fabric-api/subscribers/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/models/responses.tsp index a47333ba..dd701a42 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/models/responses.tsp @@ -1,4 +1,7 @@ import "./core.tsp"; +import "../../_shared/fabric-address"; +import "../../_shared/const.tsp"; +import "../../_shared/enums.tsp"; model SubscriberResponse { @doc("Unique ID of the request.") @@ -14,14 +17,15 @@ model SubscriberResponse { display_name: string; @doc("Type of the resource.") - type: "subscriber"; + @example(FabricResponseType.Subscriber) + type: FabricResponseType.Subscriber; @doc("Date and time when the resource was created.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) created_at: utcDateTime; @doc("Date and time when the resource was updated.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) updated_at: utcDateTime; @doc("Subscriber data.") @@ -29,20 +33,27 @@ model SubscriberResponse { } model SubscriberListResponse { + @doc("An array of objects that contain a list of Subscriber data") data: SubscriberResponse[]; + + @doc("Object containing pagination links") links: SubscriberPaginationResponse; } model SubscriberPaginationResponse { @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50") self: url; @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50") first: url; @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; + @example("https://example.signalwire.com/api/fabric/resources/subscribers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/main.tsp similarity index 61% rename from specs/signalwire-rest/fabric-api/subscriber-refresh-token/main.tsp rename to specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/main.tsp index 359e13ef..a20f2fa5 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/main.tsp @@ -2,23 +2,28 @@ import "@typespec/http"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; -import "../../types"; +import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/subscribers/tokens/refresh") namespace FabricAPI.SubscriberRefreshTokens { - @tag("Subscribers: Tokens") + @tag(SUBSCRIBERS_TOKENS_TAG) @friendlyName("Refresh Token") interface RefreshTokens { - @summary("Exchange a refresh token for a new subscriber access token") @doc("Exchanges a valid refresh token for a new subscriber access token and a new refresh token. The new access token is valid for 2 hours, and the new refresh token is valid for 2 hours and 5 minutes.") - @post create(...SubscriberRefreshTokenRequest): - { @statusCode statusCode: 201; @body subscriber_refresh_token: SubscriberRefreshTokenResponse; } | - StatusCode401 | - StatusCode404 | - RefreshTokenStatusCode422; + @post + create(...SubscriberRefreshTokenRequest): + | { + @statusCode statusCode: 201; + @body subscriber_refresh_token: SubscriberRefreshTokenResponse; + } + | StatusCode401 + | StatusCode404 + | RefreshTokenStatusCode422 + | StatusCode500; } } diff --git a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/errors.tsp similarity index 83% rename from specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/errors.tsp rename to specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/errors.tsp index 1b67b9a8..22e1ee61 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/errors.tsp @@ -1,4 +1,4 @@ -import "../../../types/status-codes"; +import "../../../../types/status-codes"; using Types.StatusCodes; @@ -9,7 +9,7 @@ using Types.StatusCodes; code: "token_expired", message: "Token has expired.", attribute: "refresh_token", - url: "https://developer.signalwire.com/rest/overview/error-codes#token_expired" + url: "https://developer.signalwire.com/rest/overview/error-codes#token_expired", } ], }) diff --git a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/requests.tsp similarity index 85% rename from specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/requests.tsp rename to specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/requests.tsp index 45977314..9f4c6495 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/requests.tsp @@ -1,5 +1,6 @@ model SubscriberRefreshTokenRequest { @doc("The refresh token previously issued alongside a subscriber access token. This token is used to request a new access token.") @example("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...") - refresh_token: string; + @format("jwt") + refresh_token: jwt; } diff --git a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/responses.tsp similarity index 80% rename from specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/responses.tsp rename to specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/responses.tsp index 775893c8..af12d646 100644 --- a/specs/signalwire-rest/fabric-api/subscriber-refresh-token/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/refresh-tokens/models/responses.tsp @@ -1,9 +1,11 @@ model SubscriberRefreshTokenResponse { @doc("A newly generated subscriber access token, valid for 2 hours.") @example("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...") - token: string; + @format("jwt") + token: jwt; @doc("A new refresh token, valid for 2 hours and 5 minutes.") @example("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...") - refresh_token: string; + @format("jwt") + refresh_token: jwt; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/main.tsp index 5d6c1d8a..c8580d55 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/main.tsp @@ -2,21 +2,23 @@ import "@typespec/http"; import "./models/responses.tsp"; import "../../../types"; import "./models/core.tsp"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; namespace FabricAPI.Subscribers.Addresses { - - @route("/{id}/addresses") - @tag("Subscribers") - @friendlyName("Subscriber Addresses") - @summary("Subscriber Addresses") - interface SubscriberAddresses { - - @summary("List Subscriber Addresses") - list(...SubscriberAddressID): SubscriberAddressesResponse[] | - StatusCode401 | - StatusCode404; - } + @route("/{id}/addresses") + @tag(SUBSCRIBERS_TAG) + @friendlyName("Subscriber Addresses") + @summary("Subscriber Addresses") + interface SubscriberAddresses { + @summary("List Subscriber Addresses") + @doc("List Subscriber Addresses") + list(...SubscriberAddressID): + | SubscriberAddressesResponse[] + | StatusCode401 + | StatusCode404 + | StatusCode500; + } } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/core.tsp index bcd981ff..1dcf7528 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/core.tsp @@ -5,61 +5,8 @@ using TypeSpec.Http; model SubscriberAddressID { @doc("Unique ID of a Subscriber Address.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid -} - - -model SubscriberAddress { - @doc("Unique ID of a Subscriber Address.") - @example("acaa5c49-be5e-4477-bce0-48f4b23b7720") id: uuid; - - @doc("Unique ID of a Subscriber Address.") - @example("acaa5c49-be5e-4477-bce0-48f4b23b7720") - resource_id: uuid; - - @doc("Name of the Subscriber Address.") - @example("reception") - name: string; - - @doc("Display Name of the Subscriber Address.") - @example("Reception") - display_name: string; - - @doc("Type of the Subscriber Address.") - @example("room") - type: string; - - @doc("Cover URL of the Subscriber Address.") - @example("https://example.com/cover.webp") - cover_url: url; - - @doc("Preview URL of the Subscriber Address.") - @example("https://example.com/preview.webp") - preview_url: url; - - channels: { - @doc("Video Channel of the Subscriber Address.") - @example("/public/reception?channel=video") - video: string; - - @doc("Audio Channel of the Subscriber Address.") - @example("/public/reception?channel=audio") - audio: string; - - @doc("Messaging Channel of the Subscriber Address.") - @example("/public/reception?channel=messaging") - messaging: string; - } - - - - - - - - - } - diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/responses.tsp index 8ace4bb8..9d7219f3 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-addresses/models/responses.tsp @@ -1,21 +1,28 @@ import "./core.tsp"; +import "../../../_shared/fabric-address"; model SubscriberAddressesResponse { - data: SubscriberAddress[]; - links: SubscriberAddressPaginationResponse; - } - - model SubscriberAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; - } - \ No newline at end of file + @doc("An array of objects that contain a list of Subscriber addresses") + data: FabricAddressSubscriber[]; + + @doc("Object containing pagination links") + links: SubscriberAddressPaginationResponse; +} + +model SubscriberAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("Link of the previous page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/main.tsp index 93739882..49f5f3a5 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/main.tsp @@ -5,53 +5,74 @@ import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/{fabric_subscriber_id}/sip_endpoints") namespace FabricAPI.Subscribers.SipEndpoints { - @tag("Subscribers: SIP Endpoints") + @tag(SUBSCRIBER_SIP_ENDPOINT_TAG) @friendlyName("SIP Endpoints") interface SubscriberSipEndpoint { @summary("List Subscriber SIP Endpoints") @doc("A list of Sip Endpoints of the Subscriber") list(...FabricSubscriberID): - SubscriberSipEndpointListResponse | - StatusCode401 | - StatusCode404; + | SubscriberSipEndpointListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Get Subscriber SIP Endpoint") @doc("Returns a Subscriber Sip Endpoint by ID") - read(...SIPEndpointID, ...FabricSubscriberID): { - @statusCode statusCode: 200; - @body subscriber_sip_endpoint: SIPEndpoint; - } | - StatusCode401 | - StatusCode404; + read(...SIPEndpointID, ...FabricSubscriberID): + | { + @statusCode statusCode: 200; + @body subscriber_sip_endpoint: SubscriberSIPEndpoint; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Create Subscriber SIP Endpoint") @doc("Creates a Subscriber Sip Endpoint") - @post create(...FabricSubscriberID, @body body: SubscriberSipEndpointRequest): - { @statusCode statusCode: 201; @body subscriber_sip_endpoint: SIPEndpoint; } | - StatusCode401 | - StatusCode404 | - SipEndpointCreateStatusCode422; + @post + create(...FabricSubscriberID, @body body: SubscriberSipEndpointRequest): + | { + @statusCode statusCode: 201; + @body subscriber_sip_endpoint: SubscriberSIPEndpoint; + } + | StatusCode401 + | StatusCode404 + | SipEndpointCreateStatusCode422 + | StatusCode500; @summary("Update Subscriber SIP Endpoint") @doc("Updates a Subscriber Sip Endpoint by ID") - @patch(#{ implicitOptionality: true }) update(...SIPEndpointID, ...FabricSubscriberID, @body body: SubscriberSipEndpointRequest): { - @statusCode statusCode: 200; @body subscriber_sip_endpoint: SIPEndpoint; - } | - StatusCode401 | - StatusCode404 | - SipEndpointUpdateStatusCode422; + @patch(#{ implicitOptionality: true }) + update( + ...SIPEndpointID, + ...FabricSubscriberID, + @body body: SubscriberSipEndpointRequest, + ): + | { + @statusCode statusCode: 200; + @body subscriber_sip_endpoint: SubscriberSIPEndpoint; + } + | StatusCode401 + | StatusCode404 + | SipEndpointUpdateStatusCode422 + | StatusCode500; @summary("Delete Subscriber SIP Endpoint") @doc("Deletes a Subscriber Sip Endpoint by ID") - @delete delete(...SIPEndpointID, ...FabricSubscriberID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } + @delete + delete(...SIPEndpointID, ...FabricSubscriberID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/core.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/core.tsp index 50f7b4d3..4413dd61 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/core.tsp @@ -3,20 +3,23 @@ import "../../../../types"; using TypeSpec.Http; - model FabricSubscriberID { @doc("Unique ID of a Fabric Subscriber.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - fabric_subscriber_id: uuid + fabric_subscriber_id: uuid; } model SIPEndpointID { @doc("Unique ID of a Sip Endpoint.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid + id: uuid; } -model SIPEndpoint { +model SubscriberSIPEndpoint { @doc("Unique ID of the Sip Endpoint.") @example("acaa5c49-be5e-4477-bce0-48f4b23b7720") id: uuid; @@ -34,12 +37,12 @@ model SIPEndpoint { send_as: string; @doc("Ciphers of the Sip Endpoint.") - ciphers: CipherTypeArray; + ciphers: Ciphers[]; @doc("Codecs of the Sip Endpoint.") - codecs: CodecTypeArray; + codecs: Codecs[]; @doc("Encryption requirement of the Sip Endpoint.") - @example(EncryptionType.Optional) - encryption: EncryptionType; + @example(Encryption.Optional) + encryption: Encryption; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/enums.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/enums.tsp index 6826520d..1dc83da7 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/enums.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/enums.tsp @@ -1,29 +1 @@ -@doc("Ciphers") -enum CipherType { - Type1: "AEAD_AES_256_GCM_8", - Type2: "AES_256_CM_HMAC_SHA1_80", - Type3: "AES_CM_128_HMAC_SHA1_80", - Type4: "AES_256_CM_HMAC_SHA1_32", - Type5: "AES_CM_128_HMAC_SHA1_32" -} - -@doc("Codecs") -enum CodecType { - Opus: "OPUS", - G722: "G722", - Pcmu: "PCMU", - Pcma: "PCMA", - G729: "G729", - Vp8: "VP8", - H264: "H264" -} - -@doc("Encryption") -enum EncryptionType { - Default: "default", - Required: "required", - Optional: "optional", -} - -alias CodecTypeArray = CodecType[]; -alias CipherTypeArray = CipherType[]; +import "../../../../_globally_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/errors.tsp index fe7b4c1e..2c3c85f3 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/errors.tsp @@ -3,15 +3,16 @@ import "../../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ - type: "validation_error", - code: "invalid_parameter", - message: "Ciphers are invalid", - attribute: "ciphers", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter" - }], + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter", + message: "Ciphers are invalid", + attribute: "ciphers", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter", + } + ], }) model SipEndpointCreateStatusCode422 is StatusCode422; model SipEndpointUpdateStatusCode422 is SipEndpointCreateStatusCode422; - diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/requests.tsp index 8c8543e8..d5fba70e 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/requests.tsp @@ -1,4 +1,5 @@ import "@typespec/openapi3"; +import "../../../../_globally_shared/enums.tsp"; using TypeSpec.OpenAPI; @@ -20,12 +21,12 @@ model SubscriberSipEndpointRequest { send_as?: string; @doc("Ciphers of the Sip Endpoint.") - ciphers?: CipherTypeArray; + ciphers?: Ciphers[]; @doc("Codecs of the Sip Endpoint.") - codecs?: CodecTypeArray; + codecs?: Codecs[]; @doc("Encryption requirement of the Sip Endpoint.") - @example(EncryptionType.Optional) - encryption?: EncryptionType = EncryptionType.Default; + @example(Encryption.Optional) + encryption?: Encryption = Encryption.Default; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/responses.tsp index 43fb2b96..94498c76 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-sip-endpoint/models/responses.tsp @@ -1,18 +1,22 @@ model SubscriberSipEndpointListResponse { - data: SIPEndpoint[]; - links: PaginationResponse; + data: SubscriberSIPEndpoint[]; + links: SubscriberSipEndpointPaginationResponse; } -model PaginationResponse { +model SubscriberSipEndpointPaginationResponse { @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50") self: url; @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50") first: url; @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; + @example("https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next?: url; + + @doc("The link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/main.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/main.tsp index 898dcf39..acd8b1b6 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/main.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/main.tsp @@ -4,21 +4,22 @@ import "./models/core.tsp"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/subscribers/tokens") namespace FabricAPI.SubscriberTokens { - @tag("Subscribers: Tokens") - @friendlyName("Subscriber Access Tokens") + @tag(SUBSCRIBERS_TAG) interface SubscriberTokens { @summary("Create Subscriber Token") @doc("Create a Subscriber Token") create(...SubscriberTokenRequest): - SubscriberTokenResponse | - StatusCode401 | - StatusCode404 | - SubscriberTokenStatusCode422; + | SubscriberTokenResponse + | StatusCode401 + | StatusCode404 + | SubscriberTokenStatusCode422 + | StatusCode500; } } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/core.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/core.tsp index 848ab895..bd781171 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/core.tsp @@ -1,17 +1,18 @@ import "../../../../types"; - model SubscriberToken { + @doc("The ID of the subscriber that the token is associated with.") + @example("32d94154-9297-418c-9a85-4a69e0c67c30") + @format("uuid") + subscriber_id: uuid; - @doc("The ID of the subscriber that the token is associated with.") - @example("32d94154-9297-418c-9a85-4a69e0c67c30") - subscriber_id: uuid; - - @doc("The token that is associated with the subscriber.") - @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiU0FUIn0..HahMYxqt4uI14qSH.daMTBR53lfEfEFiVAhr0pPSRqZhEod_YzavoG9-4ieiRQvl8GtP3FFNx0VLfkJqNcjUNbAaiKrEMnfOtCnQjiq1Kn0Iq90MYdM00QJ7cTaQ88vfbqdE92p-d4oDeg6z_vAsgrFgEobmrlDQndKxCWOD921iYxyLP0vqNaokN3kIM06iAWu_UpnTYEeR1l068xhK2xb6P9wbI2FDKFQoMgCdbjvABF7RRyaEzUoaQ5_Wj53YO6PFYuYcPbqMhdtvSSQiK3Nw6bFer2OfFs6s2RTukRGsocgC5Q7pwQwzYky-YgrPCb-pVAJajVSXUJrayvOi8-TeyCpICW4zTeJa5icZ380cWtafUH4rEB_FOJciJf0BCy48ajbz0NE121uBl2mqA1HE0_mQA53UqVjbrbE9hVOfnN4KpwOfULhIjx54tIekJQgG-aK2AYsLPCDNhuSpHvdwJcTM0Gzy3mS2veyaDV8q2qN5F_F9OThTQzcfy.AXzVNrJc_pGVPsticsVM0w") - token: uuid; + @doc("The token that is associated with the subscriber.") + @format("jwt") + @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiU0FUIn0..HahMYxqt4uI14qSH.daMTBR53lfEfEFiVAhr0pPSRqZhEod_YzavoG9-4ieiRQvl8GtP3FFNx0VLfkJqNcjUNbAaiKrEMnfOtCnQjiq1Kn0Iq90MYdM00QJ7cTaQ88vfbqdE92p-d4oDeg6z_vAsgrFgEobmrlDQndKxCWOD921iYxyLP0vqNaokN3kIM06iAWu_UpnTYEeR1l068xhK2xb6P9wbI2FDKFQoMgCdbjvABF7RRyaEzUoaQ5_Wj53YO6PFYuYcPbqMhdtvSSQiK3Nw6bFer2OfFs6s2RTukRGsocgC5Q7pwQwzYky-YgrPCb-pVAJajVSXUJrayvOi8-TeyCpICW4zTeJa5icZ380cWtafUH4rEB_FOJciJf0BCy48ajbz0NE121uBl2mqA1HE0_mQA53UqVjbrbE9hVOfnN4KpwOfULhIjx54tIekJQgG-aK2AYsLPCDNhuSpHvdwJcTM0Gzy3mS2veyaDV8q2qN5F_F9OThTQzcfy.AXzVNrJc_pGVPsticsVM0w") + token: jwt; - @doc("Refresh token.") - @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiUmVmcmVzaCIsImNoIjoidGVzdHB1Yy5zaWduYWx3aXJlLmNvbSJ9..sHcQL_V1tZH2JEAh.FNKYe_49CazNthkgSphf-ov8_I2wGLGWKD6t2q7kiG0guBxBjGzpgD8Y-LM-Nu7ePRUg7Z6vBkKAvh3rjtZpkeXoRXobJ1lov9AO72l8tB9K9RLo-TnBxLDbh0BCDGWVBgGq8DOh9kzHz4Tot-_B8pHXY_bqXX5kC4UUszXCO9nhSi1a4rp6QMD_8b0Mm8pHDK9EtW8I-tfM0HPmXuPMuOnlft3hmZo3tiKN2CarWscveQPCGetufHfQJJssdHjjYup8USAX0gJM8dpsV7FpF9fxfpy4ZU7N9MJXgSYJM5cPrxpLLx3Lj291egob14jDkn7kZQpv7jbCtsGyYxC7HAi1FgGr_sw3AeGaf2esGCkaeE11MxL05_kwdiNYBSOaHqaY62kOzu5pIdfTKQekOogCS1fgiyBgisBZeSIEBWWF.neE9KnL5AzS165dXFXUqhQ") - refresh_token: uuid; + @doc("Refresh token.") + @format("jwt") + @example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiUmVmcmVzaCIsImNoIjoidGVzdHB1Yy5zaWduYWx3aXJlLmNvbSJ9..sHcQL_V1tZH2JEAh.FNKYe_49CazNthkgSphf-ov8_I2wGLGWKD6t2q7kiG0guBxBjGzpgD8Y-LM-Nu7ePRUg7Z6vBkKAvh3rjtZpkeXoRXobJ1lov9AO72l8tB9K9RLo-TnBxLDbh0BCDGWVBgGq8DOh9kzHz4Tot-_B8pHXY_bqXX5kC4UUszXCO9nhSi1a4rp6QMD_8b0Mm8pHDK9EtW8I-tfM0HPmXuPMuOnlft3hmZo3tiKN2CarWscveQPCGetufHfQJJssdHjjYup8USAX0gJM8dpsV7FpF9fxfpy4ZU7N9MJXgSYJM5cPrxpLLx3Lj291egob14jDkn7kZQpv7jbCtsGyYxC7HAi1FgGr_sw3AeGaf2esGCkaeE11MxL05_kwdiNYBSOaHqaY62kOzu5pIdfTKQekOogCS1fgiyBgisBZeSIEBWWF.neE9KnL5AzS165dXFXUqhQ") + refresh_token: jwt; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/errors.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/errors.tsp index 25912532..8294aa9e 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/errors.tsp @@ -3,12 +3,14 @@ import "../../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ - type: "validation_error", - code: "missing_required_parameter", - message: "Required parameter is missing", - attribute: "reference", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter" - }], + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "Required parameter is missing", + attribute: "reference", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter", + } + ], }) -model SubscriberTokenStatusCode422 is StatusCode422; \ No newline at end of file +model SubscriberTokenStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/requests.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/requests.tsp index 382d7b1e..b4b135fd 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/requests.tsp @@ -1,53 +1,52 @@ import "../../../../types"; model SubscriberTokenRequest { - - @doc("A string that uniquely identifies the subscriber. Often it's an email, but can be any other string.") - @example("john.doe@example.com") - reference: string; - - @doc("A unixtime (the number of seconds since 1970-01-01 00:00:00) at which the token should no longer be valid. Defaults to 'two hours from now'") - @example(1693823284) - expire_at?: integer; - - @doc("The ID of the application that the token is associated with.") - @example("123e4567-e89b-12d3-a456-426614174000") - application_id?: uuid; - - @doc("Set or update the subscriber's password. Omit this field or pass an empty string if you don't want to update the password.") - @example("password123") - password?: string; - - @doc("Set or update the first name of the subscriber.") - @example("John") - first_name?: string; - - @doc("Set or update the last name of the subscriber.") - @example("Doe") - last_name?: string; - - @doc("Set or update the display name of the subscriber.") - @example("John Doe") - display_name?: string; - - @doc("Set or update the job title of the subscriber.") - @example("Software Engineer") - job_title?: string; - - @doc("Set or update the time zone of the subscriber.") - @example("America/New_York") - time_zone?: string; - - @doc("Set or update the country of the subscriber.") - @example("US") - country?: string; - - @doc("Set or update the region of the subscriber.") - @example("CA") - region?: string; - - @doc("Set or update the company name of the subscriber.") - @example("SignalWire") - company_name?: string; - + @doc("A string that uniquely identifies the subscriber. Often it's an email, but can be any other string.") + @example("john.doe@example.com") + reference: string; + + @doc("A unixtime (the number of seconds since 1970-01-01 00:00:00) at which the token should no longer be valid. Defaults to 'two hours from now'") + @example(1693823284) + expire_at?: integer; + + @doc("The ID of the application that the token is associated with.") + @example("123e4567-e89b-12d3-a456-426614174000") + @format("uuid") + application_id?: uuid; + + @doc("Set or update the subscriber's password. Omit this field or pass an empty string if you don't want to update the password.") + @example("password123") + password?: string; + + @doc("Set or update the first name of the subscriber.") + @example("John") + first_name?: string; + + @doc("Set or update the last name of the subscriber.") + @example("Doe") + last_name?: string; + + @doc("Set or update the display name of the subscriber.") + @example("John Doe") + display_name?: string; + + @doc("Set or update the job title of the subscriber.") + @example("Software Engineer") + job_title?: string; + + @doc("Set or update the time zone of the subscriber.") + @example("America/New_York") + time_zone?: string; + + @doc("Set or update the country of the subscriber.") + @example("US") + country?: string; + + @doc("Set or update the region of the subscriber.") + @example("CA") + region?: string; + + @doc("Set or update the company name of the subscriber.") + @example("SignalWire") + company_name?: string; } diff --git a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/responses.tsp b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/responses.tsp index 98f4e042..f83aa43e 100644 --- a/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/subscribers/subscriber-tokens/models/responses.tsp @@ -1,3 +1,3 @@ import "./core.tsp"; -model SubscriberTokenResponse is SubscriberToken {}; +model SubscriberTokenResponse is SubscriberToken; diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/addresses/main.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/main.tsp new file mode 100644 index 00000000..acd26a3e --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../../types"; +import "../../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/swml_scripts/{id}/addresses") +namespace FabricAPI.SWMLScript.Addresses { + @tag(SWML_SCRIPTS_TAG) + interface SWMLScriptAddresses { + @summary("List SWML Script Addresses") + @doc("This endpoints returns a list of addresses associated with a specific SWML script.") + list(...SWMLScriptAddressPathID): + | SWMLScriptAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/core.tsp new file mode 100644 index 00000000..b35d99ba --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/core.tsp @@ -0,0 +1,11 @@ +import "@typespec/http"; + +using TypeSpec.Http; + +model SWMLScriptAddressPathID { + @doc("The unique identifier of the SWML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: string; +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/responses.tsp new file mode 100644 index 00000000..b38982ea --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/addresses/models/responses.tsp @@ -0,0 +1,29 @@ +import "../../../_shared/fabric-address"; +import "../../../_shared/enums.tsp"; +import "../../../../types"; + +model SWMLScriptAddressListResponse { + @doc("An array of objects that contain a list of SWML Script Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: SWMLScriptAddressPaginationResponse; +} + +model SWMLScriptAddressPaginationResponse { + @doc("Link of the current page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_size=50") + self: url; + + @doc("Link of the first page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50") + first: url; + + @doc("Link of the next page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=2&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad") + next?: url; + + @doc("Link of the previous page") + @example("https://example.signalwire.com/api/fabric/resources/swml_script/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/main.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/main.tsp new file mode 100644 index 00000000..0f47027a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/main.tsp @@ -0,0 +1,75 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "./addresses"; +import "../../types"; +import "../tags.tsp"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/swml_scripts") +namespace FabricAPI.SwmlScripts { + @tag(SWML_SCRIPTS_TAG) + @friendlyName("SWML Scripts") + interface SwmlScripts { + @summary("List SWML Scripts") + @doc("A list of SWML Scripts") + list(): + | SwmlScriptListResponse[] + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Get SWML Script") + @doc("Returns a SWML Script by ID") + read(...SwmlScriptPathID): + | { + @statusCode statusCode: 200; + @body swml_script: SwmlScriptResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + + @summary("Create SWML Script") + @doc("Creates a SWML Script") + @post + create(@body request: SwmlScriptCreateRequest): + | { + @statusCode statusCode: 200; + @body swml_script: SwmlScriptResponse; + } + | StatusCode401 + | StatusCode404 + | SwmlScriptCreateStatusCode422 + | StatusCode500; + + @summary("Update SWML Script") + @doc("Updates a SWML Script by ID") + @put + update(...SwmlScriptPathID, @body request: SwmlScriptUpdateRequest): + | { + @statusCode statusCode: 200; + @body swml_script: SwmlScriptResponse; + } + | StatusCode401 + | StatusCode404 + | SwmlScriptUpdateStatusCode422 + | StatusCode500; + + @summary("Delete SWML Script") + @doc("Deletes a SWML Script by ID") + @delete + delete(...SwmlScriptPathID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/models/core.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/models/core.tsp new file mode 100644 index 00000000..9ed48f90 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/models/core.tsp @@ -0,0 +1,41 @@ +import "../../../types"; +import "../../_shared/const.tsp"; +import "../../_shared/enums.tsp"; + +using TypeSpec.Http; + +model SwmlScriptPathID { + @doc("Unique ID of a SWML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + id: uuid; +} + +model SwmlScript { + @doc("Unique ID of a SWML Script.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + id: uuid; + + @doc("The SWML script contents") + @example(SWML_EXAMPLE) + contents: string; + + @doc("The url where the SWML script is hosted at.") + @example("https://example.com/swml_script") + request_url: url; + + @doc("The displayed name of the SWML scipt") + @example("Booking Assistant") + display_name: string; + + @doc("URL to send status callbacks to") + @example("https://website.com/status") + @format("uri") + status_callback_url?: url; + + @doc("HTTP method to use for status callbacks") + @example(UrlMethodType.Post) + status_callback_method?: UrlMethodType.Post; +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/models/errors.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/models/errors.tsp new file mode 100644 index 00000000..08e5fa5b --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/models/errors.tsp @@ -0,0 +1,29 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "missing_required_parameter", + message: "contents is required", + attribute: "contents", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter", + } + ], +}) +model SwmlScriptCreateStatusCode422 is StatusCode422; + +@example(#{ + errors: #[ + #{ + type: "validation_error", + code: "invalid_parameter_value", + message: "contents must be valid SWML JSON", + attribute: "contents", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value", + } + ], +}) +model SwmlScriptUpdateStatusCode422 is StatusCode422; diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/models/requests.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/models/requests.tsp new file mode 100644 index 00000000..f0c7fdeb --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/models/requests.tsp @@ -0,0 +1,32 @@ +import "./core.tsp"; +import "../../_shared/const.tsp"; + +model SwmlScriptCreateRequest { + @doc("Display name of the SWML Script") + @example("Welcome Script") + name: string; + + @doc("The contents of the SWML script.") + @example(SWML_EXAMPLE) + contents: string; + + @doc("URL to send status callbacks to") + @example("https://example.com/status") + @format("uri") + status_callback_url?: url; +} + +model SwmlScriptUpdateRequest { + @doc("Display name of the SWML Script") + @example("Welcome Script") + display_name?: string; + + @doc("The contents of the SWML script.") + @example(SWML_EXAMPLE) + contents?: string; + + @doc("URL to send status callbacks to") + @example("https://example.com/status") + @format("uri") + status_callback_url?: url; +} diff --git a/specs/signalwire-rest/fabric-api/swml-scripts/models/responses.tsp b/specs/signalwire-rest/fabric-api/swml-scripts/models/responses.tsp new file mode 100644 index 00000000..2240aa58 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-scripts/models/responses.tsp @@ -0,0 +1,60 @@ +import "./core.tsp"; +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; + +model SwmlScriptResponse { + @doc("Unique ID of the SWML Script.") + @example("993ed018-9e79-4e50-b97b-984bd5534095") + @format("uuid") + id: uuid; + + @doc("Unique ID of the Project.") + @example("1313fe58-5e14-4c11-bbe7-6fdfa11fe780") + @format("uuid") + project_id: uuid; + + @doc("Display name of the SWML Script Fabric Resource") + @example("Welcome Script") + display_name: string; + + @doc("Type of the Fabric Resource") + @example(FabricResponseType.SwmlScript) + type: FabricResponseType.SwmlScript; + + @doc("Date and time when the resource was created.") + @example(UTC_TIME_EXAMPLE) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(UTC_TIME_EXAMPLE) + updated_at: utcDateTime; + + @doc("SWML Script data.") + swml_script: SwmlScript; +} + +model SwmlScriptListResponse { + @doc("An array of objects that contain a list of SWML Script data") + data: SwmlScriptResponse[]; + + @doc("Object containing pagination links") + links: SwmlScriptPaginationresponse; +} + +model SwmlScriptPaginationresponse { + @doc("Link to the current page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50&type=swml_script") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts?page_size=50&type=swml_script") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_script") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_script") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/core.tsp deleted file mode 100644 index 21803308..00000000 --- a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/core.tsp +++ /dev/null @@ -1,45 +0,0 @@ -import "@typespec/openapi3"; -import "./enums.tsp"; -import "../../../types"; - -using TypeSpec.Http; -using TypeSpec.OpenAPI; - -model SWMLWebhookIDPath { - @doc("Unique ID of a SWML Webhook.") - @path - swml_webhook_id: uuid -} - -model SWMLWebhookAddress { - @doc("Unique ID of the Fabric Address.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - id: uuid; - - @doc("Fabric resource ID that the Fabric Address belongs to.") - @example("691af061-cd86-4893-a605-173f47afc4c2") - resource_id: uuid; - - @doc("Name of the Fabric Address.") - @example("justice-league") - name: string; - - @doc("Display name of the Fabric Address.") - @example("Justice League") - display_name: string; - - @doc("Type of the Fabric Address.") - @example(DisplayTypes.App) - type: DisplayTypes; - - @doc("Cover url of the Fabric Address.") - @example("https://coverurl.com") - cover_url: string; - - @doc("Preview url of the Fabric Address.") - @example("https://previewurl.com") - preview_url: string; - - @doc("Channels of the Fabric Address.") - channel: AddressChannel; -} diff --git a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/enums.tsp deleted file mode 100644 index e7475bbe..00000000 --- a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/enums.tsp +++ /dev/null @@ -1 +0,0 @@ -import "./../../enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/responses.tsp deleted file mode 100644 index 4d7e518d..00000000 --- a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/models/responses.tsp +++ /dev/null @@ -1,18 +0,0 @@ -model SWMLWebhookAddressListResponse { - data: SWMLWebhookAddress[]; - links: SWMLWebhookAddressPaginationResponse; -} - -model SWMLWebhookAddressPaginationResponse { - @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - self: url; - - @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") - first: url; - - @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; -} diff --git a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/main.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/main.tsp similarity index 60% rename from specs/signalwire-rest/fabric-api/swml-webhook-addresses/main.tsp rename to specs/signalwire-rest/fabric-api/swml-webhook/addresses/main.tsp index 809aeb26..3cc8d2e7 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook-addresses/main.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/main.tsp @@ -2,22 +2,23 @@ import "@typespec/http"; import "@typespec/openapi"; import "./models/core.tsp"; import "./models/responses.tsp"; -import "../../types"; +import "../../../types"; +import "../../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; @route("/resources/swml_webhooks/{swml_webhook_id}/addresses") namespace FabricAPI.SWMLWebhookAddresses { - @tag("SWML Webhook") + @tag(SWML_WEBHOOK_TAG) @friendlyName("SWML Webhooks") interface SWMLWebhookAddresses { @summary("List SWML Webhook Addresses") - @doc("A list of SWML Webhook Addresses") + @doc("This endpoint returns a list of addresses associated with a specific SWML webhook.") list(...SWMLWebhookIDPath): - SWMLWebhookAddressListResponse | - StatusCode401 | - StatusCode404; + | SWMLWebhookAddressListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; } } - diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/core.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/core.tsp new file mode 100644 index 00000000..ed81a393 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/core.tsp @@ -0,0 +1,14 @@ +import "@typespec/openapi3"; +import "./enums.tsp"; +import "../../../../types"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +model SWMLWebhookIDPath { + @doc("Unique ID of a SWML Webhook.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") + @path + swml_webhook_id: uuid; +} diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/enums.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/enums.tsp new file mode 100644 index 00000000..36ac661a --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/enums.tsp @@ -0,0 +1 @@ +import "../../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/responses.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/responses.tsp new file mode 100644 index 00000000..7e57229d --- /dev/null +++ b/specs/signalwire-rest/fabric-api/swml-webhook/addresses/models/responses.tsp @@ -0,0 +1,27 @@ +import "../../../_shared/fabric-address"; + +model SWMLWebhookAddressListResponse { + @doc("An array of objects that contain a list of SWML Webhook Addresses") + data: FabricAddressApp[]; + + @doc("Object containing pagination links") + links: SWMLWebhookAddressPaginationResponse; +} + +model SWMLWebhookAddressPaginationResponse { + @doc("Link of the current paghe") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=swml_webhook") + self: url; + + @doc("Link to the first page") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=swml_webhook") + first: url; + + @doc("Link to the next page") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook") + next: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook") + prev?: url; +} diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/main.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/main.tsp index bcf65bf1..13a4543b 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/main.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/main.tsp @@ -4,54 +4,74 @@ import "./models/core.tsp"; import "./models/requests.tsp"; import "./models/responses.tsp"; import "./models/errors.tsp"; +import "./addresses"; import "../../types"; +import "../tags.tsp"; using TypeSpec.Http; using Types.StatusCodes; +const TEST = "SWML_WEBHOOK"; + @route("/resources/swml_webhooks") namespace FabricAPI.SWMLWebhooks { - @tag("SWML Webhook") + @tag(SWML_WEBHOOK_TAG) @friendlyName("SWML Webhooks") interface SWMLWebhooks { @summary("List SWML Webhooks") @doc("A list of SWML Webhooks") list(): - SWMLWebhookListResponse | - StatusCode401 | - StatusCode404; + | SWMLWebhookListResponse + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Get SWML Webhook") @doc("Returns an SWML Webhook by ID") - read(...SWMLWebhookID): { - @statusCode statusCode: 200; - @body swml_webhook: SWMLWebhookResponse; - } | - StatusCode401 | - StatusCode404; + read(...SWMLWebhookID): + | { + @statusCode statusCode: 200; + @body swml_webhook: SWMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; @summary("Create SWML Webhook") @doc("Creates an SWML Webhook") - @post create(...SWMLWebhookCreateRequest): - { @statusCode statusCode: 201; @body swml_webhook: SWMLWebhookResponse; } | - StatusCode401 | - StatusCode404 | - SwmlWebhookCreateStatusCode422; + @post + create(...SWMLWebhookCreateRequest): + | { + @statusCode statusCode: 201; + @body swml_webhook: SWMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | SwmlWebhookCreateStatusCode422 + | StatusCode500; + @summary("Update SWML Webhook") @doc("Updates an SWML Webhook by ID") - @patch(#{ implicitOptionality: true }) update(...SWMLWebhookID, ...SWMLWebhookUpdateRequest): { - @statusCode statusCode: 200; @body swml_webhook: SWMLWebhookResponse; - } | - StatusCode401 | - StatusCode404 | - SwmlWebhookUpdateStatusCode422; + @patch(#{ implicitOptionality: true }) + update(...SWMLWebhookID, ...SWMLWebhookUpdateRequest): + | { + @statusCode statusCode: 200; + @body swml_webhook: SWMLWebhookResponse; + } + | StatusCode401 + | StatusCode404 + | SwmlWebhookUpdateStatusCode422 + | StatusCode500; @summary("Delete SWML Webhook") @doc("Deletes an SWML Webhook by ID") - @delete delete(...SWMLWebhookID): - { @statusCode statusCode: 204; } | - StatusCode401 | - StatusCode404; - } + @delete + delete(...SWMLWebhookID): + | { + @statusCode statusCode: 204; + } + | StatusCode401 + | StatusCode404 + | StatusCode500; + } } - diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/models/core.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/models/core.tsp index fec7177c..d99815d7 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/models/core.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/models/core.tsp @@ -5,13 +5,16 @@ using TypeSpec.Http; model SWMLWebhookID { @doc("Unique ID of a SWML Webhook.") + @example("3fa85f64-5717-4562-b3fc-2c963f66afa6") + @format("uuid") @path - id: uuid + id: uuid; } model SWMLWebhook { @doc("Unique ID of the SWML Webhook.") @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + @format("uuid") id: uuid; @doc("Name of the SWML Webhook.") @@ -24,25 +27,25 @@ model SWMLWebhook { @doc("Primary request url of the SWML Webhook.") @example("https://primary.com") - primary_request_url: string; + primary_request_url: url; @doc("Primary request method of the SWML Webhook.") @example(UrlMethodType.Get) - primary_request_method: UrlMethodType; + primary_request_method: UrlMethodType.Get | UrlMethodType.Post; @doc("Fallback request url of the SWML Webhook.") @example("https://fallback.com") - fallback_request_url: string; + fallback_request_url: url | null; @doc("Fallback request method of the SWML Webhook.") @example(UrlMethodType.Get) - fallback_request_method: UrlMethodType; + fallback_request_method: UrlMethodType.Get | UrlMethodType.Post; @doc("Status callback url of the SWML Webhook.") @example("https://callback.com") - status_callback_url: string; + status_callback_url: url | null; @doc("Status callback method of the SWML Webhook.") @example(UrlMethodType.Post) - status_callback_method: UrlMethodType; + status_callback_method: UrlMethodType.Get | UrlMethodType.Post; } diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/models/enums.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/models/enums.tsp index e7475bbe..604e6c7b 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/models/enums.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/models/enums.tsp @@ -1 +1 @@ -import "./../../enums.tsp"; +import "../../_shared/enums.tsp"; diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/models/errors.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/models/errors.tsp index f5816690..32e965be 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/models/errors.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/models/errors.tsp @@ -3,14 +3,16 @@ import "../../../types/status-codes"; using Types.StatusCodes; @example(#{ - errors: #[#{ + errors: #[ + #{ type: "validation_error", code: "http_url_required", message: "This value must be an HTTP or HTTPS URL.", attribute: "status_callback_url", - url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required" - }], - }) - model SwmlWebhookCreateStatusCode422 is StatusCode422; + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required", + } + ], +}) +model SwmlWebhookCreateStatusCode422 is StatusCode422; - model SwmlWebhookUpdateStatusCode422 is SwmlWebhookCreateStatusCode422; +model SwmlWebhookUpdateStatusCode422 is SwmlWebhookCreateStatusCode422; diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/models/requests.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/models/requests.tsp index 8bcfbe36..d6579af7 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/models/requests.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/models/requests.tsp @@ -9,27 +9,27 @@ model SWMLWebhookCreateRequest { @doc("Primary request url of the SWML Webhook.") @example("https://primary.com") - primary_request_url: string; + primary_request_url: url; @doc("Primary request method of the SWML Webhook.") - @example("GET") - primary_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + primary_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Fallback request url of the SWML Webhook.") @example("https://fallback.com") - fallback_request_url?: string; + fallback_request_url?: url; @doc("Fallback request method of the SWML Webhook.") - @example("GET") - fallback_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + fallback_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Status callback url of the SWML Webhook.") @example("https://callback.com") - status_callback_url?: string; + status_callback_url?: url; @doc("Status callback method of the SWML Webhook.") - @example("POST") - status_callback_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; } model SWMLWebhookUpdateRequest { @@ -43,25 +43,25 @@ model SWMLWebhookUpdateRequest { @doc("Primary request url of the SWML Webhook.") @example("https://primary.com") - primary_request_url?: string; + primary_request_url?: url; @doc("Primary request method of the SWML Webhook.") - @example("GET") - primary_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + primary_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Fallback request url of the SWML Webhook.") @example("https://fallback.com") - fallback_request_url?: string; + fallback_request_url?: url; @doc("Fallback request method of the SWML Webhook.") - @example("GET") - fallback_request_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + fallback_request_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; @doc("Status callback url of the SWML Webhook.") @example("https://callback.com") - status_callback_url?: string; + status_callback_url?: url; @doc("Status callback method of the SWML Webhook.") - @example("POST") - status_callback_method?: "GET" | "POST" = "POST"; + @example(UrlMethodType.Get) + status_callback_method?: UrlMethodType.Get | UrlMethodType.Post = UrlMethodType.Post; } diff --git a/specs/signalwire-rest/fabric-api/swml-webhook/models/responses.tsp b/specs/signalwire-rest/fabric-api/swml-webhook/models/responses.tsp index 92f6dc89..06f3e927 100644 --- a/specs/signalwire-rest/fabric-api/swml-webhook/models/responses.tsp +++ b/specs/signalwire-rest/fabric-api/swml-webhook/models/responses.tsp @@ -1,12 +1,15 @@ - +import "../../_shared/enums.tsp"; +import "../../_shared/const.tsp"; model SWMLWebhookResponse { @doc("Unique ID of the SWML Webhook.") @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + @format("uuid") id: uuid; @doc("Unique ID of the Project.") @example("99151cf8-9548-4860-ba70-a8de824f3312") + @format("uuid") project_id: uuid; @doc("Display name of the SWML Webhook Fabric Resource") @@ -14,15 +17,15 @@ model SWMLWebhookResponse { display_name: string; @doc("Type of the Fabric Resource") - @example("swml_webhook") - type: string; + @example(FabricResponseType.SwmlWebhook) + type: FabricResponseType.SwmlWebhook; @doc("Date and time when the resource was created.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) created_at: utcDateTime; @doc("Date and time when the resource was updated.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + @example(UTC_TIME_EXAMPLE) updated_at: utcDateTime; @doc("SWML Webhook data.") @@ -30,20 +33,27 @@ model SWMLWebhookResponse { } model SWMLWebhookListResponse { + @doc("An array of objects that contain a list of SWML Webhook data") data: SWMLWebhookResponse[]; + + @doc("Object containing pagination links") links: SWMLWebhookPaginationResponse; } model SWMLWebhookPaginationResponse { @doc("Link of the current page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&type=swml_webhook") self: url; @doc("Link to the first page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&type=swml_webhook") first: url; @doc("Link to the next page") - @example("https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") - next: url; + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook") + next?: url; + + @doc("Link to the previous page") + @example("https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook") + prev?: url; } diff --git a/specs/signalwire-rest/fabric-api/tags.tsp b/specs/signalwire-rest/fabric-api/tags.tsp new file mode 100644 index 00000000..0bb8b885 --- /dev/null +++ b/specs/signalwire-rest/fabric-api/tags.tsp @@ -0,0 +1,211 @@ +import "@typespec/openapi3"; + +const AI_CUSTOM_TAG = "AI Agents: Custom"; + +const AI_CUSTOM_TAG_METADATA = #{ + description: "Endpoints related to creating & managing SignalWire AI Agents", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/ai-agents-custom", + description: "Developer documentation on SignalWire AI Agent, Fabric API endpoints", + }, +}; + +const AI_DIALOGFLOW_TAG = "AI Agents: Dialogflow"; + +const AI_DIALOGFLOW_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Dialogflow Agents", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/ai-agents-dialogflow", + description: "Developer documentation on Dialogflow Agent, Fabric API endpoints", + }, +}; + +const CALL_FLOWS_TAG = "Call Flows"; + +const CALL_FLOWS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Call Flows", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/call-flows", + description: "Developer documentation on Call Flow, Fabric API endpoints", + }, +}; + +const EMBEDS_TOKENS_TAG = "Embeds Tokens"; + +const EMBEDS_TOKENS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Embed Tokens", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/embeds-tokens", + description: "Developer documentation on Embed Tokens, Fabric API endpoints", + }, +}; + +const SWML_WEBHOOK_TAG = "SWML Webhook"; + +const SMWL_WEBHOOK_TAG_METADATA = #{ + description: "Endpoints related to creating & managing SWML Webhooks", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/swml-webhook", + description: "Developer documentation on SWML Webhooks, Fabric API endpoints", + }, +}; + +const FABRIC_ADDRESS_TAG = "Fabric Address"; + +const FABRIC_ADDRESS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Fabric Addresses", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/fabric-address", + description: "Developer documentation on Fabric Address, Fabric API endpoints", + }, +}; + +const FREESWITCH_CONNECTOR_TAG = "FreeSWITCH Connector"; + +const FREESWITCH_CONNECTOR_TAG_METADATA = #{ + description: "Endpoints related to creating & managing FreeSWITCH Connectors", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/free-switch-connectors", + description: "Developer documentation on FreeSWITCH Connector, Fabric API endpoints", + }, +}; + +const CXML_APPLICATIONS_TAG = "CXML Applications"; + +const CXML_APPLICATIONS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing cXML Applications", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-applications", + description: "Developer documentation on cXML Application, Fabric API endpoints", + }, +}; + +const CXML_SCRIPTS_TAG = "CXML Scripts"; + +const CXML_SCRIPTS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing cXML Scripts", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-scripts", + description: "Developer documentation on cXML Scripts, Fabric API endpoints", + }, +}; + +const CXML_WEBHOOK_TAG = "CXML Webhook"; + +const CXML_WEBHOOK_TAG_METADATA = #{ + description: "Endpoints related to creating & managing cXML Webhooks", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-webhook", + description: "Developer documentation on cXML Webhook, Fabric API endpoints", + }, +}; + +const RELAY_APPLICATION_TAG = "Relay Application"; + +const RELAY_APPLICATION_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Relay Applications", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/relay-application", + description: "Developer documentation on Relay Application, Fabric API endpoints", + }, +}; + +const RESOURCES_TAG = "Resources"; + +const RESOURCES_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Resources", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/resources", + description: "Developer documentation on Resource, Fabric API endpoints", + }, +}; + +const SIP_ENDPOINTS_TAG = "SIP Endpoints"; + +const SIP_ENDPOINTS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing SIP Endpoints", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/sip-endpoints", + description: "Developer documentation on SIP Endpoint, Fabric API endpoints", + }, +}; + +const SIP_GATEWAY_TAG = "SIP Gateway"; + +const SIP_GATEWAY_TAG_METADATA = #{ + description: "Endpoints related to creating & managing SIP Gateways", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/rest/signalwire-rest/endpoints/fabric/sip-gateway", + description: "Developer documentation on SIP Gateway, Fabric API endpoints", + }, +}; + +const SUBSCRIBERS_TAG = "Subscribers"; + +const SUBSCRIBERS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Subscribers", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers", + description: "Developer documentation on Subscriber, Fabric API endpoints", + }, +}; + +const SUBSCRIBERS_TOKENS_TAG = "Subscribers: Tokens"; + +const SUBSCRIBERS_TOKENS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Subscriber tokens", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers-tokens", + description: "Developer documentation on Subscriber token, Fabric API endpoints", + }, +}; + +const SUBSCRIBER_SIP_ENDPOINT_TAG = "Subscribers: SIP Endpoints"; + +const SUBSCRIBER_SIP_ENDPOINT_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Subscriber SIP Endpoints", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers-sip-endpoints", + description: "Developer documentation on Subscriber SIP Endpoint, Fabric API endpoints", + }, +}; + +const SWML_SCRIPTS_TAG = "SWML Scripts"; + +const SWML_SCRIPTS_TAG_METADATA = #{ + description: "Endpoints related to creating & managing SWML Scripts", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/swml-scripts", + description: "Developer documentation on SWML Script, Fabric API endpoints", + }, +}; + +const CONFERENCE_ROOM_TAG = "Conference Rooms"; + +const CONFERENCE_ROOM_TAG_METADATA = #{ + description: "Endpoints related to creating & managing Conference Rooms", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/conference-rooms", + description: "Developer documentation on Conference Room, Fabric API endpoints", + }, +}; + +const DOMAIN_APPLICATIONS_TAG = "Domain Applications"; + +const DOMAIN_APPLICATIONS_TAG_METADATA = #{ + description: "Endpoints related to managing Domain Applications", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/domain-applications", + description: "Developer documentation on Domain Application, Fabric API endpoints", + }, +}; + +const PHONE_ROUTES_TAG = "Phone Routes"; + +const PHONE_ROUTES_TAG_METADATA = #{ + description: "Endpoints related to managing Phone Routes", + externalDocs: #{ + url: "https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/domain-applications", + description: "Developer documentation on Phone Routes, Fabric API endpoints", + }, +}; diff --git a/specs/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml b/specs/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml index 6d1f8a49..1513e2ca 100644 --- a/specs/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/specs/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -1,26 +1,132 @@ openapi: 3.0.0 info: title: Call Fabric API + version: 1.0.0 + contact: + name: SignalWire + url: https://support.signalwire.com/portal/en/newticket?departmentId=1029313000000006907&layoutId=1029313000000074011 + email: support@signalwire.com + license: + name: MIT + url: https://github.com/signalwire/docs/blob/main/LICENSE + termsOfService: https://signalwire.com/legal/signalwire-cloud-agreement description: API to access/manage SignalWire's Call Fabric objects. - version: 0.0.0 +externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric + description: The Fabric API holds a collection of endpoints that will help you in managing and creating your SignalWire Resources. tags: - - name: Fabric Address + - name: Phone Routes + description: Endpoints related to managing Phone Routes + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/domain-applications + description: Developer documentation on Phone Routes, Fabric API endpoints + - name: Domain Applications + description: Endpoints related to managing Domain Applications + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/domain-applications + description: Developer documentation on Domain Application, Fabric API endpoints + - name: Conference Rooms + description: Endpoints related to creating & managing Conference Rooms + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/conference-rooms + description: Developer documentation on Conference Room, Fabric API endpoints + - name: SWML Scripts + description: Endpoints related to creating & managing SWML Scripts + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/swml-scripts + description: Developer documentation on SWML Script, Fabric API endpoints - name: 'Subscribers: SIP Endpoints' - - name: Subscribers + description: Endpoints related to creating & managing Subscriber SIP Endpoints + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers-sip-endpoints + description: Developer documentation on Subscriber SIP Endpoint, Fabric API endpoints - name: 'Subscribers: Tokens' + description: Endpoints related to creating & managing Subscriber tokens + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers-tokens + description: Developer documentation on Subscriber token, Fabric API endpoints + - name: Subscribers + description: Endpoints related to creating & managing Subscribers + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/subscribers + description: Developer documentation on Subscriber, Fabric API endpoints + - name: SIP Gateway + description: Endpoints related to creating & managing SIP Gateways + externalDocs: + url: https://developer.signalwire.com/rest/rest/signalwire-rest/endpoints/fabric/sip-gateway + description: Developer documentation on SIP Gateway, Fabric API endpoints + - name: SIP Endpoints + description: Endpoints related to creating & managing SIP Endpoints + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/sip-endpoints + description: Developer documentation on SIP Endpoint, Fabric API endpoints + - name: Resources + description: Endpoints related to creating & managing Resources + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/resources + description: Developer documentation on Resource, Fabric API endpoints + - name: Relay Application + description: Endpoints related to creating & managing Relay Applications + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/relay-application + description: Developer documentation on Relay Application, Fabric API endpoints + - name: CXML Webhook + description: Endpoints related to creating & managing cXML Webhooks + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-webhook + description: Developer documentation on cXML Webhook, Fabric API endpoints + - name: CXML Scripts + description: Endpoints related to creating & managing cXML Scripts + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-scripts + description: Developer documentation on cXML Scripts, Fabric API endpoints + - name: CXML Applications + description: Endpoints related to creating & managing cXML Applications + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/cxml-applications + description: Developer documentation on cXML Application, Fabric API endpoints + - name: FreeSWITCH Connector + description: Endpoints related to creating & managing FreeSWITCH Connectors + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/free-switch-connectors + description: Developer documentation on FreeSWITCH Connector, Fabric API endpoints + - name: Fabric Address + description: Endpoints related to creating & managing Fabric Addresses + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/fabric-address + description: Developer documentation on Fabric Address, Fabric API endpoints - name: SWML Webhook - - name: 'AI Agents: Custom' - - name: AI Agent - - name: cXML Webhook + description: Endpoints related to creating & managing SWML Webhooks + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/swml-webhook + description: Developer documentation on SWML Webhooks, Fabric API endpoints - name: Embeds Tokens - - name: SIP Gateway + description: Endpoints related to creating & managing Embed Tokens + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/embeds-tokens + description: Developer documentation on Embed Tokens, Fabric API endpoints + - name: Call Flows + description: Endpoints related to creating & managing Call Flows + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/call-flows + description: Developer documentation on Call Flow, Fabric API endpoints + - name: 'AI Agents: Dialogflow' + description: Endpoints related to creating & managing Dialogflow Agents + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/ai-agents-dialogflow + description: Developer documentation on Dialogflow Agent, Fabric API endpoints + - name: 'AI Agents: Custom' + description: Endpoints related to creating & managing SignalWire AI Agents + externalDocs: + url: https://developer.signalwire.com/rest/signalwire-rest/endpoints/fabric/ai-agents-custom + description: Developer documentation on SignalWire AI Agent, Fabric API endpoints paths: /addresses: get: operationId: FabricAddresses_list summary: List Fabric Addresses description: |- - A list of Fabric Addresses. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) wich can be + A list of Fabric Addresses. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) which can be generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). parameters: [] responses: @@ -33,19 +139,21 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - Fabric Address security: @@ -55,7 +163,7 @@ paths: operationId: FabricAddresses_read summary: Get Fabric Address description: |- - Returns a Fabric Address by ID. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) wich can be + Returns a Fabric Address by ID. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) which can be generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). parameters: - $ref: '#/components/parameters/FabricAddressID' @@ -69,19 +177,21 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - Fabric Address security: @@ -102,23 +212,33 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - anyOf: - - type: string - enum: - - Unauthorized - - type: string - enum: - - Forbidden + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '403': + description: Access is forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode403' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/EmbedTokenCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - Embeds Tokens requestBody: @@ -133,7 +253,7 @@ paths: post: operationId: GuestTokens_create summary: Create Subscriber Guest Token - description: Creates a Subscriber Guest Token to be used for server-side API calls. The token is authorized using an existing API token. + description: Creates a Subscriber Guest Token. The token is authorized using an existing API token. parameters: [] responses: '201': @@ -145,25 +265,27 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/GuestTokenCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'Subscribers: Tokens' requestBody: @@ -172,6 +294,39 @@ paths: application/json: schema: $ref: '#/components/schemas/SubscriberGuestTokenCreateRequest' + /resources: + get: + operationId: Resources_list + summary: List Resources + description: A list of Fabric Resources + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Resources /resources/ai_agents: get: operationId: AIAgents_list @@ -188,19 +343,21 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'AI Agents: Custom' post: @@ -218,25 +375,27 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/AIAgentCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'AI Agents: Custom' requestBody: @@ -249,7 +408,7 @@ paths: get: operationId: AIAgentAddresses_list summary: List AI Agent Addresses - description: A list of AI Agent Addresses + description: This endpoint returns a list of addresses associated with a specific AI Agent. parameters: - $ref: '#/components/parameters/AIAgentIDPath' responses: @@ -262,21 +421,23 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - AI Agent + - 'AI Agents: Custom' /resources/ai_agents/{id}: get: operationId: AIAgents_read @@ -294,19 +455,21 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'AI Agents: Custom' patch: @@ -325,25 +488,27 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/AIAgentUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'AI Agents: Custom' requestBody: @@ -364,233 +529,360 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - 'AI Agents: Custom' - /resources/cxml_webhooks: + /resources/call_flow/{id}/addresses: get: - operationId: CXMLWebhooks_list - summary: List cXML Webhooks - description: A list of cXML Webhooks - parameters: [] + operationId: CallFlowAddresses_list + summary: List Call Flow Addresses + description: This endpoint returns a list of addresses associated with a specific Call Flow. + parameters: + - $ref: '#/components/parameters/CallFlowAddressPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookListResponse' + $ref: '#/components/schemas/CallFlowAddressListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Call Flows + /resources/call_flow/{id}/versions: + get: + operationId: CallFlowVersions_list + summary: List Call Flow Versions + description: Returns a list of versions of a Call Flow. + parameters: + - $ref: '#/components/parameters/CallFlowVersionPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowVersionListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook + - Call Flows post: - operationId: CXMLWebhooks_create - summary: Create cXML Webhook - description: Creates an cXML Webhook - parameters: [] + operationId: CallFlowVersions_deploy + summary: Deploy a Call Flow Version + description: Deploys a specific version of a Call Flow. + parameters: + - $ref: '#/components/parameters/CallFlowVersionPathID' responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookResponse' + $ref: '#/components/schemas/CallFlowVersionDeployResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookCreateStatusCode422' + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook + - Call Flows requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookCreateRequest' - /resources/cxml_webhooks/{cxml_webhook_id}/addresses: + $ref: '#/components/schemas/CallFlowVersionDeployRequest' + /resources/call_flows: get: - operationId: CXMLWebhookAddresses_list - summary: List cXML Webhook Addresses - description: A list of cXML Webhook Addresses - parameters: - - $ref: '#/components/parameters/CXMLWebhookIDPath' + operationId: CallFlows_list + summary: List Call Flows + description: A list of Call Flows + parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookAddressListResponse' + $ref: '#/components/schemas/CallFlowListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook - /resources/cxml_webhooks/{id}: - get: - operationId: CXMLWebhooks_read - summary: Get cXML Webhook - description: Returns an cXML Webhook by ID - parameters: - - $ref: '#/components/parameters/CXMLWebhookID' + - Call Flows + post: + operationId: CallFlows_create + summary: Create Call Flow + description: Creates a Call Flow + parameters: [] responses: - '200': - description: The request has succeeded. + '201': + description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookResponse' + $ref: '#/components/schemas/CallFlowResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook - patch: - operationId: CXMLWebhooks_update - summary: Update cXML Webhook - description: Updates an cXML Webhook by ID + - Call Flows + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowCreateRequest' + /resources/call_flows/{id}: + get: + operationId: CallFlows_read + summary: Get Call Flow + description: Returns a Call Flow by ID parameters: - - $ref: '#/components/parameters/CXMLWebhookID' + - $ref: '#/components/parameters/CallFlowPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookResponse' + $ref: '#/components/schemas/CallFlowResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found - '422': - description: Client error + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error content: application/json: schema: - $ref: '#/components/schemas/CXMLWebhookUpdateStatusCode422' + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CXMLWebhookUpdateRequest' + - Call Flows + put: + operationId: CallFlows_update + summary: Update Call Flow + description: Updates a Call Flow by ID + parameters: + - $ref: '#/components/parameters/CallFlowPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Call Flows + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CallFlowUpdateRequest' delete: - operationId: CXMLWebhooks_delete - summary: Delete cXML Webhook - description: Deletes an cXML Webhook by ID + operationId: CallFlows_delete + summary: Delete Call Flow + description: Deletes a Call Flow by ID parameters: - - $ref: '#/components/parameters/CXMLWebhookID' + - $ref: '#/components/parameters/CallFlowPathID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - cXML Webhook - /resources/sip_gateways: + - Call Flows + /resources/conference_room/{id}/addresses: get: - operationId: SipGateways_list - summary: List SIP Gateways - description: Returns a paginated list of SIP Gateways for the authenticated project. + operationId: ConferenceRoomAddresses_list + summary: List Conference Room Addresses + description: This endpoint returns a list of addresses associated with a specific Conference Room. + parameters: + - $ref: '#/components/parameters/ConferenceRoomAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ConferenceRoomAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Conference Rooms + /resources/conference_rooms: + get: + operationId: ConferenceRooms_list + summary: List Conference Rooms + description: Returns a list of conference rooms. parameters: [] responses: '200': @@ -598,593 +890,578 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SipGatewayListResponse' + $ref: '#/components/schemas/ConferenceRoomListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway + - Conference Rooms post: - operationId: SipGateways_create - summary: Create SIP Gateway - description: Creates a SIP Gateway that can be used to dial external SIP entities. + operationId: ConferenceRooms_create + summary: Create Conference Room + description: Creates a Conference Room parameters: [] responses: - '201': - description: The request has succeeded and a new resource has been created as a result. + '200': + description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SipGatewayCreateResponse' + $ref: '#/components/schemas/ConferenceRoomResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SipGatewayCreateStatusCode422' + $ref: '#/components/schemas/ConferenceRoomCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway + - Conference Rooms requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SipGatewayCreateRequest' - /resources/sip_gateways/{id}: + $ref: '#/components/schemas/ConferenceRoomCreateRequest' + /resources/conference_rooms/{id}: get: - operationId: SipGateways_read - summary: Get SIP Gateway - description: Returns an SIP Gateway by ID + operationId: ConferenceRooms_read + summary: Get Conference Room + description: Returns a Conference Room by ID parameters: - - $ref: '#/components/parameters/SipGatewayID' + - $ref: '#/components/parameters/ConferenceRoomPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SipGatewayResponse' + $ref: '#/components/schemas/ConferenceRoomResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway - patch: - operationId: SipGateways_update - summary: Update SIP Gateway - description: Updates a SIP Gateway by ID + - Conference Rooms + put: + operationId: ConferenceRooms_update + summary: Update Conference Room + description: Updates a Conference Room by ID parameters: - - $ref: '#/components/parameters/SipGatewayID' + - $ref: '#/components/parameters/ConferenceRoomPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SipGatewayUpdateResponse' + $ref: '#/components/schemas/ConferenceRoomResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SipGatewayCreateStatusCode422' + $ref: '#/components/schemas/ConferenceRoomUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway + - Conference Rooms requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SipGatewayCreateRequestUpdate' + $ref: '#/components/schemas/ConferenceRoomUpdateRequest' delete: - operationId: SipGateways_delete - summary: Delete SIP Gateway - description: Deletes a SIP Gateway} by ID + operationId: ConferenceRooms_delete + summary: Delete Conference Room + description: Deletes a Conference Room by ID parameters: - - $ref: '#/components/parameters/SipGatewayID' + - $ref: '#/components/parameters/ConferenceRoomPathID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway - /resources/sip_gateways/{resource_id}/addresses: + - Conference Rooms + /resources/cxml_applications: get: - operationId: SipGateways_readAddressesByResourceId - summary: List Fabric Addresses assigned to a SIP Gateway - description: Returns a paginated list of Fabric Addresses associated with the specified SIP Gateway. - parameters: - - name: resource_id - in: path - required: true - schema: - type: string + operationId: CxmlApplications_list + summary: List cXML Applications + description: A list of cXML Applications + parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SipGatewayAddressListResponse' + $ref: '#/components/schemas/CxmlApplicationListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SIP Gateway - /resources/subscribers: + - CXML Applications + /resources/cxml_applications/{id}: get: - operationId: Subscribers_list - summary: List Subscribers - parameters: [] + operationId: CxmlApplications_read + summary: Get cXML Application + description: Returns a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberListResponse' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers - post: - operationId: Subscribers_create - summary: Create Subscriber - parameters: [] + - CXML Applications + put: + operationId: CxmlApplications_update + summary: Update cXML Application + description: Updates a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationPathID' responses: - '201': - description: The request has succeeded and a new resource has been created as a result. + '200': + description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberResponse' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SubscriberCreateStatusCode422' + $ref: '#/components/schemas/CxmlApplicationUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers + - CXML Applications requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberRequest' - /resources/subscribers/{fabric_subscriber_id}/sip_endpoints: - get: - operationId: SubscriberSipEndpoint_list - summary: List Subscriber SIP Endpoints - description: A list of Sip Endpoints of the Subscriber + $ref: '#/components/schemas/CxmlApplicationUpdateRequest' + delete: + operationId: CxmlApplications_delete + summary: Delete LAML Application + description: Deletes a LAML Application by ID parameters: - - $ref: '#/components/parameters/FabricSubscriberID' + - $ref: '#/components/parameters/CxmlApplicationPathID' responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberSipEndpointListResponse' + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: SIP Endpoints' - post: - operationId: SubscriberSipEndpoint_create - summary: Create Subscriber SIP Endpoint - description: Creates a Subscriber Sip Endpoint + - CXML Applications + /resources/cxml_applications/{id}/addresses: + get: + operationId: CxmlApplicationAddresses_list + summary: List cXML Application Addresses + description: This endpoint returns a list of addresses associated with a specific LaML Application. parameters: - - $ref: '#/components/parameters/FabricSubscriberID' + - $ref: '#/components/parameters/CxmlApplicationAddressPathID' responses: - '201': - description: The request has succeeded and a new resource has been created as a result. + '200': + description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SIPEndpoint' + $ref: '#/components/schemas/CxmlApplicationAddressListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found - '422': - description: Client error + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error content: application/json: schema: - $ref: '#/components/schemas/SipEndpointCreateStatusCode422' + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: SIP Endpoints' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberSipEndpointRequest' - /resources/subscribers/{fabric_subscriber_id}/sip_endpoints/{id}: + - CXML Applications + /resources/cxml_scripts: get: - operationId: SubscriberSipEndpoint_read - summary: Get Subscriber SIP Endpoint - description: Returns a Subscriber Sip Endpoint by ID - parameters: - - $ref: '#/components/parameters/SIPEndpointID' - - $ref: '#/components/parameters/FabricSubscriberID' + operationId: CXMLScripts_list + summary: List cXML Scripts + description: A list of cXML Scripts + parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SIPEndpoint' + $ref: '#/components/schemas/CXMLScriptListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: SIP Endpoints' - patch: - operationId: SubscriberSipEndpoint_update - summary: Update Subscriber SIP Endpoint - description: Updates a Subscriber Sip Endpoint by ID - parameters: - - $ref: '#/components/parameters/SIPEndpointID' - - $ref: '#/components/parameters/FabricSubscriberID' + - CXML Scripts + post: + operationId: CXMLScripts_create + summary: Create cXML Script + description: Creates a cXML Script + parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SIPEndpoint' + $ref: '#/components/schemas/CXMLScriptResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SipEndpointUpdateStatusCode422' + $ref: '#/components/schemas/CXMLScriptCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: SIP Endpoints' + - CXML Scripts requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberSipEndpointRequestUpdate' - delete: - operationId: SubscriberSipEndpoint_delete - summary: Delete Subscriber SIP Endpoint - description: Deletes a Subscriber Sip Endpoint by ID - parameters: - - $ref: '#/components/parameters/SIPEndpointID' - - $ref: '#/components/parameters/FabricSubscriberID' - responses: - '204': - description: 'There is no content to send for this request, but the headers may be useful. ' - '401': - description: Access is unauthorized. - content: - text/plain: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - text/plain: - schema: - type: string - enum: - - Not Found - tags: - - 'Subscribers: SIP Endpoints' - /resources/subscribers/{id}: + $ref: '#/components/schemas/CXMLScriptCreateRequest' + /resources/cxml_scripts/{id}: get: - operationId: Subscribers_get - summary: Get Subscriber + operationId: CXMLScripts_read + summary: Get cXML Script + description: Returns a cXML Script by ID parameters: - - $ref: '#/components/parameters/SubscriberPathID' + - $ref: '#/components/parameters/CXMLScriptPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberResponse' + $ref: '#/components/schemas/CXMLScriptResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers + - CXML Scripts put: - operationId: Subscribers_update - summary: Update Subscriber + operationId: CXMLScripts_update + summary: Update cXML Script + description: Updates a cXML Script by ID parameters: - - $ref: '#/components/parameters/SubscriberPathID' + - $ref: '#/components/parameters/CXMLScriptPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberResponse' + $ref: '#/components/schemas/CXMLScriptResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SubscriberUpdateStatusCode422' + $ref: '#/components/schemas/CXMLScriptUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers + - CXML Scripts requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberRequest' + $ref: '#/components/schemas/CXMLScriptUpdateRequest' delete: - operationId: Subscribers_delete - summary: Delete Subscriber + operationId: CXMLScripts_delete + summary: Delete cXML Script + description: Deletes a cXML Script by ID parameters: - - $ref: '#/components/parameters/SubscriberPathID' + - $ref: '#/components/parameters/CXMLScriptPathID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers - /resources/subscribers/{id}/addresses: + - CXML Scripts + /resources/cxml_scripts/{id}/addresses: get: - operationId: SubscriberAddresses_list - summary: List Subscriber Addresses + operationId: CXMLScriptAddresses_list + summary: List cXML Script Addresses + description: This endpoint returns a list of addresses associated with a specific cXML Script. parameters: - - $ref: '#/components/parameters/SubscriberAddressID' + - $ref: '#/components/parameters/CXMLScriptAddressPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/SubscriberAddressesResponse' + $ref: '#/components/schemas/CXMLScriptAddressListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - Subscribers - /resources/swml_webhooks: + - CXML Scripts + /resources/cxml_webhooks: get: - operationId: SWMLWebhooks_list - summary: List SWML Webhooks - description: A list of SWML Webhooks + operationId: CXMLWebhooks_list + summary: List cXML Webhooks + description: A list of cXML Webhooks parameters: [] responses: '200': @@ -1192,29 +1469,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookListResponse' + $ref: '#/components/schemas/CXMLWebhookListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook + - CXML Webhook post: - operationId: SWMLWebhooks_create - summary: Create SWML Webhook - description: Creates an SWML Webhook + operationId: CXMLWebhooks_create + summary: Create cXML Webhook + description: Creates an cXML Webhook parameters: [] responses: '201': @@ -1222,219 +1501,393 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookResponse' + $ref: '#/components/schemas/CXMLWebhookResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SwmlWebhookCreateStatusCode422' + $ref: '#/components/schemas/CXMLWebhookCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook + - CXML Webhook requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookCreateRequest' - /resources/swml_webhooks/{id}: + $ref: '#/components/schemas/CXMLWebhookCreateRequest' + /resources/cxml_webhooks/{cxml_webhook_id}/addresses: get: - operationId: SWMLWebhooks_read - summary: Get SWML Webhook - description: Returns an SWML Webhook by ID + operationId: CXMLWebhookAddresses_list + summary: List cXML Webhook Addresses + description: This endpoint returns a list of addresses associated with a specific cXML Webhook. parameters: - - $ref: '#/components/parameters/SWMLWebhookID' + - $ref: '#/components/parameters/CXMLWebhookIDPath' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookResponse' + $ref: '#/components/schemas/CXMLWebhookAddressListResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook + - CXML Webhook + /resources/cxml_webhooks/{id}: + get: + operationId: CXMLWebhooks_read + summary: Get cXML Webhook + description: Returns an cXML Webhook by ID + parameters: + - $ref: '#/components/parameters/CXMLWebhookID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CXMLWebhookResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - CXML Webhook patch: - operationId: SWMLWebhooks_update - summary: Update SWML Webhook - description: Updates an SWML Webhook by ID + operationId: CXMLWebhooks_update + summary: Update cXML Webhook + description: Updates an cXML Webhook by ID parameters: - - $ref: '#/components/parameters/SWMLWebhookID' + - $ref: '#/components/parameters/CXMLWebhookID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookResponse' + $ref: '#/components/schemas/CXMLWebhookResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SwmlWebhookUpdateStatusCode422' + $ref: '#/components/schemas/CXMLWebhookUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook + - CXML Webhook requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookUpdateRequest' + $ref: '#/components/schemas/CXMLWebhookUpdateRequest' delete: - operationId: SWMLWebhooks_delete - summary: Delete SWML Webhook - description: Deletes an SWML Webhook by ID + operationId: CXMLWebhooks_delete + summary: Delete cXML Webhook + description: Deletes an cXML Webhook by ID parameters: - - $ref: '#/components/parameters/SWMLWebhookID' + - $ref: '#/components/parameters/CXMLWebhookID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook - /resources/swml_webhooks/{swml_webhook_id}/addresses: + - CXML Webhook + /resources/dialogflow_agents: get: - operationId: SWMLWebhookAddresses_list - summary: List SWML Webhook Addresses - description: A list of SWML Webhook Addresses + operationId: DialogflowAgents_list + summary: List Dialogflow Agents + description: A list of Dialogflow Agents + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/DialogflowAgentListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'AI Agents: Dialogflow' + /resources/dialogflow_agents/{id}: + get: + operationId: DialogflowAgents_read + summary: Get Dialogflow Agent + description: Returns a Dialogflow Agent by ID parameters: - - $ref: '#/components/parameters/SWMLWebhookIDPath' + - $ref: '#/components/parameters/DialogflowAgentPathID' responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SWMLWebhookAddressListResponse' + $ref: '#/components/schemas/DialogflowAgentResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - SWML Webhook - /subscriber/invites: - post: - operationId: InviteTokens_create - summary: Create a Subscriber Invite Token - description: Creates a Subscriber Invite Token to be used for client-side API calls. The token is authorized using a subscriber's SAT (Subscriber Access Token) - parameters: [] + - 'AI Agents: Dialogflow' + put: + operationId: DialogflowAgents_update + summary: Update Dialogflow Agent + description: Updates a Dialogflow Agent by ID + parameters: + - $ref: '#/components/parameters/DialogflowAgentPathID' responses: - '201': - description: The request has succeeded and a new resource has been created as a result. + '200': + description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberInviteTokenCreateResponse' + $ref: '#/components/schemas/DialogflowAgentResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/InviteTokenCreateStatusCode422' + $ref: '#/components/schemas/DialogflowAgentUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: Tokens' + - 'AI Agents: Dialogflow' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberInviteTokenCreateRequest' - /subscribers/tokens: + $ref: '#/components/schemas/DialogflowAgentUpdateRequest' + delete: + operationId: DialogflowAgents_delete + summary: Delete Dialogflow Agent + description: Deletes a Dialogflow Agent by ID + parameters: + - $ref: '#/components/parameters/DialogflowAgentPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'AI Agents: Dialogflow' + /resources/dialogflow_agents/{id}/addresses: + get: + operationId: DialogflowAgentAddresses_list + summary: List Dialogflow Agent Addresses + description: This endpoint returns a list of addresses associated with a specific Dialogflow Agent. + parameters: + - $ref: '#/components/parameters/DialogflowAgentAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/DialogflowAgentAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'AI Agents: Dialogflow' + /resources/freeswitch_connectors: + get: + operationId: FreeswitchConnectors_list + summary: List FreeSWITCH Connectors + description: A list of FreeSWITCH Connectors + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/FreeswitchConnectorListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - FreeSWITCH Connector post: - operationId: SubscriberTokens_create - summary: Create Subscriber Token - description: Create a Subscriber Token + operationId: FreeswitchConnectors_create + summary: Create FreeSWITCH Connector + description: Creates a FreeSWITCH Connector parameters: [] responses: '200': @@ -1442,154 +1895,2344 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SubscriberTokenResponse' + $ref: '#/components/schemas/FreeswitchConnectorResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/SubscriberTokenStatusCode422' + $ref: '#/components/schemas/FreeswitchConnectorCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: Tokens' + - FreeSWITCH Connector requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberTokenRequest' - /subscribers/tokens/refresh: - post: - operationId: RefreshTokens_create - summary: Exchange a refresh token for a new subscriber access token - description: Exchanges a valid refresh token for a new subscriber access token and a new refresh token. The new access token is valid for 2 hours, and the new refresh token is valid for 2 hours and 5 minutes. - parameters: [] + $ref: '#/components/schemas/FreeswitchConnectorCreateRequest' + /resources/freeswitch_connectors/{id}: + get: + operationId: FreeswitchConnectors_read + summary: Get FreeSWITCH Connector + description: Returns a FreeSWITCH Connector by ID + parameters: + - $ref: '#/components/parameters/FreeswitchConnectorPathID' responses: - '201': - description: The request has succeeded and a new resource has been created as a result. + '200': + description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/SubscriberRefreshTokenResponse' + $ref: '#/components/schemas/FreeswitchConnectorResponse' '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - FreeSWITCH Connector + put: + operationId: FreeswitchConnectors_update + summary: Update FreeSWITCH Connector + description: Updates a FreeSWITCH Connector by ID + parameters: + - $ref: '#/components/parameters/FreeswitchConnectorPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/FreeswitchConnectorResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' '422': description: Client error content: application/json: schema: - $ref: '#/components/schemas/RefreshTokenStatusCode422' + $ref: '#/components/schemas/FreeswitchConnectorUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' tags: - - 'Subscribers: Tokens' + - FreeSWITCH Connector requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SubscriberRefreshTokenRequest' -security: - - BasicAuth: [] -components: - parameters: - AIAgentIDPath: - name: ai_agent_id - in: path - required: true - description: Unique ID of a AI Agent. - schema: - $ref: '#/components/schemas/uuid' - AIAgentPathID: - name: id - in: path - required: true - description: Unique ID of an AI Agent. - schema: - $ref: '#/components/schemas/uuid' - CXMLWebhookID: - name: id - in: path - required: true - description: Unique ID of a CXML Webhook. - schema: - $ref: '#/components/schemas/uuid' - CXMLWebhookIDPath: - name: cxml_webhook_id - in: path - required: true - description: Unique ID of a CXML Webhook. - schema: - $ref: '#/components/schemas/uuid' - FabricAddressID: - name: id - in: path - required: true - description: Unique ID of a FabricAddress. - schema: - $ref: '#/components/schemas/uuid' - FabricSubscriberID: - name: fabric_subscriber_id - in: path - required: true - description: Unique ID of a Fabric Subscriber. - schema: - $ref: '#/components/schemas/uuid' - SIPEndpointID: - name: id - in: path - required: true - description: Unique ID of a Sip Endpoint. - schema: - $ref: '#/components/schemas/uuid' - SWMLWebhookID: - name: id - in: path - required: true - description: Unique ID of a SWML Webhook. - schema: - $ref: '#/components/schemas/uuid' - SWMLWebhookIDPath: - name: swml_webhook_id - in: path - required: true - description: Unique ID of a SWML Webhook. - schema: - $ref: '#/components/schemas/uuid' - SipGatewayID: - name: id + $ref: '#/components/schemas/FreeswitchConnectorUpdateRequest' + delete: + operationId: FreeswitchConnectors_delete + summary: Delete FreeSWITCH Connector + description: Deletes a FreeSWITCH Connector by ID + parameters: + - $ref: '#/components/parameters/FreeswitchConnectorPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - FreeSWITCH Connector + /resources/freeswitch_connectors/{id}/addresses: + get: + operationId: FreeswitchConnectorAddresses_list + summary: List FreeSWITCH Connector Addresses + description: This endpoint returns a list of addresses associated with a specific FreeSWITCH Connector. + parameters: + - $ref: '#/components/parameters/FreeswitchConnectorAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/FreeswitchConnectorAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - FreeSWITCH Connector + /resources/relay_applications: + get: + operationId: RelayApplications_list + summary: List Relay Applications + description: A list of Relay Applications + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + post: + operationId: RelayApplications_create + summary: Create Relay Application + description: Creates a Relay Application + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationCreateRequest' + /resources/relay_applications/{id}: + get: + operationId: RelayApplications_read + summary: Get Relay Application + description: Returns a Relay Application by ID + parameters: + - $ref: '#/components/parameters/RelayApplicationPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + put: + operationId: RelayApplications_update + summary: Update Relay Application + description: Updates a Relay Application by ID + parameters: + - $ref: '#/components/parameters/RelayApplicationPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationUpdateRequest' + delete: + operationId: RelayApplications_delete + summary: Delete Relay Application + description: Deletes a Relay Application by ID + parameters: + - $ref: '#/components/parameters/RelayApplicationPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + /resources/relay_applications/{id}/addresses: + get: + operationId: RelayApplicationAddresses_list + summary: List Relay Application Addresses + description: This endpoint returns a paginated list of addresses associated with a Relay Application. + parameters: + - $ref: '#/components/parameters/RelayApplicationAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/RelayApplicationAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Relay Application + /resources/sip_endpoints: + get: + operationId: SipEndpoints_list + summary: List SIP Endpoints + description: A list of SIP Endpoints + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SipEndpointListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + post: + operationId: SipEndpoints_create + summary: Create SIP Endpoint + description: Creates a SIP Endpoint + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSipEndpointCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointCreateRequest' + /resources/sip_endpoints/resources/{id}/sip_endpoints: + post: + operationId: ResourceSipEndpoints_assign + summary: Assign a Resource to a SIP endpoint + description: |- + This endpoint assigns a specific resource to a SIP endpoint, allowing inbound calls to be handled by the resource. + :::important + Currently only supports `calling` as a handler and automatically defaults to it. + ::: + parameters: + - $ref: '#/components/parameters/ResourceSipEndpointPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSipEndpointResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSubSipEndpointCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSipEndpointAssignRequest' + /resources/sip_endpoints/{id}: + get: + operationId: SipEndpoints_read + summary: Get SIP Endpoint + description: Returns a SIP Endpoint by ID + parameters: + - $ref: '#/components/parameters/SipEndpointPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + put: + operationId: SipEndpoints_update + summary: Update SIP Endpoint + description: Updates a SIP Endpoint by ID + parameters: + - $ref: '#/components/parameters/SipEndpointPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSipEndpointUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointUpdateRequest' + delete: + operationId: SipEndpoints_delete + summary: Delete SIP Endpoint + description: Deletes a SIP Endpoint by ID + parameters: + - $ref: '#/components/parameters/SipEndpointPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + /resources/sip_endpoints/{id}/addresses: + get: + operationId: SipEndpointAddresses_list + summary: List SIP Endpoint Addresses + description: A list of SIP Endpoint Addresses. + parameters: + - $ref: '#/components/parameters/SipEndpointAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Endpoints + /resources/sip_gateways: + get: + operationId: SipGateways_list + summary: List SIP Gateways + description: Returns a paginated list of SIP Gateways for the authenticated project. + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + post: + operationId: SipGateways_create + summary: Create SIP Gateway + description: Creates a SIP Gateway that can be used to dial external SIP entities. + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayRequest' + /resources/sip_gateways/resources/sip_gateways/{resource_id}/addresses: + get: + operationId: RelayApplicationAddresses_readAddressesByResourceId + summary: List Fabric Addresses assigned to a SIP Gateway + description: Returns a paginated list of Fabric Addresses associated with the specified SIP Gateway. + parameters: + - $ref: '#/components/parameters/SipGatewayAddressRequest' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + /resources/sip_gateways/{id}: + get: + operationId: SipGateways_read + summary: Get SIP Gateway + description: Returns an SIP Gateway by ID + parameters: + - $ref: '#/components/parameters/SipGatewayID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + patch: + operationId: SipGateways_update + summary: Update SIP Gateway + description: Updates a SIP Gateway by ID + parameters: + - $ref: '#/components/parameters/SipGatewayID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SipGatewayRequestUpdate' + delete: + operationId: SipGateways_delete + summary: Delete SIP Gateway + description: Deletes a SIP Gateway} by ID + parameters: + - $ref: '#/components/parameters/SipGatewayID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SIP Gateway + /resources/subscribers: + get: + operationId: Subscribers_list + summary: List Subscribers + description: Retrieve a list of all subscribers + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + post: + operationId: Subscribers_create + summary: Create Subscriber + description: Create a new Subscriber + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberRequest' + /resources/subscribers/{fabric_subscriber_id}/sip_endpoints: + get: + operationId: SubscriberSipEndpoint_list + summary: List Subscriber SIP Endpoints + description: A list of Sip Endpoints of the Subscriber + parameters: + - $ref: '#/components/parameters/FabricSubscriberID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSipEndpointListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: SIP Endpoints' + post: + operationId: SubscriberSipEndpoint_create + summary: Create Subscriber SIP Endpoint + description: Creates a Subscriber Sip Endpoint + parameters: + - $ref: '#/components/parameters/FabricSubscriberID' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSIPEndpoint' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: SIP Endpoints' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSipEndpointRequest' + /resources/subscribers/{fabric_subscriber_id}/sip_endpoints/{id}: + get: + operationId: SubscriberSipEndpoint_read + summary: Get Subscriber SIP Endpoint + description: Returns a Subscriber Sip Endpoint by ID + parameters: + - $ref: '#/components/parameters/SIPEndpointID' + - $ref: '#/components/parameters/FabricSubscriberID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSIPEndpoint' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: SIP Endpoints' + patch: + operationId: SubscriberSipEndpoint_update + summary: Update Subscriber SIP Endpoint + description: Updates a Subscriber Sip Endpoint by ID + parameters: + - $ref: '#/components/parameters/SIPEndpointID' + - $ref: '#/components/parameters/FabricSubscriberID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSIPEndpoint' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SipEndpointUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: SIP Endpoints' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberSipEndpointRequestUpdate' + delete: + operationId: SubscriberSipEndpoint_delete + summary: Delete Subscriber SIP Endpoint + description: Deletes a Subscriber Sip Endpoint by ID + parameters: + - $ref: '#/components/parameters/SIPEndpointID' + - $ref: '#/components/parameters/FabricSubscriberID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: SIP Endpoints' + /resources/subscribers/{id}: + get: + operationId: Subscribers_get + summary: Get Subscriber + description: Fetch an existing Subscriber + parameters: + - $ref: '#/components/parameters/SubscriberPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + put: + operationId: Subscribers_update + summary: Update Subscriber + description: Update an existing Subsriber + parameters: + - $ref: '#/components/parameters/SubscriberPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberRequest' + delete: + operationId: Subscribers_delete + summary: Delete Subscriber + description: Delete an existing Subscriber + parameters: + - $ref: '#/components/parameters/SubscriberPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + /resources/subscribers/{id}/addresses: + get: + operationId: SubscriberAddresses_list + summary: List Subscriber Addresses + description: List Subscriber Addresses + parameters: + - $ref: '#/components/parameters/SubscriberAddressID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubscriberAddressesResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + /resources/swml_scripts: + get: + operationId: SwmlScripts_list + summary: List SWML Scripts + description: A list of SWML Scripts + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SwmlScriptListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + post: + operationId: SwmlScripts_create + summary: Create SWML Script + description: Creates a SWML Script + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptCreateRequest' + /resources/swml_scripts/{id}: + get: + operationId: SwmlScripts_read + summary: Get SWML Script + description: Returns a SWML Script by ID + parameters: + - $ref: '#/components/parameters/SwmlScriptPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + put: + operationId: SwmlScripts_update + summary: Update SWML Script + description: Updates a SWML Script by ID + parameters: + - $ref: '#/components/parameters/SwmlScriptPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlScriptUpdateRequest' + delete: + operationId: SwmlScripts_delete + summary: Delete SWML Script + description: Deletes a SWML Script by ID + parameters: + - $ref: '#/components/parameters/SwmlScriptPathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + /resources/swml_scripts/{id}/addresses: + get: + operationId: SWMLScriptAddresses_list + summary: List SWML Script Addresses + description: This endpoints returns a list of addresses associated with a specific SWML script. + parameters: + - $ref: '#/components/parameters/SWMLScriptAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLScriptAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Scripts + /resources/swml_webhooks: + get: + operationId: SWMLWebhooks_list + summary: List SWML Webhooks + description: A list of SWML Webhooks + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + post: + operationId: SWMLWebhooks_create + summary: Create SWML Webhook + description: Creates an SWML Webhook + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlWebhookCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookCreateRequest' + /resources/swml_webhooks/{id}: + get: + operationId: SWMLWebhooks_read + summary: Get SWML Webhook + description: Returns an SWML Webhook by ID + parameters: + - $ref: '#/components/parameters/SWMLWebhookID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + patch: + operationId: SWMLWebhooks_update + summary: Update SWML Webhook + description: Updates an SWML Webhook by ID + parameters: + - $ref: '#/components/parameters/SWMLWebhookID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SwmlWebhookUpdateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookUpdateRequest' + delete: + operationId: SWMLWebhooks_delete + summary: Delete SWML Webhook + description: Deletes an SWML Webhook by ID + parameters: + - $ref: '#/components/parameters/SWMLWebhookID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + /resources/swml_webhooks/{swml_webhook_id}/addresses: + get: + operationId: SWMLWebhookAddresses_list + summary: List SWML Webhook Addresses + description: This endpoint returns a list of addresses associated with a specific SWML webhook. + parameters: + - $ref: '#/components/parameters/SWMLWebhookIDPath' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SWMLWebhookAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - SWML Webhook + /resources/{id}: + get: + operationId: Resources_read + summary: Get Resource + description: Returns a Resource by ID + parameters: + - $ref: '#/components/parameters/ResourcePathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Resources + delete: + operationId: Resources_delete + summary: Delete Resource + description: Deletes a Resource by ID + parameters: + - $ref: '#/components/parameters/ResourcePathID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Resources + /resources/{id}/addresses: + get: + operationId: ResourceAddresses_list + summary: List Resource Addresses + description: This endpoint is used to retrieve addresses associated with a specific Resource. + parameters: + - $ref: '#/components/parameters/ResourceAddressPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Resources + /resources/{id}/domain_applications: + post: + operationId: DomainApplications_assign + summary: Assign a resource as a call handler for a Domain Application. + description: |- + This endpoint assigns a specific resource to a Domain Application, allowing inbound calls to be handled by the resource. + :::important + Currently only supports `calling` as a handler and automatically defaults to it. + ::: + parameters: + - $ref: '#/components/parameters/DomainApplicationPathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/DomainApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/DomainApplicationCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Domain Applications + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DomainApplicationAssignRequest' + /resources/{id}/phone_routes: + post: + operationId: PhoneRoutes_assign + summary: Assign a Resource to a Phone Route + description: This endpoint assigns a specific resource to a phone route, allowing inbound calls & messages to be handled by the resource. + parameters: + - $ref: '#/components/parameters/PhoneRoutePathID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneRouteResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneRouteCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Phone Routes + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneRouteAssignRequest' + /subscriber/invites: + post: + operationId: InviteTokens_create + summary: Create a Subscriber Invite Token + description: Creates a Subscriber Invite Token to be used for client-side API calls. The token is authorized using a subscriber's SAT (Subscriber Access Token) + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberInviteTokenCreateResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/InviteTokenCreateStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: Tokens' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberInviteTokenCreateRequest' + /subscribers/tokens: + post: + operationId: SubscriberTokens_create + summary: Create Subscriber Token + description: Create a Subscriber Token + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberTokenResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberTokenStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - Subscribers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberTokenRequest' + /subscribers/tokens/refresh: + post: + operationId: RefreshTokens_create + summary: Exchange a refresh token for a new subscriber access token + description: Exchanges a valid refresh token for a new subscriber access token and a new refresh token. The new access token is valid for 2 hours, and the new refresh token is valid for 2 hours and 5 minutes. + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberRefreshTokenResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/RefreshTokenStatusCode422' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' + tags: + - 'Subscribers: Tokens' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberRefreshTokenRequest' +security: + - BasicAuth: [] +components: + parameters: + AIAgentIDPath: + name: ai_agent_id + in: path + required: true + description: Unique ID of a AI Agent. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + AIAgentPathID: + name: id + in: path + required: true + description: Unique ID of an AI Agent. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CXMLScriptAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the cXML Script. + schema: + type: string + format: uuid + CXMLScriptPathID: + name: id + in: path + required: true + description: Unique ID of a cXML Script. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CXMLWebhookID: + name: id + in: path + required: true + description: Unique ID of a CXML Webhook. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CXMLWebhookIDPath: + name: cxml_webhook_id + in: path + required: true + description: Unique ID of a CXML Webhook. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CallFlowAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the Call Flow. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CallFlowPathID: + name: id + in: path + required: true + description: Unique ID of a Call Flow. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CallFlowVersionPathID: + name: id + in: path + required: true + description: The unique identifier of the Call Flow. + schema: + type: string + ConferenceRoomAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the Conference Room. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + ConferenceRoomPathID: + name: id + in: path + required: true + description: Unique ID of a Conference Room. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + CxmlApplicationAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the cXML Application. + schema: + type: string + format: uuid + CxmlApplicationPathID: + name: id + in: path + required: true + description: Unique ID of a cXML Application. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + DialogflowAgentAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the Dialogflow Agent Address. + schema: + type: string + format: uuid + DialogflowAgentPathID: + name: id + in: path + required: true + description: Unique ID of a Dialogflow Agent. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + DomainApplicationPathID: + name: id + in: path + required: true + description: The unique identifier of the Resource. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + FabricAddressID: + name: id + in: path + required: true + description: Unique ID of a FabricAddress. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + FabricSubscriberID: + name: fabric_subscriber_id + in: path + required: true + description: Unique ID of a Fabric Subscriber. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + FreeswitchConnectorAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the FreeSWITCH Connector. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + FreeswitchConnectorPathID: + name: id + in: path + required: true + description: Unique ID of a FreeSWITCH Connector. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + PhoneRoutePathID: + name: id + in: path + required: true + description: The unique identifier of the Resource. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + RelayApplicationAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the Relay Application. + schema: + type: string + format: uuid + RelayApplicationPathID: + name: id + in: path + required: true + description: Unique ID of a Relay Application. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + ResourceAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the Resource. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + ResourcePathID: + name: id + in: path + required: true + description: Unique ID of a Resource. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + ResourceSipEndpointPathID: + name: id + in: path + required: true + description: The unique identifier of the Resource. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SIPEndpointID: + name: id + in: path + required: true + description: Unique ID of a Sip Endpoint. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SWMLScriptAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the SWML Script. + schema: + type: string + format: uuid + SWMLWebhookID: + name: id + in: path + required: true + description: Unique ID of a SWML Webhook. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SWMLWebhookIDPath: + name: swml_webhook_id + in: path + required: true + description: Unique ID of a SWML Webhook. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SipEndpointAddressPathID: + name: id + in: path + required: true + description: The unique identifier of the SIP Endpoint. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SipEndpointPathID: + name: id + in: path + required: true + description: Unique ID of a SIP Endpoint. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SipGatewayAddressRequest: + name: resource_id + in: path + required: true + description: The unique identifier of the SIP Gateway. + schema: + $ref: '#/components/schemas/uuid' + format: uuid + SipGatewayID: + name: id in: path required: true description: Unique ID of a SIP Gateway. schema: $ref: '#/components/schemas/uuid' + format: uuid SubscriberAddressID: name: id in: path @@ -1597,6 +4240,7 @@ components: description: Unique ID of a Subscriber Address. schema: $ref: '#/components/schemas/uuid' + format: uuid SubscriberPathID: name: id in: path @@ -1604,28 +4248,3142 @@ components: description: Unique ID of a Subscriber. schema: $ref: '#/components/schemas/uuid' + format: uuid + SwmlScriptPathID: + name: id + in: path + required: true + description: Unique ID of a SWML Script. + schema: + $ref: '#/components/schemas/uuid' + format: uuid schemas: - AIAgentAddress: + AIAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=ai_agent + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=ai_agent + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent + AIAgent: + type: object + required: + - agent_id + - name + properties: + agent_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of an AI Agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: + type: string + description: Name of the AI Agent. + example: My AI Agent + prompt: + allOf: + - $ref: '#/components/schemas/AIPrompt' + description: Establishes the initial set of instructions and settings to configure the agent. + post_prompt: + allOf: + - $ref: '#/components/schemas/AIPostPrompt' + description: The final set of instructions and configuration settings to send to the agent. + params: + allOf: + - $ref: '#/components/schemas/AIParams' + description: A JSON object containing parameters as key-value pairs. + pronounce: + type: array + items: + $ref: '#/components/schemas/Pronounce' + description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. + hints: + type: array + items: + type: string + description: An array of hints (as strings) to provide context to the dialogue. + example: + - One Hint + - Two Hint + languages: + type: array + items: + $ref: '#/components/schemas/Languages' + description: An array of JSON objects defining supported languages in the conversation. + SWAIG: + allOf: + - $ref: '#/components/schemas/SWAIG' + description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. + AIAgentAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects containing the address data + links: + allOf: + - $ref: '#/components/schemas/AIAddressPaginationResponse' + description: Object containing pagination links + AIAgentCreateRequest: + type: object + required: + - agent_id + - name + properties: + agent_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of an AI Agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: + type: string + description: Name of the AI Agent. + example: My AI Agent + prompt: + allOf: + - $ref: '#/components/schemas/AIPrompt' + description: Establishes the initial set of instructions and settings to configure the agent. + post_prompt: + allOf: + - $ref: '#/components/schemas/AIPostPrompt' + description: The final set of instructions and configuration settings to send to the agent. + params: + allOf: + - $ref: '#/components/schemas/AIParams' + description: A JSON object containing parameters as key-value pairs. + pronounce: + type: array + items: + $ref: '#/components/schemas/Pronounce' + description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. + hints: + type: array + items: + type: string + description: An array of hints (as strings) to provide context to the dialogue. + example: + - One Hint + - Two Hint + languages: + type: array + items: + $ref: '#/components/schemas/Languages' + description: An array of JSON objects defining supported languages in the conversation. + SWAIG: + allOf: + - $ref: '#/components/schemas/SWAIG' + description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. + AIAgentCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name can't be blank + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + AIAgentListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/AIAgentResponse' + description: An array of objects containing the list of AI Agent data. + links: + allOf: + - $ref: '#/components/schemas/AIAgentPaginationResponse' + description: Object containing pagination links + AIAgentPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&type=ai_agent + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&type=ai_agent + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=ai_agent + AIAgentResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - ai_agent + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the AIAgent. + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 99151cf8-9548-4860-ba70-a8de824f3312 + display_name: + type: string + description: Display name of the AIAgent Fabric Resource + example: Booking Assistant + type: + type: string + enum: + - ai_agent + description: Type of the Fabric Resource + example: ai_agent + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + ai_agent: + allOf: + - $ref: '#/components/schemas/AIAgent' + description: AIAgent data. + AIAgentUpdateRequest: + type: object + properties: + agent_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of an AI Agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: + type: string + description: Name of the AI Agent. + example: My AI Agent + prompt: + allOf: + - $ref: '#/components/schemas/AIPromptUpdate' + description: Establishes the initial set of instructions and settings to configure the agent. + post_prompt: + allOf: + - $ref: '#/components/schemas/AIPostPromptUpdate' + description: The final set of instructions and configuration settings to send to the agent. + params: + allOf: + - $ref: '#/components/schemas/AIParams' + description: A JSON object containing parameters as key-value pairs. + pronounce: + type: array + items: + $ref: '#/components/schemas/Pronounce' + description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. + hints: + type: array + items: + type: string + description: An array of hints (as strings) to provide context to the dialogue. + example: + - One Hint + - Two Hint + languages: + type: array + items: + $ref: '#/components/schemas/Languages' + description: An array of JSON objects defining supported languages in the conversation. + SWAIG: + allOf: + - $ref: '#/components/schemas/SWAIG' + description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. + AIAgentUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name can't be blank + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + AIParams: + type: object + properties: + acknowledge_interruptions: + type: boolean + description: Instructs the agent to acknowledge crosstalk and confirm user input when the user speaks over the agent. + ai_volume: + type: integer + minimum: -50 + maximum: 50 + description: Adjust the volume of the AI. Allowed values from `-50` - `50`. + attention_timeout: + anyOf: + - $ref: '#/components/schemas/IntegerOrZero' + - type: number + enum: + - 0 + description: Amount of time, in ms, to wait before prompting the user to respond. Allowed values from `10,000` - `600,000`. Set to `0` to disable. + attention_timeout_prompt: + type: string + description: A custom prompt that is fed into the AI when the attention_timeout is reached. + example: Ask if the user would like you to repeat yourself, or if they need more time to respond. + background_file: + type: string + format: uri + description: URL of audio file to play in the background while AI plays in foreground. + example: https://cdn.signalwire.com/default-music/welcome.mp3 + background_file_loops: + type: integer + nullable: true + description: Maximum number of times to loop playing the background file. `undefined` means loop indefinitely. + example: 5 + background_file_volume: + type: integer + minimum: -50 + maximum: 50 + description: Defines background_file volume within a range of `-50` to `50`. + barge_match_string: + type: string + description: |- + Takes a string, including a regular expression, defining barge behavior. + For example, this param can direct the AI to stop when the word 'hippopotomus' is input. + example: Cancel order + barge_min_words: + type: integer + minimum: 1 + maximum: 99 + description: Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + conscience: + type: string + description: Sets the prompt which binds the agent to its purpose. + example: Place an order + conversation_id: + type: string + description: Used by `check_for_input` and `save_conversation` to identify an individual conversation. + example: Conversation ID + debug_webhook_level: + type: integer + minimum: 0 + maximum: 1 + description: Enables debugging to the set URL. Allowed values from `0` - `1`. + debug_webhook_url: + type: string + format: uri + description: Each interaction between the AI and end user is posted in real time to the established URL. + example: https://example.com + direction: + type: array + items: + $ref: '#/components/schemas/Direction' + description: Forces the direction of the call to the assistant. Valid values are `inbound` and `outbound`. + digit_termiantors: + type: string + description: "DTMF digit, as a string, to signal the end of input (ex: '#')" + example: '#' + digit_timeout: + type: integer + minimum: 250 + maximum: 10000 + description: Time, in ms, at the end of digit input to detect end of input. Allowed values from `250` - `10,000`. + end_of_speech_timeout: + type: integer + minimum: 250 + maximum: 10000 + description: Amount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from `250` - `10,000`. + eleven_labs_stability: + type: number + description: The stability slider determines how stable the voice is and the randomness between each generation. Lowering this slider introduces a broader emotional range for the voice. + eleven_labs_similarity: + type: number + description: The similarity slider dictates how closely the AI should adhere to the original voice when attempting to replicate it. The higher the similarity, the closer the AI will sound to the original voice. + energy_level: + type: number + minimum: 0 + maximum: 100 + description: Amount of energy necessary for bot to hear you (in dB). Allowed values from `0.0` - `100.0`. + hold_music: + type: string + format: uri + description: A URL for the hold music to play, accepting WAV, mp3, and FreeSWITCH tone_stream. + example: https://cdn.signalwire.com/default-music/welcome.mp3 + hold_on_process: + type: boolean + description: Enables hold music during SWAIG processing. + inactivity_timeout: + type: integer + minimum: 10000 + maximum: 3600000 + description: Amount of time, in ms, to wait before exiting the app due to inactivity. Allowed values from `10,000` - `3,600,000`. + input_poll_freq: + type: string + description: |- + Check for input function with check_for_input. + Example use case: Feeding an inbound SMS to AI on a voice call, eg., for collecting an email address or other complex information. + interrupt_on_noise: + type: boolean + description: When enabled, barges agent upon any sound interruption longer than 1 second. + interrupt_prompt: + type: string + description: Provide a prompt for the agent to handle crosstalk. + example: Inform user that you can't hear anything + languages_enabled: + type: boolean + description: Allows multilingualism when `true`. + local_tz: + type: string + description: The local timezone setting for the AI. Value should use `IANA TZ ID` + example: America/Ensenada + outbound_attention_timeout: + type: integer + minimum: 10000 + maximum: 600000 + description: Sets a time duration for the outbound call recipient to respond to the AI agent before timeout, in a range from `10000` to `600000`. + save_conversation: + type: boolean + description: |- + Send a summary of the conversation after the call ends. + This requires a `post_url` to be set in the ai parameters and the `conversation_id` defined below. + This eliminates the need for a `post_prompt` in the ai parameters. + swaig_allow_settings: + type: boolean + description: Allows tweaking any of the indicated settings, such as `barge_match_string`, using the returned SWML from the SWAIG function. + swaig_allow_swml: + type: boolean + description: Allows your SWAIG to return SWML to be executed. + swaig_post_conversation: + type: boolean + description: Post entire conversation to any SWAIG call. + transfer_summary: + type: boolean + description: Pass a summary of a conversation from one AI agent to another. For example, transfer a call summary between support agents in two departments. + verbose_logs: + type: boolean + description: Enable verbose logging. + wait_for_user: + type: boolean + description: When false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first. + title: params object + AIPostPrompt: + type: object + required: + - text + properties: + text: + type: string + description: The instructions to send to the agent. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. + temperature: + type: number + minimum: 0 + maximum: 1.5 + description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. + top_p: + type: number + minimum: 0 + maximum: 1 + description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. + confidence: + type: number + minimum: 0 + maximum: 1 + description: |- + Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. + Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. + presence_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. + frequency_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. + title: post_prompt + AIPostPromptUpdate: + type: object + properties: + text: + type: string + description: The instructions to send to the agent. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. + temperature: + type: number + minimum: 0 + maximum: 1.5 + description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. + top_p: + type: number + minimum: 0 + maximum: 1 + description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. + confidence: + type: number + minimum: 0 + maximum: 1 + description: |- + Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. + Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. + presence_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. + frequency_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. + title: post_prompt + AIPrompt: + type: object + required: + - text + properties: + text: + type: string + description: The instructions to send to the agent. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. + temperature: + type: number + minimum: 0 + maximum: 1.5 + description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. + top_p: + type: number + minimum: 0 + maximum: 1 + description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. + confidence: + type: number + minimum: 0 + maximum: 1 + description: |- + Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. + Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. + presence_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. + frequency_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. + contexts: + allOf: + - $ref: '#/components/schemas/Contexts' + description: |- + An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. + Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. + Additionally, more context steps can be defined as any other key in the object. + title: prompt + AIPromptUpdate: + type: object + properties: + text: + type: string + description: The instructions to send to the agent. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. + temperature: + type: number + minimum: 0 + maximum: 1.5 + description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. + top_p: + type: number + minimum: 0 + maximum: 1 + description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. + confidence: + type: number + minimum: 0 + maximum: 1 + description: |- + Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. + Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. + presence_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. + frequency_penalty: + type: number + minimum: -2 + maximum: 2 + description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. + contexts: + allOf: + - $ref: '#/components/schemas/ContextsUpdate' + description: |- + An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. + Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. + Additionally, more context steps can be defined as any other key in the object. + title: prompt + Action: + anyOf: + - $ref: '#/components/schemas/ContextSwitchAction' + - $ref: '#/components/schemas/PlaybackBGAction' + - $ref: '#/components/schemas/SayAction' + - $ref: '#/components/schemas/SetGlobalDataAction' + - $ref: '#/components/schemas/SetMetaDataAction' + - $ref: '#/components/schemas/StopAction' + - $ref: '#/components/schemas/StopPlaybackBGAction' + - $ref: '#/components/schemas/ToggleFunctionsAction' + - $ref: '#/components/schemas/UnsetGlobalDataAction' + - $ref: '#/components/schemas/UnsetMetaDataAction' + - $ref: '#/components/schemas/UserInputAction' + title: Action union + AddressChannel: + anyOf: + - $ref: '#/components/schemas/AudioChannel' + - $ref: '#/components/schemas/MessagingChannel' + - $ref: '#/components/schemas/VideoChannel' + AllOfProperty: + type: object + required: + - allOf + properties: + allOf: + type: array + items: + $ref: '#/components/schemas/SchemaType' + description: An array of schemas where all of the schemas must be valid. + title: allOf Property + AnyOfProperty: + type: object + required: + - anyOf + properties: + anyOf: + type: array + items: + $ref: '#/components/schemas/SchemaType' + description: An array of schemas where at least one of the schemas must be valid. + title: anyOf Property + ArrayProperty: + type: object + required: + - type + - items + properties: + description: + type: string + description: A description of the property. + example: Property description + nullable: + type: boolean + description: Whether the property can be null. + type: + type: string + enum: + - array + description: The type of parameter(s) the AI is passing to the function. + default: + type: array + items: {} + description: The default array value + items: + allOf: + - $ref: '#/components/schemas/SchemaType' + description: Schema for array items + description: Base interface for all property types + title: Array Function Property + AudioChannel: + type: object + required: + - audio + properties: + audio: + type: string + description: Audio Channel of Fabric Address + example: /external/resource_name?channel=audio + BooleanProperty: + type: object + required: + - type + properties: + description: + type: string + description: A description of the property. + example: Property description + nullable: + type: boolean + description: Whether the property can be null. + type: + type: string + enum: + - boolean + description: The type of parameter(s) the AI is passing to the function. + default: + type: boolean + description: The default boolean value + description: Base interface for all property types + title: Boolean Function Property + CXMLScript: + type: object + required: + - id + - contents + - request_count + - last_accessed_at + - request_url + - script_type + - display_name + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of a cXML Script. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + contents: + type: string + description: The cXML script contents + example: Hello World + request_count: + type: integer + format: int32 + description: The amout of times the cXML script has been requested + example: 5 + last_accessed_at: + type: string + format: date-time + nullable: true + description: The date and time when the cXML script was last accessed + example: '2023-10-01T12:00:00Z' + request_url: + type: string + format: uri + description: The URL where the cXML script can be accessed + example: https://example.signalwire.com/laml-bins/2537c89e-2606-48c2-b3c2-bb601d863d1e + script_type: + type: string + enum: + - calling + - messaging + description: The script type the cXML Script is used for + example: calling + display_name: + type: string + description: Display name of the cXML Script Fabric Resource + example: Booking Assistant Script + status_callback_url: + type: string + format: uri + nullable: true + description: The url that will send status updates for the cXML Script + example: https://example.com/cxml/status + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for status callback URL + example: POST + CXMLScriptAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects that contain a list of cXML Script Addresses + links: + allOf: + - $ref: '#/components/schemas/CXMLScriptAddressPaginationResponse' + description: Object containing pagination links + CXMLScriptAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&type=cxml_script + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_size=50&type=cxml_script + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=1&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/cxml_scripts?page_number=0&page_size=50&page_token=PA08cdad0c-e7e6-4a75-8244-902524f38d55&type=cxml_script + CXMLScriptCreateRequest: + type: object + required: + - display_name + - contents + properties: + display_name: + type: string + description: Display name of the cXML Script + example: Reception Script + contents: + type: string + description: The cXML script contents + example: Hello World + status_callback_url: + type: string + format: uri + description: URL to send status callbacks to + example: https://example.com/status + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method to use for status callbacks + example: GET + CXMLScriptCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: contents is required + attribute: contents + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + CXMLScriptListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CXMLScriptResponse' + description: An array of objects containing a list of cXML Script data + links: + allOf: + - $ref: '#/components/schemas/CXMLScriptAddressPaginationResponse' + description: Object containing pagination links + CXMLScriptResponse: + type: object + required: + - id + - project_id + - name + - type + - created_at + - updated_at + - cxml_script + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the cXML Script. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + name: + type: string + description: Display name of the cXML Script Fabric Resource + example: Reception Script + type: + type: string + enum: + - cxml_script + description: Type of the Fabric Resource + example: cxml_script + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + cxml_script: + allOf: + - $ref: '#/components/schemas/CXMLScript' + description: cXML Script data. + CXMLScriptUpdateRequest: + type: object + properties: + display_name: + type: string + description: Display name of the cXML Script + example: Reception Script + contents: + type: string + description: The cXML script contents + example: Hello World + status_callback_url: + type: string + format: uri + description: URL to send status callbacks to + example: https://example.com/status + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method to use for status callbacks + example: GET + CXMLScriptUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: contents must be valid cXML + attribute: contents + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + CXMLWebhook: + type: object + required: + - id + - name + - used_for + - primary_request_url + - primary_request_method + - fallback_request_url + - fallback_request_method + - status_callback_url + - status_callback_method + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the CXML Webhook. + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + name: + type: string + description: Name of the CXML Webhook. + example: My CXML Webhook + used_for: + allOf: + - $ref: '#/components/schemas/UsedForType' + description: Used for of the CXML Webhook. + example: calling + primary_request_url: + type: string + format: uri + description: Primary request url of the CXML Webhook. + example: https://primary.com + primary_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Primary request method of the CXML Webhook. + example: GET + fallback_request_url: + type: string + format: uri + nullable: true + description: Fallback request url of the CXML Webhook. + example: https://fallback.com + fallback_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Fallback request method of the CXML Webhook. + example: GET + status_callback_url: + type: string + format: uri + nullable: true + description: Status callback url of the CXML Webhook. + example: https://callback.com + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Status callback method of the CXML Webhook. + example: POST + CXMLWebhookAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + links: + $ref: '#/components/schemas/CXMLWebhookAddressPaginationResponse' + CXMLWebhookAddressPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_webhook + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_webhook + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook + CXMLWebhookCreateRequest: + type: object + required: + - primary_request_url + properties: + name: + type: string + description: Name of the CXML Webhook. + example: My CXML Webhook + used_for: + allOf: + - $ref: '#/components/schemas/UsedForType' + description: Used for of the CXML Webhook. + example: calling + default: calling + primary_request_url: + type: string + format: uri + description: Primary request url of the CXML Webhook. + example: https://primary.com + primary_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Primary request method of the CXML Webhook. + example: GET + default: POST + fallback_request_url: + type: string + format: uri + description: Fallback request url of the CXML Webhook. + example: https://fallback.com + fallback_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Fallback request method of the CXML Webhook. + example: GET + default: POST + status_callback_url: + type: string + format: uri + description: Status callback url of the CXML Webhook. + example: https://callback.com + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Status callback method of the CXML Webhook. + example: GET + default: POST + CXMLWebhookCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: http_url_required + message: This value must be an HTTP or HTTPS URL. + attribute: status_callback_url + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required + CXMLWebhookListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CXMLWebhookResponse' + description: An array of objects containing a list of cXML Webhook data + links: + allOf: + - $ref: '#/components/schemas/CXMLWebhookPaginationResponse' + description: Object containing pagination links + CXMLWebhookPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&type=cxml_webhook + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&type=cxml_webhook + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_webhook + CXMLWebhookResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - cxml_webhook + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the CXMLWebhook. + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 99151cf8-9548-4860-ba70-a8de824f3312 + display_name: + type: string + description: Display name of the CXMLWebhook Fabric Resource + example: Booking Assistant + type: + type: string + enum: + - cxml_webhook + description: Type of the Fabric Resource + example: cxml_webhook + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + cxml_webhook: + allOf: + - $ref: '#/components/schemas/CXMLWebhook' + description: CXMLWebhook data. + CXMLWebhookUpdateRequest: + type: object + properties: + name: + type: string + description: Name of the CXML Webhook. + example: My CXML Webhook + used_for: + allOf: + - $ref: '#/components/schemas/UsedForType' + description: Used for of the CXML Webhook. + example: calling + default: calling + primary_request_url: + type: string + format: uri + description: Primary request url of the CXML Webhook. + example: https://primary.com + primary_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Primary request method of the CXML Webhook. + example: GET + default: POST + fallback_request_url: + type: string + format: uri + description: Fallback request url of the CXML Webhook. + example: https://fallback.com + fallback_request_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Fallback request method of the CXML Webhook. + example: GET + default: POST + status_callback_url: + type: string + format: uri + description: Status callback url of the CXML Webhook. + example: https://callback.com + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Status callback method of the CXML Webhook. + example: POST + default: POST + CXMLWebhookUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: http_url_required + message: This value must be an HTTP or HTTPS URL. + attribute: status_callback_url + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required + CallFlow: + type: object + required: + - id + - title + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of a Call Flow. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + title: + type: string + description: The name of the Call Flow + example: Booking Assistant + flow_data: + type: string + description: Call flow data as JSON string + example: '{}' + relayml: + type: string + description: A SWML document. For more information on SWML, please go to https://developer.signalwire.com/swml + example: '{ "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}};' + document_version: + type: integer + format: int32 + description: The current revision of the call flow. Every update must increase this number. + example: 1 + CallFlowAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects containing a list of Call Flow Addresses + links: + allOf: + - $ref: '#/components/schemas/CallFlowAddressPaginationResponse' + description: Object containing pagination links + CallFlowAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=call_flow + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=call_flow + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=call_flow + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=call_flow + CallFlowCreateRequest: + type: object + required: + - title + properties: + title: + type: string + description: The name of the Call Flow + example: Booking Assistant + CallFlowCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: title is required + attribute: title + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + CallFlowListResponse: + type: object + required: + - links + - data + properties: + links: + allOf: + - $ref: '#/components/schemas/CallFlowAddressPaginationResponse' + description: Object containing pagination links + data: + type: array + items: + $ref: '#/components/schemas/CallFlowResponse' + description: An array of objects containing the CallFlow listing response + CallFlowResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - call_flow + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Call Flow. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Call Flow Fabric Resource + example: Booking Assistant + type: + type: string + enum: + - call_flow + description: Type of the Fabric Resource + example: call_flow + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + call_flow: + allOf: + - $ref: '#/components/schemas/CallFlow' + description: Call Flow data. + CallFlowUpdateRequest: + type: object + properties: + title: + type: string + description: The name of the Call Flow + example: Booking Assistant + document_version: + type: integer + format: int32 + description: The current revision of the call flow. Every update must increase this number. + example: 1 + CallFlowUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: document_version must be greater than current version + attribute: document_version + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + CallFlowVersion: + type: object + required: + - id + - version + - created_at + - updated_at + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The unique identifier of the version. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + version: + type: string + description: The version number. + example: 1.0.0 + created_at: + type: string + description: The creation timestamp. + example: '2023-01-01T12:00:00Z' + updated_at: + type: string + description: The last update timestamp. + example: '2023-01-01T12:00:00Z' + flow_data: + type: string + description: Call Flow data structure + example: '{}' + relayml: + type: string + description: SWML document for this version + example: '{}' + CallFlowVersionDeployByDocumentVersion: + type: object + required: + - document_version + properties: + document_version: + type: integer + format: int32 + description: The current revision of the call flow. + example: 2 + title: Deploy by document version + CallFlowVersionDeployByVersionId: + type: object + required: + - call_flow_version_id + properties: + call_flow_version_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Any call flow version ID for this call flow. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + title: Deploy by version ID + CallFlowVersionDeployRequest: + oneOf: + - $ref: '#/components/schemas/CallFlowVersionDeployByDocumentVersion' + - $ref: '#/components/schemas/CallFlowVersionDeployByVersionId' + CallFlowVersionDeployResponse: + type: object + required: + - id + - created_at + - updated_at + - document_version + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The unique identifier of the deployed Call Flow Version. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + created_at: + type: string + description: The creation timestamp. + example: '2024-01-02T00:00:00Z' + updated_at: + type: string + description: The last update timestamp. + example: '2024-01-02T00:00:00Z' + document_version: + type: integer + format: int32 + description: The document version. + example: 2 + flow_data: + type: string + description: Call Flow data structure + example: '{}' + relayml: + type: string + description: SWML document for this version + example: '{ "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}};' + CallFlowVersionListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CallFlowVersion' + description: List of Call Flow Versions + links: + $ref: '#/components/schemas/CallFlowVersionsPaginationResponse' + CallFlowVersionsPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&type=call_flow + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&type=call_flow + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/call_flows/versions?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/call_flows/versions?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=call_flow + CallHandlerType: + type: string + enum: + - default + - passthrough + - block-pstn + - resource + Ciphers: + type: string + enum: + - AEAD_AES_256_GCM_8 + - AES_256_CM_HMAC_SHA1_80 + - AES_CM_128_HMAC_SHA1_80 + - AES_256_CM_HMAC_SHA1_32 + - AES_CM_128_HMAC_SHA1_32 + Codecs: + type: string + enum: + - PCMU + - PCMA + - G722 + - G729 + - OPUS + - VP8 + - H264 + ConferenceRoom: + type: object + required: + - id + - name + - description + - display_name + - max_members + - quality + - fps + - join_from + - join_until + - remove_at + - remove_after_seconds_elapsed + - layout + - record_on_start + - tone_on_entry_and_exit + - room_join_video_off + - user_join_video_off + - enable_room_previews + - sync_audio_video + - meta + - prioritize_handraise + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The unique id of the Conference Room + example: 1bd571e4-5ea4-4a70-a3c8-2bab5d20e754 + name: + type: string + description: The name of the Conference Room + example: coffee_cafe + description: + type: string + maxLength: 3000 + description: The descrption of the Conference Room + example: This room is for coffee, no shop talk + display_name: + type: string + maxLength: 200 + description: Display name of the Conference Room + example: Reception + max_members: + type: integer + format: int32 + minimum: 0 + maximum: 300 + description: Maximum number of members allowed in the conference room + example: 30 + quality: + type: string + enum: + - 1080p + - 720p + description: The viudeo quality of the Conference Room. + example: 1080p + default: 720p + fps: + type: number + enum: + - 30 + - 20 + description: The frames-per-second (fps) of the participants videos in the conference. + example: 30 + join_from: + type: string + format: date-time + nullable: true + description: The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + join_until: + type: string + format: date-time + nullable: true + description: The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + remove_at: + type: string + format: date-time + nullable: true + description: The time to remove all participants from the conference. + example: '2024-05-06T12:20:00Z' + remove_after_seconds_elapsed: + type: integer + format: int32 + nullable: true + minimum: 0 + maximum: 200000 + description: The amount of time in seconds to remove a particpant from a conference after they join. + layout: + allOf: + - $ref: '#/components/schemas/Layout' + description: The video layout of the conference. + example: grid-responsive + record_on_start: + type: boolean + description: Starts recording when the conference starts. + example: true + tone_on_entry_and_exit: + type: boolean + description: Plays a tone when a participant joins or leaves the conference. + example: true + room_join_video_off: + type: boolean + description: Turns the conference video off when the participant joins the room if `true`. + example: true + user_join_video_off: + type: boolean + description: Turns the participants video off when the participant joins the room if `true`. + example: true + enable_room_previews: + type: boolean + description: Enables live video room previews for the conference. + example: true + sync_audio_video: + type: boolean + nullable: true + description: Syncs the participants audio and video. + example: true + meta: + type: object + additionalProperties: {} + description: Metadata of the conference. + example: + foo: bar + prioritize_handraise: + type: boolean + description: Indicator if the Conference Room will prioritize showing participants utilizing the hand raised feature. + example: false + ConferenceRoomAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressRoom' + description: An array of objects containing list of Conference Room Addresses + links: + allOf: + - $ref: '#/components/schemas/ConferenceRoomAddressPaginationResponse' + description: Object containing pagination links + ConferenceRoomAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=conference_room + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&type=conference_room + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=conference_room + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/conference_room/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad&type=conference_room + ConferenceRoomCreateRequest: + type: object + required: + - name + - enable_room_previews + properties: + name: + type: string + description: The name of the Conference Room + example: coffee_cafe + display_name: + type: string + maxLength: 200 + description: Display name of the Conference Room + example: Reception + description: + type: string + maxLength: 3000 + description: The descrption of the Conference Room + example: This room is for coffee, no shop talk + join_from: + type: string + format: date-time + description: The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + join_until: + type: string + format: date-time + description: The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + max_members: + type: integer + format: int32 + minimum: 0 + maximum: 300 + description: Maximum number of members allowed in the conference room + example: 30 + quality: + type: string + enum: + - 1080p + - 720p + description: The viudeo quality of the Conference Room. + example: 1080p + default: 720p + remove_at: + type: string + format: date-time + description: The time to remove all participants from the conference. + example: '2024-05-06T12:20:00Z' + remove_after_seconds_elapsed: + type: integer + format: int32 + minimum: 0 + maximum: 200000 + description: The amount of time in seconds to remove a particpant from a conference after they join. + layout: + allOf: + - $ref: '#/components/schemas/Layout' + description: The video layout of the conference. + example: grid-responsive + record_on_start: + type: boolean + description: Starts recording when the conference starts. + example: true + enable_room_previews: + type: boolean + description: Enables live video room previews for the conference. + example: true + meta: + type: object + additionalProperties: {} + description: Metadata of the conference. + example: + foo: bar + sync_audio_video: + type: boolean + description: Syncs the participants audio and video. + example: true + tone_on_entry_and_exit: + type: boolean + description: Plays a tone when a participant joins or leaves the conference. + example: true + room_join_video_off: + type: boolean + description: Turns the conference video off when the participant joins the room if `true`. + example: true + user_join_video_off: + type: boolean + description: Turns the participants video off when the participant joins the room if `true`. + example: true + ConferenceRoomCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: display_name is required + attribute: display_name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + ConferenceRoomListResponse: + type: object + required: + - links + - data + properties: + links: + allOf: + - $ref: '#/components/schemas/ConferenceRoomAddressPaginationResponse' + description: Object containing pagination links + data: + type: array + items: + $ref: '#/components/schemas/ConferenceRoomResponse' + description: An array of objects containing the Conference Room data + ConferenceRoomResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - conference_room + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Conference Room. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Conference Room Fabric Resource + example: Reception + type: + type: string + enum: + - video_room + description: Type of the Fabric Resource + example: video_room + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + conference_room: + allOf: + - $ref: '#/components/schemas/ConferenceRoom' + description: Conference Room data. + ConferenceRoomUpdateRequest: + type: object + required: + - enable_room_previews + - sync_audio_video + properties: + name: + type: string + description: The name of the Conference Room + example: coffee_cafe + display_name: + type: string + maxLength: 200 + description: Display name of the Conference Room + example: Reception + description: + type: string + maxLength: 3000 + description: The descrption of the Conference Room + example: This room is for coffee, no shop talk + join_from: + type: string + format: date-time + description: The time users are allowed to start joining the conference. Joining before this time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + join_until: + type: string + format: date-time + description: The time users are allowed to until the conference is locked. Attempting to join the conference after the set time will result in failure to join the conference. + example: '2024-05-06T12:20:00Z' + max_members: + type: integer + format: int32 + minimum: 0 + maximum: 300 + description: Maximum number of members allowed in the conference room + example: 30 + quality: + type: string + enum: + - 1080p + - 720p + description: The viudeo quality of the Conference Room. + example: 1080p + default: 720p + remove_at: + type: string + format: date-time + description: The time to remove all participants from the conference. + example: '2024-05-06T12:20:00Z' + remove_after_seconds_elapsed: + type: integer + format: int32 + minimum: 0 + maximum: 200000 + description: The amount of time in seconds to remove a particpant from a conference after they join. + layout: + allOf: + - $ref: '#/components/schemas/Layout' + description: The video layout of the conference. + example: grid-responsive-mobile + default: grid-responsive + record_on_start: + type: boolean + description: Starts recording when the conference starts. + example: true + enable_room_previews: + type: boolean + description: Enables live video room previews for the conference. + example: true + meta: + type: object + additionalProperties: {} + description: Metadata of the conference. + example: + foo: bar + sync_audio_video: + type: boolean + description: Syncs the participants audio and video. + example: true + tone_on_entry_and_exit: + type: boolean + description: Plays a tone when a participant joins or leaves the conference. + example: true + room_join_video_off: + type: boolean + description: Turns the conference video off when the participant joins the room if `true`. + example: true + user_join_video_off: + type: boolean + description: Turns the participants video off when the participant joins the room if `true`. + example: true + ConferenceRoomUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: max_members must be greater than 0 + attribute: max_members + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + ConstProperty: + type: object + required: + - const + properties: + const: + description: A constant value that can be passed to the function. + title: Const Property + ContextSteps: + type: object + required: + - steps + properties: + steps: + type: array + items: + $ref: '#/components/schemas/ContextStepsParams' + description: An array of objects that define the steps in the context. These steps are used to define the flow of the conversation. + title: steps + title: ContextSteps object + ContextStepsEnd: + type: object + required: + - name + - text + properties: + name: + type: string + description: The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. + example: Take Pizza order + text: + type: string + description: The prompt or instructions given to the AI at this step. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. + step_criteria: + type: string + description: |- + The conditions that must be met for the conversation to proceed to the next step. + If a condition is not met, the conversation will not proceed to the next step. + It's **highly** recommended you create a custom criteria for the step to get the intended behavior. + example: Customer wants to order Pizza + functions: + type: array + items: + type: string + description: An array of SWAIG.functions that can be executed from this step. + example: + - Take Order + - Confirm Order + - Confirm Address + valid_contexts: + type: array + items: + type: string + description: An array of valid contexts that the conversation can transition to from this step. + example: + - Place Order + - Confirm Order + skip_user_turn: + type: boolean + description: A boolean value that, when true, will skip the user's turn to respond in the conversation and proceed to the next step. + end: + type: boolean + description: A boolean value that, when true, will end the contexts conversation and transition to a normal interaction. + title: ContextStepsEnd object + ContextStepsParams: + anyOf: + - $ref: '#/components/schemas/ContextStepsEnd' + - $ref: '#/components/schemas/ContextStepsValidSteps' + title: ContextStepsParams union + ContextStepsUpdate: + type: object + properties: + steps: + type: array + items: + $ref: '#/components/schemas/ContextStepsParams' + description: An array of objects that define the steps in the context. These steps are used to define the flow of the conversation. + title: steps + title: ContextSteps object + ContextStepsValidSteps: + type: object + required: + - name + - text + properties: + name: + type: string + description: The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. + example: Take Pizza order + text: + type: string + description: The prompt or instructions given to the AI at this step. + example: Your name is Franklin and you are taking orders for Franklin's Pizza. + step_criteria: + type: string + description: |- + The conditions that must be met for the conversation to proceed to the next step. + If a condition is not met, the conversation will not proceed to the next step. + It's **highly** recommended you create a custom criteria for the step to get the intended behavior. + example: Customer wants to order Pizza + functions: + type: array + items: + type: string + description: An array of SWAIG.functions that can be executed from this step. + example: + - Take Order + - Confirm Order + - Confirm Address + valid_contexts: + type: array + items: + type: string + description: An array of valid contexts that the conversation can transition to from this step. + example: + - Place Order + - Confirm Order + skip_user_turn: + type: boolean + description: A boolean value that, when true, will skip the user's turn to respond in the conversation and proceed to the next step. + valid_steps: + type: array + items: + type: string + description: |- + An array of valid steps that the conversation can proceed to from this step. + If the array is empty, or the `valid_steps` key is not present, the conversation will proceed to the next step in the context. + example: + - get order + - confirm order + title: ContextStepsValidSteps object + ContextSwitchAction: + type: object + required: + - context_switch + properties: + context_switch: + type: object + properties: + system_prompt: + type: string + description: The instructions to send to the agent. Default is not set. + consolidate: + type: boolean + description: Whether to consolidate the context. Default is `false`. + user_prompt: + type: string + description: |- + A string serving as simulated user input for the AI Agent. + During a context_switch in the AI's prompt, the user_prompt offers the AI pre-established context or guidance. + Default is not set + required: + - system_prompt + description: A JSON object containing the context to switch to. Default is not set. + title: context_switch + title: ContextSwitchAction object + Contexts: + type: object + required: + - default + properties: + default: + allOf: + - $ref: '#/components/schemas/ContextSteps' + description: The default context to use at the beginning of the conversation. Additional context steps can be defined as any other key in the object. + additionalProperties: + $ref: '#/components/schemas/ContextSteps' + title: contexts + ContextsUpdate: + type: object + properties: + default: + allOf: + - $ref: '#/components/schemas/ContextStepsUpdate' + description: The default context to use at the beginning of the conversation. Additional context steps can be defined as any other key in the object. + additionalProperties: + $ref: '#/components/schemas/ContextStepsUpdate' + title: contexts + CxmlApplication: + type: object + required: + - id + - project_id + - friendly_name + - voice_url + - voice_method + - voice_fallback_url + - voice_fallback_method + - status_callback + - status_callback_method + - sms_url + - sms_method + - sms_fallback_url + - sms_fallback_method + - sms_status_callback + - sms_status_callback_method + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the cXML Application. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + description: Project ID for the cXML Application + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + friendly_name: + type: string + description: Display name of the cXML Application + example: Reception App + voice_url: + type: string + nullable: true + description: URL to handle incoming calls + example: https://example.com/voice/incoming + voice_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for voice URL + example: GET + voice_fallback_url: + type: string + nullable: true + description: Fallback URL for voice errors + example: https://example.com/voice/fallback + voice_fallback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for voice fallback URL + example: GET + status_callback: + type: string + format: uri + nullable: true + description: URL to receive status callbacks + example: https://example.com/voice/status + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for status callbacks + example: GET + sms_url: + type: string + nullable: true + description: URL to handle incoming messages + example: https://example.com/message/incoming + sms_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS URL + example: GET + sms_fallback_url: + type: string + nullable: true + description: Fallback URL for SMS errors + example: https://example.com/message/fallback + sms_fallback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS fallback URL + example: GET + sms_status_callback: + type: string + nullable: true + description: URL to receive SMS status callbacks + example: https://example.com/message/status + sms_status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS status callbacks + example: GET + CxmlApplicationAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddress' + description: An array of objects that contain a list of Cxml Application Addresses + links: + allOf: + - $ref: '#/components/schemas/CxmlApplicationAddressPaginationResponse' + description: Object containing pagination links + CxmlApplicationAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + description: Self link for the current page + example: https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_application + first: + type: string + description: Link to the first page of results + example: https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=cxml_application + next: + type: string + description: Link to the next page of results + example: https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application + prev: + type: string + description: Link to the previous page of results + example: https://example.signalwire.com/api/fabric/resources/laml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application + CxmlApplicationListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationResponse' + description: An array of objects containing the list of cXML Application(s) data. + links: + allOf: + - $ref: '#/components/schemas/CxmlApplicationPaginationResponse' + description: Object containing pagination links + CxmlApplicationPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Linmk to the current page + example: https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=0&page_size=50&type=cxml_application + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/cxml_applications?page_size=50&type=cxml_application + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/cxml_applications?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=cxml_application + CxmlApplicationResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - cxml_application + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the cXML Application. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the cXML Application Fabric Resource + example: Reception App + type: + type: string + enum: + - cxml_application + description: Type of the Fabric Resource + example: cxml_application + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + cxml_application: + allOf: + - $ref: '#/components/schemas/CxmlApplication' + description: cXML Application data. + CxmlApplicationUpdateRequest: + type: object + properties: + display_name: + type: string + description: Display name of the cXML Application + example: Reception App + account_sid: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Project ID for the cXML Application + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + voice_url: + type: string + description: URL to handle incoming calls + example: https://example.com/voice/incoming + voice_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for voice URL + example: POST + voice_fallback_url: + type: string + description: Fallback URL for voice errors + example: https://example.com/voice/fallback + voice_fallback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for voice fallback URL + example: POST + status_callback: + type: string + description: URL to receive status callbacks + example: https://example.com/voice/status + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for status callbacks + example: POST + sms_url: + type: string + description: URL to handle incoming messages + example: https://example.com/message/incoming + sms_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS URL + example: POST + sms_fallback_url: + type: string + description: Fallback URL for SMS errors + example: https://example.com/message/fallback + sms_fallback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS fallback URL + example: POST + sms_status_callback: + type: string + description: URL to receive SMS status callbacks + example: https://example.com/message/status + sms_status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: HTTP method for SMS status callbacks + example: POST + CxmlApplicationUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: voice_url must be a valid URL + attribute: voice_url + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + DataMap: + oneOf: + - $ref: '#/components/schemas/Output' + - $ref: '#/components/schemas/Expression' + - $ref: '#/components/schemas/Webhook' + title: DataMap union + DialogFlowPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link to the current page + example: https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=0&page_size=50&type=dialogflow_agent + first: + type: string + format: uri + description: Link to the first page + example: https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_size=50&type=dialogflow_agent + next: + type: string + format: uri + description: Link to the next page + example: https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent + prev: + type: string + format: uri + description: Link to the previous page + example: https://devspace.signalwire.com/api/fabric/resources/dialogflow_agents?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent + DialogflowAgent: + type: object + required: + - id + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of a Dialogflow Agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + say_enabled: + type: boolean + description: Whether to enable the 'say' feature + example: true + say: + type: string + description: Default message to say + example: Welcome to the Booking Assistant + voice: + type: string + description: Voice to use for speech + example: en-US-Wavenet-D + display_name: + type: string + description: Display name of the Dialogflow Agent + example: Booking Assistant + dialogflow_reference_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Dialogflow reference ID + example: 12345678-1234-1234-1234-1234567890ab + dialogflow_reference_name: + type: string + description: Dialogflow reference name + example: my dialogflow agent + DialogflowAgentAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects that contain a list of Dialogflow Agent Addresses + links: + allOf: + - $ref: '#/components/schemas/DialogflowAgentAddressPaginationResponse' + description: Object containing pagination links + DialogflowAgentAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&type=dialogflow_agent + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&type=dialogflow_agent + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/dialogflow_agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=dialogflow_agent + DialogflowAgentListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/DialogflowAgentResponse' + description: An array of objects that contain a list of Dialogflow Agent data + links: + allOf: + - $ref: '#/components/schemas/DialogFlowPaginationResponse' + description: Object containing pagination links + DialogflowAgentResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - dialogflow_agent + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Dialogflow Agent. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Dialogflow Agent Fabric Resource + example: Customer Service Agent + type: + type: string + enum: + - dialogflow_agent + description: Type of the Fabric Resource + example: dialogflow_agent + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + dialogflow_agent: + allOf: + - $ref: '#/components/schemas/DialogflowAgent' + description: Dialogflow Agent data. + DialogflowAgentUpdateRequest: + type: object + properties: + name: + type: string + description: Name of the Dialogflow Agent + example: Booking Assistant + say_enabled: + type: boolean + description: Whether to enable the 'say' feature + example: true + say: + type: string + description: Default message to say + example: Welcome to the Booking Assistant + voice: + type: string + description: Voice to use for speech + example: en-US-Wavenet-D + DialogflowAgentUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: language_code must be a valid language code + attribute: language_code + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + Direction: + type: string + enum: + - inbound + - outbound + title: Direction enum + DisplayTypes: + type: string + enum: + - app + - room + - call + - subscriber + description: DisplayTypes + DomainApplicationAssignRequest: + type: object + required: + - domain_application_id + properties: + domain_application_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The id of the domain application you wish to assign a resource to. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + DomainApplicationCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + DomainApplicationResponse: + type: object + required: + - id + - name + - display_name + - cover_url + - preview_url + - locked + - channels + - created_at + - type + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Fabric Address. + example: 691af061-cd86-4893-a605-173f47afc4c2 + name: + type: string + description: Name of the Fabric Address. + example: justice-league + display_name: + type: string + description: Display name of the Fabric Address. + example: Justice League + cover_url: + type: string + description: Cover url of the Fabric Address. + example: https://coverurl.com + preview_url: + type: string + description: Preview url of the Fabric Address. + example: https://previewurl.com + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - app + description: The display type of a fabric address pointing to an application. + example: app + title: Application Address + EmbedTokenCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: token is required + attribute: token + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + EmbedsTokensRequest: + type: object + required: + - token + properties: + token: + type: string + description: Click to Call Token + example: c2c_7acc0e5e968706a032983cd80cdca219 + EmbedsTokensResponse: + type: object + required: + - token + properties: + token: + type: string + format: jwt + description: Encrypted guest token. + example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0.. + Encryption: + type: string + enum: + - required + - optional + - default + Expression: + type: object + required: + - expressions + properties: + expressions: + type: array + items: + type: object + properties: + string: + type: string + description: The actual input or value from the user or system. + example: I want a refund + pattern: + type: string + description: A regular expression pattern to validate or match the string. + output: + type: object + properties: + response: + type: string + description: A static response text or message returned to the AI agents context. + example: Order placed + action: + type: array + items: + $ref: '#/components/schemas/Action' + description: A list of actions to be performed upon matching. + required: + - response + description: An object that defines the `response` or `action` to be taken when the webhook is successfully triggered. + title: output + required: + - string + - pattern + - output + description: An array of objects that define patterns and corresponding actions. + title: expressions + title: Expression object + FabricAddress: type: object required: - id - - resource_id - name - display_name - - type - cover_url - preview_url - - channel + - locked + - channels + - created_at + - type properties: id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the Fabric Address. example: 691af061-cd86-4893-a605-173f47afc4c2 - resource_id: + name: + type: string + description: Name of the Fabric Address. + example: justice-league + display_name: + type: string + description: Display name of the Fabric Address. + example: Justice League + cover_url: + type: string + description: Cover url of the Fabric Address. + example: https://coverurl.com + preview_url: + type: string + description: Preview url of the Fabric Address. + example: https://previewurl.com + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + $ref: '#/components/schemas/DisplayTypes' + FabricAddressApp: + type: object + required: + - id + - name + - display_name + - cover_url + - preview_url + - locked + - channels + - created_at + - type + properties: + id: allOf: - $ref: '#/components/schemas/uuid' - description: Fabric resource ID that the Fabric Address belongs to. + format: uuid + description: Unique ID of the Fabric Address. example: 691af061-cd86-4893-a605-173f47afc4c2 name: type: string @@ -1635,11 +7393,6 @@ components: type: string description: Display name of the Fabric Address. example: Justice League - type: - allOf: - - $ref: '#/components/schemas/DisplayTypes' - description: Type of the Fabric Address. - example: app cover_url: type: string description: Cover url of the Fabric Address. @@ -1648,104 +7401,218 @@ components: type: string description: Preview url of the Fabric Address. example: https://previewurl.com - channel: + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: allOf: - $ref: '#/components/schemas/AddressChannel' description: Channels of the Fabric Address. - AIAgentAddressListResponse: + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - app + description: The display type of a fabric address pointing to an application. + example: app + title: Application Address + FabricAddressCall: type: object required: - - data - - links + - id + - name + - display_name + - cover_url + - preview_url + - locked + - channels + - created_at + - type properties: - data: - type: array - items: - $ref: '#/components/schemas/AIAgentAddress' - links: - $ref: '#/components/schemas/AIAgentAddressPaginationResponse' - AIAgentAddressPaginationResponse: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Fabric Address. + example: 691af061-cd86-4893-a605-173f47afc4c2 + name: + type: string + description: Name of the Fabric Address. + example: justice-league + display_name: + type: string + description: Display name of the Fabric Address. + example: Justice League + cover_url: + type: string + description: Cover url of the Fabric Address. + example: https://coverurl.com + preview_url: + type: string + description: Preview url of the Fabric Address. + example: https://previewurl.com + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - call + description: The display type of a fabric address pointing to call. + example: call + title: Call Address + FabricAddressPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50 first: type: string format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50 next: type: string format: uri description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - AIAgentCreateRequest: + example: https://example.signalwire.com/api/fabric/addresses?page_number=1&page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + FabricAddressRoom: type: object required: + - id - name + - display_name + - cover_url + - preview_url + - locked + - channels + - created_at + - type properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Fabric Address. + example: 691af061-cd86-4893-a605-173f47afc4c2 name: type: string - description: Name of the AI Agent. - example: My AI Agent - prompt: - allOf: - - $ref: '#/components/schemas/AIPrompt' - description: Establishes the initial set of instructions and settings to configure the agent. - post_prompt: - allOf: - - $ref: '#/components/schemas/AIPostPrompt' - description: The final set of instructions and configuration settings to send to the agent. - params: - allOf: - - $ref: '#/components/schemas/AIParams' - description: A JSON object containing parameters as key-value pairs. - pronounce: - type: array - items: - $ref: '#/components/schemas/Pronounce' - description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. - hints: - type: array - items: - type: string - description: An array of hints (as strings) to provide context to the dialogue. - example: - - One Hint - - Two Hint - languages: - type: array - items: - $ref: '#/components/schemas/Languages' - description: An array of JSON objects defining supported languages in the conversation. - SWAIG: + description: Name of the Fabric Address. + example: justice-league + display_name: + type: string + description: Display name of the Fabric Address. + example: Justice League + cover_url: + type: string + description: Cover url of the Fabric Address. + example: https://coverurl.com + preview_url: + type: string + description: Preview url of the Fabric Address. + example: https://previewurl.com + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: allOf: - - $ref: '#/components/schemas/SWAIG' - description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. - AIAgentCreateStatusCode422: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - room + description: The display type of a fabric address pointing to a Conference Room. + example: room + title: Room Address + FabricAddressSubscriber: type: object required: - - errors + - id + - name + - display_name + - cover_url + - preview_url + - locked + - channels + - created_at + - type properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: missing_required_parameter - message: Name can't be blank - attribute: name - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter - AIAgentListResponse: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Fabric Address. + example: 691af061-cd86-4893-a605-173f47afc4c2 + name: + type: string + description: Name of the Fabric Address. + example: justice-league + display_name: + type: string + description: Display name of the Fabric Address. + example: Justice League + cover_url: + type: string + description: Cover url of the Fabric Address. + example: https://coverurl.com + preview_url: + type: string + description: Preview url of the Fabric Address. + example: https://previewurl.com + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - subscriber + description: The display type of a fabric address pointing to a Subscriber. + example: subscriber + title: Subscriber Address + FabricAddressesResponse: type: object required: - data @@ -1754,541 +7621,282 @@ components: data: type: array items: - $ref: '#/components/schemas/AIAgentResponse' + $ref: '#/components/schemas/FabricAddress' + description: An array of objects containing a list of Resource Addresses links: - $ref: '#/components/schemas/AIAgentPaginationResponse' - AIAgentPaginationResponse: + allOf: + - $ref: '#/components/schemas/FabricAddressPaginationResponse' + description: Object containing pagination links + FreeswitchConectorPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50 + description: The link of the current page + example: https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=0&page_size=50&type=freeswitch_connector first: type: string format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=0&page_size=50 + description: The link of the first page + example: https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_size=50&type=freeswitch_connector next: type: string format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/ai_agents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - AIAgentResponse: + description: The link of the next page + example: https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector + prev: + type: string + format: uri + description: The link of the previous page + example: https://devspace.signalwire.com/api/fabric/resources/freeswitch_connectors?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector + FreeswitchConnector: type: object required: - id - - project_id - - display_name - - type - - created_at - - updated_at - - ai_agent properties: id: allOf: - $ref: '#/components/schemas/uuid' - description: Unique ID of the AIAgent. - example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 - project_id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of the Project. - example: 99151cf8-9548-4860-ba70-a8de824f3312 - display_name: - type: string - description: Display name of the AIAgent Fabric Resource - example: Booking Assistant - type: - type: string - description: Type of the Fabric Resource - example: external_laml_handler - created_at: - type: string - format: date-time - description: Date and time when the resource was created. - example: '2024-10-17T14:14:53Z' - updated_at: - type: string - format: date-time - description: Date and time when the resource was updated. - example: '2024-10-17T14:14:53Z' - ai_agent: - allOf: - - $ref: '#/components/schemas/AIAgentWithID' - description: AIAgent data. - AIAgentUpdateRequest: - type: object - properties: - name: - type: string - description: Name of the AI Agent. - example: My AI Agent - prompt: - allOf: - - $ref: '#/components/schemas/AIPromptUpdate' - description: Establishes the initial set of instructions and settings to configure the agent. - post_prompt: - allOf: - - $ref: '#/components/schemas/AIPostPromptUpdate' - description: The final set of instructions and configuration settings to send to the agent. - params: - allOf: - - $ref: '#/components/schemas/AIParams' - description: A JSON object containing parameters as key-value pairs. - pronounce: - type: array - items: - $ref: '#/components/schemas/Pronounce' - description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. - hints: - type: array - items: - type: string - description: An array of hints (as strings) to provide context to the dialogue. - example: - - One Hint - - Two Hint - languages: - type: array - items: - $ref: '#/components/schemas/Languages' - description: An array of JSON objects defining supported languages in the conversation. - SWAIG: - allOf: - - $ref: '#/components/schemas/SWAIG' - description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. - AIAgentUpdateStatusCode422: - type: object - required: - - errors - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: missing_required_parameter - message: Name can't be blank - attribute: name - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter - AIAgentWithID: - type: object - required: - - agent_id - - name - properties: - agent_id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of an AI Agent. + format: uuid + description: Unique ID of a FreeSWITCH Connector. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 name: type: string - description: Name of the AI Agent. - example: My AI Agent - prompt: - allOf: - - $ref: '#/components/schemas/AIPrompt' - description: Establishes the initial set of instructions and settings to configure the agent. - post_prompt: - allOf: - - $ref: '#/components/schemas/AIPostPrompt' - description: The final set of instructions and configuration settings to send to the agent. - params: - allOf: - - $ref: '#/components/schemas/AIParams' - description: A JSON object containing parameters as key-value pairs. - pronounce: - type: array - items: - $ref: '#/components/schemas/Pronounce' - description: An array of JSON objects to clarify the AI's pronunciation of words or expressions. - hints: - type: array - items: - type: string - description: An array of hints (as strings) to provide context to the dialogue. - example: - - One Hint - - Two Hint - languages: - type: array - items: - $ref: '#/components/schemas/Languages' - description: An array of JSON objects defining supported languages in the conversation. - SWAIG: - allOf: - - $ref: '#/components/schemas/SWAIG' - description: A JSON object to create user-defined functions/endpoints that can be executed during the dialogue. - AIParams: - type: object - properties: - acknowledge_interruptions: - type: boolean - description: Instructs the agent to acknowledge crosstalk and confirm user input when the user speaks over the agent. - ai_volume: - type: integer - minimum: -50 - maximum: 50 - description: Adjust the volume of the AI. Allowed values from `-50` - `50`. - attention_timeout: - anyOf: - - $ref: '#/components/schemas/IntegerOrZero' - - type: number - enum: - - 0 - description: Amount of time, in ms, to wait before prompting the user to respond. Allowed values from `10,000` - `600,000`. Set to `0` to disable. - attention_timeout_prompt: - type: string - description: A custom prompt that is fed into the AI when the attention_timeout is reached. - example: Ask if the user would like you to repeat yourself, or if they need more time to respond. - background_file: + description: Name of the FreeSWITCH Connector + example: Booking Assistant + caller_id: type: string - format: uri - description: URL of audio file to play in the background while AI plays in foreground. - example: https://cdn.signalwire.com/default-music/welcome.mp3 - background_file_loops: - type: integer nullable: true - description: Maximum number of times to loop playing the background file. `undefined` means loop indefinitely. - example: 5 - background_file_volume: - type: integer - minimum: -50 - maximum: 50 - description: Defines background_file volume within a range of `-50` to `50`. - barge_match_string: - type: string - description: |- - Takes a string, including a regular expression, defining barge behavior. - For example, this param can direct the AI to stop when the word 'hippopotomus' is input. - example: Cancel order - barge_min_words: - type: integer - minimum: 1 - maximum: 99 - description: Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - conscience: - type: string - description: Sets the prompt which binds the agent to its purpose. - example: Place an order - conversation_id: - type: string - description: Used by `check_for_input` and `save_conversation` to identify an individual conversation. - example: Conversation ID - debug_webhook_level: - type: integer - minimum: 0 - maximum: 1 - description: Enables debugging to the set URL. Allowed values from `0` - `1`. - debug_webhook_url: - type: string - format: uri - description: Each interaction between the AI and end user is posted in real time to the established URL. - example: https://example.com - direction: - type: array - items: - $ref: '#/components/schemas/Direction' - description: Forces the direction of the call to the assistant. Valid values are `inbound` and `outbound`. - digit_termiantors: + description: Caller ID for the connector + example: '123456' + send_as: type: string - description: "DTMF digit, as a string, to signal the end of input (ex: '#')" - example: '#' - digit_timeout: - type: integer - minimum: 250 - maximum: 10000 - description: Time, in ms, at the end of digit input to detect end of input. Allowed values from `250` - `10,000`. - end_of_speech_timeout: - type: integer - minimum: 250 - maximum: 10000 - description: Amount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from `250` - `10,000`. - eleven_labs_stability: - type: number - description: The stability slider determines how stable the voice is and the randomness between each generation. Lowering this slider introduces a broader emotional range for the voice. - eleven_labs_similarity: - type: number - description: The similarity slider dictates how closely the AI should adhere to the original voice when attempting to replicate it. The higher the similarity, the closer the AI will sound to the original voice. - energy_level: - type: number - minimum: 0 - maximum: 100 - description: Amount of energy necessary for bot to hear you (in dB). Allowed values from `0.0` - `100.0`. - hold_music: + nullable: true + description: Send as identifier + example: '123456' + FreeswitchConnectorAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressCall' + description: An array of objects containing a list of FreeSWITCH Connector Addresses + links: + allOf: + - $ref: '#/components/schemas/FreeswitchConnectorAddressPaginationResponse' + description: Object containing pagination links + FreeswitchConnectorAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: type: string format: uri - description: A URL for the hold music to play, accepting WAV, mp3, and FreeSWITCH tone_stream. - example: https://cdn.signalwire.com/default-music/welcome.mp3 - hold_on_process: - type: boolean - description: Enables hold music during SWAIG processing. - inactivity_timeout: - type: integer - minimum: 10000 - maximum: 3600000 - description: Amount of time, in ms, to wait before exiting the app due to inactivity. Allowed values from `10,000` - `3,600,000`. - input_poll_freq: + description: Link to the current page + example: https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=freeswitch_connector + first: type: string - description: |- - Check for input function with check_for_input. - Example use case: Feeding an inbound SMS to AI on a voice call, eg., for collecting an email address or other complex information. - interrupt_on_noise: - type: boolean - description: When enabled, barges agent upon any sound interruption longer than 1 second. - interrupt_prompt: + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=freeswitch_connector + next: type: string - description: Provide a prompt for the agent to handle crosstalk. - example: Inform user that you can't hear anything - languages_enabled: - type: boolean - description: Allows multilingualism when `true`. - local_tz: + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector + prev: type: string - description: The local timezone setting for the AI. Value should use `IANA TZ ID` - example: America/Ensenada - outbound_attention_timeout: - type: integer - minimum: 10000 - maximum: 600000 - description: Sets a time duration for the outbound call recipient to respond to the AI agent before timeout, in a range from `10000` to `600000`. - save_conversation: - type: boolean - description: |- - Send a summary of the conversation after the call ends. - This requires a `post_url` to be set in the ai parameters and the `conversation_id` defined below. - This eliminates the need for a `post_prompt` in the ai parameters. - swaig_allow_settings: - type: boolean - description: Allows tweaking any of the indicated settings, such as `barge_match_string`, using the returned SWML from the SWAIG function. - swaig_allow_swml: - type: boolean - description: Allows your SWAIG to return SWML to be executed. - swaig_post_conversation: - type: boolean - description: Post entire conversation to any SWAIG call. - transfer_summary: - type: boolean - description: Pass a summary of a conversation from one AI agent to another. For example, transfer a call summary between support agents in two departments. - verbose_logs: - type: boolean - description: Enable verbose logging. - wait_for_user: - type: boolean - description: When false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first. - title: params object - AIPostPrompt: + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/freeswitch_connectors/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=freeswitch_connector + FreeswitchConnectorCreateRequest: type: object required: - - text + - name + - token properties: - text: + name: type: string - description: The instructions to send to the agent. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. - temperature: - type: number - minimum: 0 - maximum: 1.5 - description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. - top_p: - type: number - minimum: 0 - maximum: 1 - description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. - confidence: - type: number - minimum: 0 - maximum: 1 - description: |- - Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. - Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. - presence_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. - frequency_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. - title: post_prompt - AIPostPromptUpdate: + description: Name of the FreeSWITCH Connector + example: Booking Assistant + token: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: FreeSWITCH token + example: 993ed018-9e79-4e50-b97b-984bd5534095 + FreeswitchConnectorCreateStatusCode422: type: object + required: + - errors properties: - text: - type: string - description: The instructions to send to the agent. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. - temperature: - type: number - minimum: 0 - maximum: 1.5 - description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. - top_p: - type: number - minimum: 0 - maximum: 1 - description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. - confidence: - type: number - minimum: 0 - maximum: 1 - description: |- - Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. - Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. - presence_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. - frequency_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. - title: post_prompt - AIPrompt: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: host is required + attribute: host + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + FreeswitchConnectorListResponse: type: object required: - - text + - links + - data properties: - text: - type: string - description: The instructions to send to the agent. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. - temperature: - type: number - minimum: 0 - maximum: 1.5 - description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. - top_p: - type: number - minimum: 0 - maximum: 1 - description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. - confidence: - type: number - minimum: 0 - maximum: 1 - description: |- - Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. - Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. - presence_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. - frequency_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. - contexts: + links: allOf: - - $ref: '#/components/schemas/Contexts' - description: |- - An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. - Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. - Additionally, more context steps can be defined as any other key in the object. - title: prompt - AIPromptUpdate: + - $ref: '#/components/schemas/FreeswitchConectorPaginationResponse' + description: Object containing pagination links + data: + type: array + items: + $ref: '#/components/schemas/FreeswitchConnectorResponse' + description: An array of objects containing a list of FreeSWITCH connector data + FreeswitchConnectorResponse: type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - freeswitch_connector properties: - text: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the FreeSWITCH Connector. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: The instructions to send to the agent. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. Begin by greeting the caller, and ask if they'd like to place an order for pickup or delivery. - temperature: - type: number - minimum: 0 - maximum: 1.5 - description: Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. - top_p: - type: number - minimum: 0 - maximum: 1 - description: Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. - confidence: - type: number - minimum: 0 - maximum: 1 - description: |- - Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. - Decreasing this value will reduce the pause after the user speaks, but may introduce false positives. - presence_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. - frequency_penalty: - type: number - minimum: -2 - maximum: 2 - description: Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. - contexts: + description: Display name of the FreeSWITCH Connector Fabric Resource + example: Main FreeSWITCH Server + type: + type: string + enum: + - freeswitch_connector + description: Type of the Fabric Resource + example: freeswitch_connector + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + freeswitch_connector: allOf: - - $ref: '#/components/schemas/ContextsUpdate' - description: |- - An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. - Every context object requires a `default` key, which is the default context to use at the beginning of the conversation. - Additionally, more context steps can be defined as any other key in the object. - title: prompt - Action: - anyOf: - - $ref: '#/components/schemas/ContextSwitchAction' - - $ref: '#/components/schemas/PlaybackBGAction' - - $ref: '#/components/schemas/SayAction' - - $ref: '#/components/schemas/SetGlobalDataAction' - - $ref: '#/components/schemas/SetMetaDataAction' - - $ref: '#/components/schemas/StopAction' - - $ref: '#/components/schemas/StopPlaybackBGAction' - - $ref: '#/components/schemas/ToggleFunctionsAction' - - $ref: '#/components/schemas/UnsetGlobalDataAction' - - $ref: '#/components/schemas/UnsetMetaDataAction' - - $ref: '#/components/schemas/UserInputAction' - title: Action union - AddressChannel: - anyOf: - - $ref: '#/components/schemas/AudioChannel' - - $ref: '#/components/schemas/MessagingChannel' - - $ref: '#/components/schemas/VideoChannel' - AllOfProperty: + - $ref: '#/components/schemas/FreeswitchConnector' + description: FreeSWITCH Connector data. + FreeswitchConnectorUpdateRequest: + type: object + properties: + name: + type: string + description: Name of the FreeSWITCH Connector + example: Booking Assistant + caller_id: + type: string + description: Caller ID for the connector + example: '123456' + send_as: + type: string + description: Send as identifier + example: '123456' + FreeswitchConnectorUpdateStatusCode422: type: object required: - - allOf + - errors properties: - allOf: + errors: type: array items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: port must be between 1 and 65535 + attribute: port + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + FunctionParameters: + type: object + required: + - type + - properties + properties: + type: + type: string + enum: + - object + description: The type of argument the AI is passing to the function. Possible values are 'string' and 'object'. + properties: + type: object + additionalProperties: $ref: '#/components/schemas/SchemaType' - description: An array of schemas where all of the schemas must be valid. - title: allOf Property - AnyOfProperty: + description: |- + An object containing the property definitions that are passed to the function. + + A property definition is a valid JSON schema type with dynamic property names, where: + - Keys: User-defined strings, that set the property names. + - Values: A valid property type, which can be one of the following: `string`, `integer`, `number`, `boolean`, `array`, `object`, or `null`. + required: + type: array + items: + type: string + description: An array of required property names from the `properties` object. + example: + - name1 + - name2 + GuestTokenCreateStatusCode422: type: object required: - - anyOf + - errors properties: - anyOf: + errors: type: array items: - $ref: '#/components/schemas/SchemaType' - description: An array of schemas where at least one of the schemas must be valid. - title: anyOf Property - ArrayProperty: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: must_belong_to_project + message: The addresses must belong to the project + attribute: allowed_addresses + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#must_belong_to_project + IntegerOrZero: + type: integer + minimum: 10000 + maximum: 600000 + IntegerProperty: type: object required: - type - - items properties: description: type: string @@ -2300,28 +7908,168 @@ components: type: type: string enum: - - array + - integer description: The type of parameter(s) the AI is passing to the function. - default: + enum: type: array - items: {} - description: The default array value - items: - allOf: - - $ref: '#/components/schemas/SchemaType' - description: Schema for array items + items: + type: integer + description: An array of integers that are the possible values + example: + - 1 + - 2 + - 3 + default: + type: integer + description: The default integer value + example: 5 description: Base interface for all property types - title: Array Function Property - AudioChannel: + title: Integer Function Property + InviteTokenCreateStatusCode422: type: object required: - - audio + - errors properties: - audio: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter + message: Address is invalid + attribute: address_id + url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter + - type: validation_error + code: invalid_parameter + message: Expires At must be an integer + attribute: expires_at + url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter + - type: validation_error + code: invalid_parameter + message: Expires At must be greater than 1733254773 + attribute: expires_at + url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter + Languages: + type: object + allOf: + - $ref: '#/components/schemas/LanguagesWithFillers' + title: languages + LanguagesWithFillers: + type: object + required: + - name + - code + - voice + properties: + name: type: string - description: Audio Channel of Fabric Address - example: /external/resource_name?channel=audio - BooleanProperty: + description: Name of the language ('French', 'English', etc). + example: French + code: + type: string + description: Language code. For example, 'fr-FR'. + example: fr-FR + voice: + type: string + description: Voice to use for the language. For example, 'fr-FR-Neural2-B'. + example: fr-FR-Neural2-B + function_fillers: + type: array + items: + type: string + description: An array of strings to be used as fillers in the conversation when calling a `swaig function`. This helps the AI break silence between responses. + example: + - great + - ok + speech_fillers: + type: array + items: + type: string + description: An array of strings to be used as fillers in the conversation. This helps the AI break silence between responses. + example: + - umm + - hmm + title: LanguagesWithFillers + Layout: + type: string + enum: + - grid-responsive + - grid-responsive-mobile + - highlight-1-responsive + - 1x1 + - 2x1 + - 2x2 + - 5up + - 3x3 + - 4x4 + - 5x5 + - 6x6 + - 8x8 + - 10x10 + MessagingChannel: + type: object + required: + - messaging + properties: + messaging: + type: string + description: Messaging Channel of Fabric Address + example: /external/resource_name?channel=messaging + NullProperty: + type: object + required: + - type + - description + properties: + type: + type: string + enum: + - 'null' + description: The type of parameter(s) the AI is passing to the function. + description: + type: string + description: A description of the property. + example: Property Description + title: Null Function Property + NumberProperty: + type: object + required: + - type + properties: + description: + type: string + description: A description of the property. + example: Property description + nullable: + type: boolean + description: Whether the property can be null. + type: + type: string + enum: + - number + description: The type of parameter(s) the AI is passing to the function. + enum: + type: array + items: + anyOf: + - type: integer + - type: number + description: An array of integers that are the possible values + example: + - 1 + - 2 + - 3 + default: + anyOf: + - type: integer + - type: number + description: The default integer value + example: 3 + description: Base interface for all property types + title: Number Function Property + ObjectProperty: type: object required: - type @@ -2336,89 +8084,112 @@ components: type: type: string enum: - - boolean + - object description: The type of parameter(s) the AI is passing to the function. default: - type: boolean - description: The default boolean value + type: object + additionalProperties: {} + description: The default object value + properties: + type: object + additionalProperties: + $ref: '#/components/schemas/SchemaType' + description: Nested properties + required: + type: array + items: + type: string + description: Required property names + example: + - name1 + - name2 description: Base interface for all property types - title: Boolean Function Property - CXMLWebhook: + title: Object Function Property + OneOfProperty: type: object required: - - id - - name - - used_for - - primary_request_url - - primary_request_method - - fallback_request_url - - fallback_request_method - - status_callback_url - - status_callback_method + - oneOf properties: - id: + oneOf: + type: array + items: + $ref: '#/components/schemas/SchemaType' + description: An array of schemas where exactly one of the schemas must be valid. + title: oneOf Property + Output: + type: object + required: + - output + properties: + output: + type: object + properties: + response: + type: string + description: A static response text or message returned to the AI agents context. + example: Order placed + action: + type: array + items: + $ref: '#/components/schemas/Action' + description: A list of actions to be performed upon matching. + required: + - response + description: An object that defines the `response` or `action` to be taken when the webhook is successfully triggered. + title: output + title: Output object + PhoneRouteAssignRequest: + type: object + required: + - phone_route_id + - handler + properties: + phone_route_id: allOf: - $ref: '#/components/schemas/uuid' - description: Unique ID of the CXML Webhook. - example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 - name: - type: string - description: Name of the CXML Webhook. - example: My CXML Webhook - used_for: + format: uuid + description: The id of the phone route. + example: 691af061-cd86-4893-a605-173f47afc4c2 + handler: allOf: - $ref: '#/components/schemas/UsedForType' - description: Used for of the CXML Webhook. + description: Indicates if the resource should be assigned to a `calling` or `messaging` handler. example: calling - primary_request_url: - type: string - description: Primary request url of the CXML Webhook. - example: https://primary.com - primary_request_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' - description: Primary request method of the CXML Webhook. - example: GET - fallback_request_url: - type: string - description: Fallback request url of the CXML Webhook. - example: https://fallback.com - fallback_request_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' - description: Fallback request method of the CXML Webhook. - example: GET - status_callback_url: - type: string - description: Status callback url of the CXML Webhook. - example: https://callback.com - status_callback_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' - description: Status callback method of the CXML Webhook. - example: POST - CXMLWebhookAddress: + PhoneRouteCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: phone_number is required + attribute: phone_number + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + PhoneRouteResponse: type: object required: - id - - resource_id - name - display_name - - type - cover_url - preview_url - - channel + - locked + - channels + - created_at + - type properties: id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the Fabric Address. example: 691af061-cd86-4893-a605-173f47afc4c2 - resource_id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Fabric resource ID that the Fabric Address belongs to. - example: 691af061-cd86-4893-a605-173f47afc4c2 name: type: string description: Name of the Fabric Address. @@ -2427,11 +8198,6 @@ components: type: string description: Display name of the Fabric Address. example: Justice League - type: - allOf: - - $ref: '#/components/schemas/DisplayTypes' - description: Type of the Fabric Address. - example: app cover_url: type: string description: Cover url of the Fabric Address. @@ -2440,11 +8206,110 @@ components: type: string description: Preview url of the Fabric Address. example: https://previewurl.com - channel: + locked: + type: boolean + description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. + example: true + channels: allOf: - $ref: '#/components/schemas/AddressChannel' description: Channels of the Fabric Address. - CXMLWebhookAddressListResponse: + created_at: + type: string + format: date-time + description: Fabric Address Creation Date. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - app + description: The display type of a fabric address pointing to an application. + example: app + title: Application Address + PlaybackBGAction: + type: object + required: + - playback_bg + properties: + playback_bg: + type: object + properties: + file: + type: string + format: uri + description: URL or filepath of the audio file to play. + example: https://cdn.signalwire.com/default-music/welcome.mp3 + wait: + type: boolean + description: Whether to wait for the audio file to finish playing before continuing. Default is `false`. + required: + - file + description: A JSON object containing the audio file to play. + title: playback_bg + title: PlaybackBGAction object + Pronounce: + type: object + required: + - replace + - with + properties: + replace: + type: string + description: The expression to replace. + example: pizza + with: + type: string + description: The phonetic spelling of the expression. + example: pissa + ignore_case: + type: boolean + description: Whether the pronunciation replacement should ignore case. + title: Pronounce object + RefreshTokenStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: token_expired + message: Token has expired. + attribute: refresh_token + url: https://developer.signalwire.com/rest/overview/error-codes#token_expired + RelayApplication: + type: object + required: + - id + - name + - topic + - call_status_callback_url + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of a Relay Application. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: + type: string + description: Name of the Relay Application + example: Booking Assistant + topic: + type: string + description: Topic of the Relay Application + example: booking + call_status_callback_url: + type: string + format: uri + nullable: true + description: Call status callback URL + example: https://example.com/callbacks + RelayApplicationAddressListResponse: type: object required: - data @@ -2453,85 +8318,53 @@ components: data: type: array items: - $ref: '#/components/schemas/CXMLWebhookAddress' + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects that contain a list of Relay Application Addresses links: - $ref: '#/components/schemas/CXMLWebhookAddressPaginationResponse' - CXMLWebhookAddressPaginationResponse: + allOf: + - $ref: '#/components/schemas/RelayApplicationAddressPaginationResponse' + description: Object containing pagination links + RelayApplicationAddressPaginationResponse: type: object required: - self - first - - next properties: self: type: string - format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Self link for the current page + example: https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=relay_application first: type: string - format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 - next: - type: string - format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - CXMLWebhookCreateRequest: - type: object - required: - - primary_request_url - properties: - name: - type: string - description: Name of the CXML Webhook. - example: My CXML Webhook - used_for: - type: string - enum: - - calling - - messaging - description: Used for of the CXML Webhook. - example: calling - default: calling - primary_request_url: - type: string - description: Primary request url of the CXML Webhook. - example: https://primary.com - primary_request_method: - type: string - enum: - - GET - - POST - description: Primary request method of the CXML Webhook. - example: GET - default: POST - fallback_request_url: + example: https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=relay_application + next: type: string - description: Fallback request url of the CXML Webhook. - example: https://fallback.com - fallback_request_method: + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=relay_application + prev: type: string - enum: - - GET - - POST - description: Fallback request method of the CXML Webhook. - example: GET - default: POST - status_callback_url: + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/relay_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=relay_application + RelayApplicationCreateRequest: + type: object + required: + - name + - topic + properties: + name: type: string - description: Status callback url of the CXML Webhook. - example: https://callback.com - status_callback_method: + description: Name of the Relay Application + example: Booking Assistant + topic: type: string - enum: - - GET - - POST - description: Status callback method of the CXML Webhook. - example: POST - default: POST - CXMLWebhookCreateStatusCode422: + description: Topic of the Relay Application + example: booking + call_status_callback_url: + type: string + description: Call status callback URL + example: https://booking.com/callbacks + RelayApplicationCreateStatusCode422: type: object required: - errors @@ -2543,11 +8376,11 @@ components: example: errors: - type: validation_error - code: http_url_required - message: This value must be an HTTP or HTTPS URL. - attribute: status_callback_url - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required - CXMLWebhookListResponse: + code: missing_required_parameter + message: name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + RelayApplicationListResponse: type: object required: - data @@ -2556,32 +8389,13 @@ components: data: type: array items: - $ref: '#/components/schemas/CXMLWebhookResponse' + $ref: '#/components/schemas/RelayApplicationResponse' + description: An array of objects that contain a list of Relay Application data links: - $ref: '#/components/schemas/CXMLWebhookPaginationResponse' - CXMLWebhookPaginationResponse: - type: object - required: - - self - - first - - next - properties: - self: - type: string - format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50 - first: - type: string - format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=0&page_size=50 - next: - type: string - format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - CXMLWebhookResponse: + allOf: + - $ref: '#/components/schemas/RelayApplicationAddressPaginationResponse' + description: Object containing pagination links + RelayApplicationResponse: type: object required: - id @@ -2590,817 +8404,858 @@ components: - type - created_at - updated_at - - cxml_webhook + - relay_application properties: id: allOf: - $ref: '#/components/schemas/uuid' - description: Unique ID of the CXMLWebhook. - example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + format: uuid + description: Unique ID of the Relay Application. + example: 993ed018-9e79-4e50-b97b-984bd5534095 project_id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the Project. - example: 99151cf8-9548-4860-ba70-a8de824f3312 + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 display_name: type: string - description: Display name of the CXMLWebhook Fabric Resource - example: Booking Assistant + description: Display name of the Relay Application Fabric Resource + example: Customer Service Bot type: type: string + enum: + - relay_application description: Type of the Fabric Resource - example: cxml_webhook + example: relay_application created_at: type: string format: date-time description: Date and time when the resource was created. - example: '2024-10-17T14:14:53Z' + example: '2024-05-06T12:20:00Z' updated_at: type: string format: date-time description: Date and time when the resource was updated. - example: '2024-10-17T14:14:53Z' - cxml_webhook: + example: '2024-05-06T12:20:00Z' + relay_application: allOf: - - $ref: '#/components/schemas/CXMLWebhook' - description: CXMLWebhook data. - CXMLWebhookUpdateRequest: - type: object - properties: - name: - type: string - description: Name of the CXML Webhook. - example: My CXML Webhook - used_for: - type: string - enum: - - calling - - messaging - description: Used for of the CXML Webhook. - example: calling - default: calling - primary_request_url: - type: string - description: Primary request url of the CXML Webhook. - example: https://primary.com - primary_request_method: - type: string - enum: - - GET - - POST - description: Primary request method of the CXML Webhook. - example: GET - default: POST - fallback_request_url: - type: string - description: Fallback request url of the CXML Webhook. - example: https://fallback.com - fallback_request_method: - type: string - enum: - - GET - - POST - description: Fallback request method of the CXML Webhook. - example: GET - default: POST - status_callback_url: - type: string - description: Status callback url of the CXML Webhook. - example: https://callback.com - status_callback_method: - type: string - enum: - - GET - - POST - description: Status callback method of the CXML Webhook. - example: POST - default: POST - CXMLWebhookUpdateStatusCode422: - type: object - required: - - errors - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: http_url_required - message: This value must be an HTTP or HTTPS URL. - attribute: status_callback_url - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#http_url_required - CipherType: - type: string - enum: - - AEAD_AES_256_GCM_8 - - AES_256_CM_HMAC_SHA1_80 - - AES_CM_128_HMAC_SHA1_80 - - AES_256_CM_HMAC_SHA1_32 - - AES_CM_128_HMAC_SHA1_32 - description: Ciphers - CodecType: - type: string - enum: - - OPUS - - G722 - - PCMU - - PCMA - - G729 - - VP8 - - H264 - description: Codecs - ConstProperty: - type: object - required: - - const - properties: - const: - description: A constant value that can be passed to the function. - title: Const Property - ContextSteps: - type: object - required: - - steps - properties: - steps: - type: array - items: - $ref: '#/components/schemas/ContextStepsParams' - description: An array of objects that define the steps in the context. These steps are used to define the flow of the conversation. - title: steps - title: ContextSteps object - ContextStepsEnd: - type: object - required: - - name - - text - properties: - name: - type: string - description: The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. - example: Take Pizza order - text: - type: string - description: The prompt or instructions given to the AI at this step. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. - step_criteria: - type: string - description: |- - The conditions that must be met for the conversation to proceed to the next step. - If a condition is not met, the conversation will not proceed to the next step. - It's **highly** recommended you create a custom criteria for the step to get the intended behavior. - example: Customer wants to order Pizza - functions: - type: array - items: - type: string - description: An array of SWAIG.functions that can be executed from this step. - example: - - Take Order - - Confirm Order - - Confirm Address - valid_contexts: - type: array - items: - type: string - description: An array of valid contexts that the conversation can transition to from this step. - example: - - Place Order - - Confirm Order - skip_user_turn: - type: boolean - description: A boolean value that, when true, will skip the user's turn to respond in the conversation and proceed to the next step. - end: - type: boolean - description: A boolean value that, when true, will end the contexts conversation and transition to a normal interaction. - title: ContextStepsEnd object - ContextStepsParams: - anyOf: - - $ref: '#/components/schemas/ContextStepsEnd' - - $ref: '#/components/schemas/ContextStepsValidSteps' - title: ContextStepsParams union - ContextStepsUpdate: - type: object - properties: - steps: - type: array - items: - $ref: '#/components/schemas/ContextStepsParams' - description: An array of objects that define the steps in the context. These steps are used to define the flow of the conversation. - title: steps - title: ContextSteps object - ContextStepsValidSteps: + - $ref: '#/components/schemas/RelayApplication' + description: Relay Application data. + RelayApplicationUpdateRequest: type: object - required: - - name - - text properties: name: type: string - description: The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. - example: Take Pizza order - text: - type: string - description: The prompt or instructions given to the AI at this step. - example: Your name is Franklin and you are taking orders for Franklin's Pizza. - step_criteria: - type: string - description: |- - The conditions that must be met for the conversation to proceed to the next step. - If a condition is not met, the conversation will not proceed to the next step. - It's **highly** recommended you create a custom criteria for the step to get the intended behavior. - example: Customer wants to order Pizza - functions: - type: array - items: - type: string - description: An array of SWAIG.functions that can be executed from this step. - example: - - Take Order - - Confirm Order - - Confirm Address - valid_contexts: + description: Name of the Relay Application + example: Booking Assistant + topic: + type: string + description: Topic of the Relay Application + example: booking + call_status_callback_url: + type: string + description: Call status callback URL + example: https://booking.com/callbacks + RelayApplicationUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: type: array items: - type: string - description: An array of valid contexts that the conversation can transition to from this step. - example: - - Place Order - - Confirm Order - skip_user_turn: - type: boolean - description: A boolean value that, when true, will skip the user's turn to respond in the conversation and proceed to the next step. - valid_steps: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: webhook_url must be a valid URL + attribute: webhook_url + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + ResourceAddressListResponse: + type: object + required: + - data + - links + properties: + data: type: array items: - type: string - description: |- - An array of valid steps that the conversation can proceed to from this step. - If the array is empty, or the `valid_steps` key is not present, the conversation will proceed to the next step in the context. - example: - - get order - - confirm order - title: ContextStepsValidSteps object - ContextSwitchAction: + $ref: '#/components/schemas/FabricAddress' + description: An array opf objects that contain a list of Resource Addresses + links: + allOf: + - $ref: '#/components/schemas/ResourceAddressPaginationResponse' + description: Object containing pagination links + ResourceAddressPaginationResponse: type: object required: - - context_switch + - self + - first properties: - context_switch: - type: object - properties: - system_prompt: - type: string - description: The instructions to send to the agent. Default is not set. - consolidate: - type: boolean - description: Whether to consolidate the context. Default is `false`. - user_prompt: - type: string - description: |- - A string serving as simulated user input for the AI Agent. - During a context_switch in the AI's prompt, the user_prompt offers the AI pre-established context or guidance. - Default is not set - required: - - system_prompt - description: A JSON object containing the context to switch to. Default is not set. - title: context_switch - title: ContextSwitchAction object - Contexts: + self: + type: string + format: uri + description: Link to the current page of results + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50 + first: + type: string + format: uri + description: Link to the first page of results + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50 + next: + type: string + format: uri + description: Link to the next page of results + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: Link to the previous page of results + example: https://example.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + ResourceListResponse: type: object required: - - default + - data + - links properties: - default: + data: + type: array + items: + $ref: '#/components/schemas/ResourceResponse' + description: An array of objects that contain a list of Resource data + links: allOf: - - $ref: '#/components/schemas/ContextSteps' - description: The default context to use at the beginning of the conversation. Additional context steps can be defined as any other key in the object. - additionalProperties: - $ref: '#/components/schemas/ContextSteps' - title: contexts - ContextsUpdate: + - $ref: '#/components/schemas/ResourcePaginationResponse' + description: Object containing pagination links + ResourcePaginationResponse: type: object + required: + - self + - first properties: - default: - allOf: - - $ref: '#/components/schemas/ContextStepsUpdate' - description: The default context to use at the beginning of the conversation. Additional context steps can be defined as any other key in the object. - additionalProperties: - $ref: '#/components/schemas/ContextStepsUpdate' - title: contexts - DataMap: + self: + type: string + format: uri + description: The link to the current page + example: https://devspace.signalwire.com/api/fabric/resources?page_number=0&page_size=50 + first: + type: string + format: uri + description: The link to the first page + example: https://devspace.signalwire.com/api/fabric/resources?page_size=50 + next: + type: string + format: uri + description: The link to the next page + example: https://devspace.signalwire.com/api/fabric/resources?page_number=1&page_size=50&page_token=PA0f2b7869-304c-45ac-8863-3455ccb34cdc + prev: + type: string + format: uri + description: The link to the previous page + example: https://devspace.signalwire.com/api/fabric/resources?page_number=0&page_size=50&page_token=PA0f2b7869-304c-45ac-8863-3455ccb34cdc + ResourceResponse: oneOf: - - $ref: '#/components/schemas/Output' - - $ref: '#/components/schemas/Expression' - - $ref: '#/components/schemas/Webhook' - title: DataMap union - Direction: - type: string - enum: - - inbound - - outbound - title: Direction enum - DisplayTypes: - type: string - enum: - - app - - room - - call - - subscriber - description: DisplayTypes - EmbedsTokensRequest: + - $ref: '#/components/schemas/ResourceResponseAI' + - $ref: '#/components/schemas/ResourceResponseCallFlow' + - $ref: '#/components/schemas/ResourceResponseCXMLWebhook' + - $ref: '#/components/schemas/ResourceResponseCXMLScript' + - $ref: '#/components/schemas/ResourceResponseCXMLApplication' + - $ref: '#/components/schemas/ResourceResponseDialogFlowAgent' + - $ref: '#/components/schemas/ResourceResponseFSConnector' + - $ref: '#/components/schemas/ResourceResponseRelayApp' + - $ref: '#/components/schemas/ResourceResponseSipEndpoint' + - $ref: '#/components/schemas/ResourceResponseSipGateway' + - $ref: '#/components/schemas/ResourceResponseSubscriber' + - $ref: '#/components/schemas/ResourceResponseSWMLWebhook' + - $ref: '#/components/schemas/ResourceResponseSWMLScript' + - $ref: '#/components/schemas/ResourceResponseConferenceRoom' + ResourceResponseAI: type: object required: - - token + - id + - project_id + - display_name + - created_at + - updated_at + - type + - ai_agent properties: - token: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: Click to Call Token - example: c2c_7acc0e5e968706a032983cd80cdca219 - EmbedsTokensResponse: + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - ai_agent + description: The type of Resource + example: ai_agent + ai_agent: + allOf: + - $ref: '#/components/schemas/AIAgent' + description: An object containing the response data of the AI Agent + title: AI Agent + ResourceResponseCXMLApplication: type: object required: - - token + - id + - project_id + - display_name + - created_at + - updated_at + - type + - cxml_application properties: - token: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: Encrypted guest token. - example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0.. - EncryptionType: - type: string - enum: - - default - - required - - optional - description: Encryption - Expression: + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - cxml_application + description: The type of Resource + example: cxml_application + cxml_application: + allOf: + - $ref: '#/components/schemas/CxmlApplication' + description: An object containing the response data of the cXML Application + title: cXML Application + ResourceResponseCXMLScript: type: object required: - - expressions + - id + - project_id + - display_name + - created_at + - updated_at + - type + - cxml_script properties: - expressions: - type: array - items: - type: object - properties: - string: - type: string - description: The actual input or value from the user or system. - example: I want a refund - pattern: - type: string - description: A regular expression pattern to validate or match the string. - output: - type: object - properties: - response: - type: string - description: A static response text or message returned to the AI agents context. - example: Order placed - action: - type: array - items: - $ref: '#/components/schemas/Action' - description: A list of actions to be performed upon matching. - required: - - response - description: An object that defines the `response` or `action` to be taken when the webhook is successfully triggered. - title: output - required: - - string - - pattern - - output - description: An array of objects that define patterns and corresponding actions. - title: expressions - title: Expression object - FabricAddress: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - cxml_script + description: The type of Resource + example: cxml_script + cxml_script: + allOf: + - $ref: '#/components/schemas/CXMLScript' + description: An object containing the response data of the cXML Script + title: cXML Script + ResourceResponseCXMLWebhook: type: object required: - id - - name + - project_id - display_name - - type - - cover_url - - preview_url - - locked - - channel - created_at + - updated_at + - type + - cxml_webhook properties: id: allOf: - $ref: '#/components/schemas/uuid' - description: Unique ID of the Fabric Address. - example: 691af061-cd86-4893-a605-173f47afc4c2 - name: - type: string - description: Name of the Fabric Address. - example: justice-league - display_name: - type: string - description: Display name of the Fabric Address. - example: Justice League - type: + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: allOf: - - $ref: '#/components/schemas/DisplayTypes' - description: Type of the Fabric Address. - example: app - cover_url: - type: string - description: Cover url of the Fabric Address. - example: https://coverurl.com - preview_url: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: Preview url of the Fabric Address. - example: https://previewurl.com - locked: - type: boolean - description: Locks the Fabric Address. This is used to prevent the Fabric Address from accepting calls. - example: true - channel: - allOf: - - $ref: '#/components/schemas/AddressChannel' - description: Channels of the Fabric Address. + description: Display name of the Resource + example: My Resource created_at: type: string format: date-time - description: Fabric Address Creation Date. - example: 2024-05-06T12:20-12Z - FabricAddressPaginationResponse: - type: object - required: - - self - - first - - next - properties: - self: - type: string - format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/addresses?page_number=0&page_size=50 - first: - type: string - format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/addresses?page_number=0&page_size=50 - next: + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: type: string - format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - FabricAddressesResponse: - type: object - required: - - data - - links - properties: - data: - type: array - items: - $ref: '#/components/schemas/FabricAddress' - links: - $ref: '#/components/schemas/FabricAddressPaginationResponse' - FunctionParameters: - type: object - required: - - type - - properties - properties: + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' type: type: string enum: - - object - description: The type of argument the AI is passing to the function. Possible values are 'string' and 'object'. - properties: - type: object - additionalProperties: - $ref: '#/components/schemas/SchemaType' - description: |- - An object containing the property definitions that are passed to the function. - - A property definition is a valid JSON schema type with dynamic property names, where: - - Keys: User-defined strings, that set the property names. - - Values: A valid property type, which can be one of the following: `string`, `integer`, `number`, `boolean`, `array`, `object`, or `null`. - required: - type: array - items: - type: string - description: An array of required property names from the `properties` object. - example: - - name1 - - name2 - GuestTokenCreateStatusCode422: - type: object - required: - - errors - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: must_belong_to_project - message: The addresses must belong to the project - attribute: allowed_addresses - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#must_belong_to_project - IntegerOrZero: - type: integer - minimum: 10000 - maximum: 600000 - IntegerProperty: + - cxml_webhook + description: The type of Resource + example: cxml_webhook + cxml_webhook: + allOf: + - $ref: '#/components/schemas/CXMLWebhook' + description: An object containing the response data of the cXML Webhook + title: cXML Webhook + ResourceResponseCallFlow: type: object required: + - id + - project_id + - display_name + - created_at + - updated_at - type + - call_flow properties: - description: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: A description of the property. - example: Property description - nullable: - type: boolean - description: Whether the property can be null. + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' type: type: string enum: - - integer - description: The type of parameter(s) the AI is passing to the function. - enum: - type: array - items: - type: integer - description: An array of integers that are the possible values - example: - - 1 - - 2 - - 3 - default: - type: integer - description: The default integer value - example: 5 - description: Base interface for all property types - title: Integer Function Property - InviteTokenCreateStatusCode422: - type: object - required: - - errors - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: invalid_parameter - message: Address is invalid - attribute: address_id - url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter - - type: validation_error - code: invalid_parameter - message: Expires At must be an integer - attribute: expires_at - url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter - - type: validation_error - code: invalid_parameter - message: Expires At must be greater than 1733254773 - attribute: expires_at - url: https://developer.signalwire.com/rest/overview/error-codes#invalid_parameter - Languages: - type: object - allOf: - - $ref: '#/components/schemas/LanguagesWithFillers' - title: languages - LanguagesWithFillers: + - call_flow + description: The type of Resource + example: call_flow + call_flow: + allOf: + - $ref: '#/components/schemas/CallFlow' + description: An object containing the response data of the Call Flow + title: Call Flow + ResourceResponseConferenceRoom: type: object required: - - name - - code - - voice + - id + - project_id + - display_name + - created_at + - updated_at + - type + - conference_room properties: - name: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: Name of the language ('French', 'English', etc). - example: French - code: + description: Display name of the Resource + example: My Resource + created_at: type: string - description: Language code. For example, 'fr-FR'. - example: fr-FR - voice: + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: type: string - description: Voice to use for the language. For example, 'fr-FR-Neural2-B'. - example: fr-FR-Neural2-B - function_fillers: - type: array - items: - type: string - description: An array of strings to be used as fillers in the conversation when calling a `swaig function`. This helps the AI break silence between responses. - example: - - great - - ok - speech_fillers: - type: array - items: - type: string - description: An array of strings to be used as fillers in the conversation. This helps the AI break silence between responses. - example: - - umm - - hmm - title: LanguagesWithFillers - MessagingChannel: + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - swml_script + description: The type of Resource + example: swml_script + conference_room: + allOf: + - $ref: '#/components/schemas/ConferenceRoom' + description: An object containing the response data of the Conference Room + title: Conference Room + ResourceResponseDialogFlowAgent: type: object required: - - messaging + - id + - project_id + - display_name + - created_at + - updated_at + - type + - dialogflow_agent properties: - messaging: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: Messaging Channel of Fabric Address - example: /external/resource_name?channel=messaging - NullProperty: + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - dialogflow_agent + description: The type of Resource + example: dialogflow_agent + dialogflow_agent: + allOf: + - $ref: '#/components/schemas/DialogflowAgent' + description: An object containing the response data of the Dialogflow Agent + title: Dialogflow Agent + ResourceResponseFSConnector: type: object required: + - id + - project_id + - display_name + - created_at + - updated_at - type - - description + - freeswitch_connector properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' type: type: string enum: - - 'null' - description: The type of parameter(s) the AI is passing to the function. - description: - type: string - description: A description of the property. - example: Property Description - title: Null Function Property - NumberProperty: + - freeswitch_connector + description: The type of Resource + example: freeswitch_connector + freeswitch_connector: + allOf: + - $ref: '#/components/schemas/FreeswitchConnector' + description: An object containing the response data of the FreeSWITCH Connector + title: FreeSWITCH Connector + ResourceResponseRelayApp: type: object required: + - id + - project_id + - display_name + - created_at + - updated_at - type + - relay_application properties: - description: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: A description of the property. - example: Property description - nullable: - type: boolean - description: Whether the property can be null. + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' type: type: string enum: - - number - description: The type of parameter(s) the AI is passing to the function. - enum: - type: array - items: - anyOf: - - type: integer - - type: number - description: An array of integers that are the possible values - example: - - 1 - - 2 - - 3 - default: - anyOf: - - type: integer - - type: number - description: The default integer value - example: 3 - description: Base interface for all property types - title: Number Function Property - ObjectProperty: + - relay_application + description: The type of Resource + example: relay_application + relay_application: + allOf: + - $ref: '#/components/schemas/RelayApplication' + description: An object containing the response data of the Relay Application + title: Relay Application + ResourceResponseSWMLScript: type: object required: + - id + - project_id + - display_name + - created_at + - updated_at - type + - swml_script properties: - description: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - description: A description of the property. - example: Property description - nullable: - type: boolean - description: Whether the property can be null. + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' type: type: string enum: - - object - description: The type of parameter(s) the AI is passing to the function. - default: - type: object - additionalProperties: {} - description: The default object value - properties: - type: object - additionalProperties: - $ref: '#/components/schemas/SchemaType' - description: Nested properties - required: - type: array - items: - type: string - description: Required property names - example: - - name1 - - name2 - description: Base interface for all property types - title: Object Function Property - OneOfProperty: + - swml_script + description: The type of Resource + example: swml_script + swml_script: + allOf: + - $ref: '#/components/schemas/SwmlScript' + description: An object containing the response data of the SWML Script + title: SWML Script + ResourceResponseSWMLWebhook: type: object required: - - oneOf + - id + - project_id + - display_name + - created_at + - updated_at + - type + - swml_webhook properties: - oneOf: - type: array - items: - $ref: '#/components/schemas/SchemaType' - description: An array of schemas where exactly one of the schemas must be valid. - title: oneOf Property - Output: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - swml_webhook + description: The type of Resource + example: swml_webhook + swml_webhook: + allOf: + - $ref: '#/components/schemas/SWMLWebhook' + description: An object containing the response data of the SWML Webhook + title: SWML Webhook + ResourceResponseSipEndpoint: type: object required: - - output + - id + - project_id + - display_name + - created_at + - updated_at + - type + - sip_endpoint properties: - output: - type: object - properties: - response: - type: string - description: A static response text or message returned to the AI agents context. - example: Order placed - action: - type: array - items: - $ref: '#/components/schemas/Action' - description: A list of actions to be performed upon matching. - required: - - response - description: An object that defines the `response` or `action` to be taken when the webhook is successfully triggered. - title: output - title: Output object - PaginationResponse: - type: object - required: - - self - - first - - next + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - sip_endpoint + description: The type of Resource + example: sip_endpoint + sip_endpoint: + allOf: + - $ref: '#/components/schemas/SipEndpoint' + description: An object containing the response data of the SIP Endpoint + title: SIP Endpoint + ResourceResponseSipGateway: + type: object + required: + - id + - project_id + - display_name + - created_at + - updated_at + - type + - sip_gateway properties: - self: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: type: string - format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50 - first: + description: Display name of the Resource + example: My Resource + created_at: type: string - format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50 - next: + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: type: string - format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - PlaybackBGAction: + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - sip_gateway + description: The type of Resource + example: sip_gateway + sip_gateway: + allOf: + - $ref: '#/components/schemas/SipGateway' + description: An object containing the response data of the SIP Gateway + title: SIP Gateway + ResourceResponseSubscriber: type: object required: - - playback_bg + - id + - project_id + - display_name + - created_at + - updated_at + - type + - subscriber properties: - playback_bg: - type: object - properties: - file: - type: string - format: uri - description: URL or filepath of the audio file to play. - example: https://cdn.signalwire.com/default-music/welcome.mp3 - wait: - type: boolean - description: Whether to wait for the audio file to finish playing before continuing. Default is `false`. - required: - - file - description: A JSON object containing the audio file to play. - title: playback_bg - title: PlaybackBGAction object - Pronounce: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Resource. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the Resource + example: My Resource + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + type: + type: string + enum: + - subscriber + description: The type of Resource + example: subscriber + subscriber: + allOf: + - $ref: '#/components/schemas/Subscriber' + description: An object containing the response data of the Subscriber + title: Subscriber + ResourceSipEndpointAssignRequest: type: object required: - - replace - - with + - sip_endpoint_id properties: - replace: - type: string - description: The expression to replace. - example: pizza - with: - type: string - description: The phonetic spelling of the expression. - example: pissa - ignore_case: - type: boolean - description: Whether the pronunciation replacement should ignore case. - title: Pronounce object - RefreshTokenStatusCode422: + sip_endpoint_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The unique identifier of the SIP endpoint. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + title: Create resource SIP endpoint + ResourceSipEndpointCreateStatusCode422: type: object required: - errors @@ -3412,53 +9267,84 @@ components: example: errors: - type: validation_error - code: token_expired - message: Token has expired. - attribute: refresh_token - url: https://developer.signalwire.com/rest/overview/error-codes#token_expired - SIPEndpoint: + code: missing_required_parameter + message: username is required + attribute: username + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + ResourceSipEndpointResponse: type: object required: - id - - username - - caller_id - - send_as - - ciphers - - codecs - - encryption + - name + - type + - cover_url + - preview_url + - channels properties: id: allOf: - $ref: '#/components/schemas/uuid' - description: Unique ID of the Sip Endpoint. - example: acaa5c49-be5e-4477-bce0-48f4b23b7720 - username: + format: uuid + description: The unique identifier of the SIP endpoint. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: type: string - description: Username of the Sip Endpoint. - example: justice-league - caller_id: + description: The name for the SIP endpoint. + example: sip_user + type: type: string - description: Caller ID of the Sip Endpoint. - example: call-id-123 - send_as: + enum: + - call + description: The Resource type + example: call + cover_url: type: string - description: Purchased or verified number - example: '+14632322867' - ciphers: + format: uri + nullable: true + description: The cover URL for the SIP endpoint. + example: https://example.com/cover.jpg + preview_url: + type: string + format: uri + nullable: true + description: The preview URL for the SIP endpoint. + example: https://example.com/preview.jpg + channels: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: An object containing the resource addresses with the specified comunication channels + ResourceSipEndpointUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: type: array items: - $ref: '#/components/schemas/CipherType' - description: Ciphers of the Sip Endpoint. - codecs: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: 'encryption must be one of: disabled, optional, required' + attribute: encryption + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value + ResourceSubSipEndpointCreateStatusCode422: + type: object + required: + - errors + properties: + errors: type: array items: - $ref: '#/components/schemas/CodecType' - description: Codecs of the Sip Endpoint. - encryption: - allOf: - - $ref: '#/components/schemas/EncryptionType' - description: Encryption requirement of the Sip Endpoint. - example: optional + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: username is required + attribute: username + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter SWAIG: type: object properties: @@ -3577,6 +9463,47 @@ components: - check_time - wait_seconds title: native_functions + SWMLScriptAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects that contain a list of SWML Script Addresses + links: + allOf: + - $ref: '#/components/schemas/SWMLScriptAddressPaginationResponse' + description: Object containing pagination links + SWMLScriptAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_size=50 + first: + type: string + format: uri + description: Link of the first page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50 + next: + type: string + format: uri + description: Link of the next page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=2&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad + prev: + type: string + format: uri + description: Link of the previous page + example: https://example.signalwire.com/api/fabric/resources/swml_script/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad SWMLWebhook: type: object required: @@ -3593,6 +9520,7 @@ components: id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the SWML Webhook. example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 name: @@ -3607,78 +9535,51 @@ components: example: calling primary_request_url: type: string + format: uri description: Primary request url of the SWML Webhook. example: https://primary.com primary_request_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Primary request method of the SWML Webhook. example: GET fallback_request_url: type: string + format: uri + nullable: true description: Fallback request url of the SWML Webhook. example: https://fallback.com fallback_request_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' - description: Fallback request method of the SWML Webhook. - example: GET - status_callback_url: - type: string - description: Status callback url of the SWML Webhook. - example: https://callback.com - status_callback_method: - allOf: - - $ref: '#/components/schemas/UrlMethodType' - description: Status callback method of the SWML Webhook. - example: POST - SWMLWebhookAddress: - type: object - required: - - id - - resource_id - - name - - display_name - - type - - cover_url - - preview_url - - channel - properties: - id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of the Fabric Address. - example: 691af061-cd86-4893-a605-173f47afc4c2 - resource_id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Fabric resource ID that the Fabric Address belongs to. - example: 691af061-cd86-4893-a605-173f47afc4c2 - name: - type: string - description: Name of the Fabric Address. - example: justice-league - display_name: - type: string - description: Display name of the Fabric Address. - example: Justice League - type: - allOf: - - $ref: '#/components/schemas/DisplayTypes' - description: Type of the Fabric Address. - example: app - cover_url: - type: string - description: Cover url of the Fabric Address. - example: https://coverurl.com - preview_url: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Fallback request method of the SWML Webhook. + example: GET + status_callback_url: type: string - description: Preview url of the Fabric Address. - example: https://previewurl.com - channel: - allOf: - - $ref: '#/components/schemas/AddressChannel' - description: Channels of the Fabric Address. + format: uri + nullable: true + description: Status callback url of the SWML Webhook. + example: https://callback.com + status_callback_method: + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST + description: Status callback method of the SWML Webhook. + example: POST SWMLWebhookAddressListResponse: type: object required: @@ -3688,9 +9589,12 @@ components: data: type: array items: - $ref: '#/components/schemas/SWMLWebhookAddress' + $ref: '#/components/schemas/FabricAddressApp' + description: An array of objects that contain a list of SWML Webhook Addresses links: - $ref: '#/components/schemas/SWMLWebhookAddressPaginationResponse' + allOf: + - $ref: '#/components/schemas/SWMLWebhookAddressPaginationResponse' + description: Object containing pagination links SWMLWebhookAddressPaginationResponse: type: object required: @@ -3701,18 +9605,23 @@ components: self: type: string format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link of the current paghe + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=swml_webhook first: type: string format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&type=swml_webhook next: type: string format: uri description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook SWMLWebhookCreateRequest: type: object required: @@ -3731,39 +9640,51 @@ components: default: calling primary_request_url: type: string + format: uri description: Primary request url of the SWML Webhook. example: https://primary.com primary_request_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Primary request method of the SWML Webhook. example: GET default: POST fallback_request_url: type: string + format: uri description: Fallback request url of the SWML Webhook. example: https://fallback.com fallback_request_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Fallback request method of the SWML Webhook. example: GET default: POST status_callback_url: type: string + format: uri description: Status callback url of the SWML Webhook. example: https://callback.com status_callback_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Status callback method of the SWML Webhook. - example: POST + example: GET default: POST SWMLWebhookListResponse: type: object @@ -3775,30 +9696,37 @@ components: type: array items: $ref: '#/components/schemas/SWMLWebhookResponse' + description: An array of objects that contain a list of SWML Webhook data links: - $ref: '#/components/schemas/SWMLWebhookPaginationResponse' + allOf: + - $ref: '#/components/schemas/SWMLWebhookPaginationResponse' + description: Object containing pagination links SWMLWebhookPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&type=swml_webhook first: type: string format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&type=swml_webhook next: type: string format: uri description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/swml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/swml_webhooks?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_webhook SWMLWebhookResponse: type: object required: @@ -3813,11 +9741,13 @@ components: id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the SWML Webhook. example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 project_id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the Project. example: 99151cf8-9548-4860-ba70-a8de824f3312 display_name: @@ -3826,18 +9756,20 @@ components: example: Booking Assistant type: type: string + enum: + - swml_webhook description: Type of the Fabric Resource example: swml_webhook created_at: type: string format: date-time description: Date and time when the resource was created. - example: '2024-10-17T14:14:53Z' + example: '2024-05-06T12:20:00Z' updated_at: type: string format: date-time description: Date and time when the resource was updated. - example: '2024-10-17T14:14:53Z' + example: '2024-05-06T12:20:00Z' swml_webhook: allOf: - $ref: '#/components/schemas/SWMLWebhook' @@ -3858,39 +9790,51 @@ components: default: calling primary_request_url: type: string + format: uri description: Primary request url of the SWML Webhook. example: https://primary.com primary_request_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Primary request method of the SWML Webhook. example: GET default: POST fallback_request_url: type: string + format: uri description: Fallback request url of the SWML Webhook. example: https://fallback.com fallback_request_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Fallback request method of the SWML Webhook. example: GET default: POST status_callback_url: type: string + format: uri description: Status callback url of the SWML Webhook. example: https://callback.com status_callback_method: - type: string - enum: - - GET - - POST + anyOf: + - type: string + enum: + - GET + - type: string + enum: + - POST description: Status callback method of the SWML Webhook. - example: POST + example: GET default: POST SayAction: type: object @@ -3937,31 +9881,365 @@ components: required: - set_meta_data properties: - set_meta_data: - type: object - additionalProperties: {} - description: A JSON object containing any metadata, as a key-value map. This action sets the data in the `meta_data` to be referenced locally in the function. - title: set_meta_data - example: - extra_cheese: Can't do - extra_large_pizza: Only on Friday - title: SetMetaDataAction object - SipEndpointCreateStatusCode422: + set_meta_data: + type: object + additionalProperties: {} + description: A JSON object containing any metadata, as a key-value map. This action sets the data in the `meta_data` to be referenced locally in the function. + title: set_meta_data + example: + extra_cheese: Can't do + extra_large_pizza: Only on Friday + title: SetMetaDataAction object + SipEndpoint: + type: object + required: + - id + - username + - caller_id + - send_as + - ciphers + - codecs + - encryption + - call_handler + - calling_handler_resource_id + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The id of the Sip Endpoint + example: 993ed018-9e79-4e50-b97b-984bd5534095 + username: + type: string + description: The username of the Sip Endpoint + example: User + caller_id: + type: string + description: The caller ID that will showup when dialing from this Sip Endpoint + example: '123456789' + send_as: + type: string + description: The Sip username that will show up on the calle's side. Overrides the username. + example: Support + ciphers: + type: array + items: + $ref: '#/components/schemas/Ciphers' + description: Ciphers that can be enabled for calls on this Sip Endpoint. + example: + - AEAD_AES_256_GCM_8 + - AES_256_CM_HMAC_SHA1_32 + codecs: + type: array + items: + $ref: '#/components/schemas/Codecs' + description: Codecs that can be enabled for calls on this Sip Endpoint. + example: + - G722 + - PCMA + - PCMU + - VP8 + encryption: + allOf: + - $ref: '#/components/schemas/Encryption' + description: The set encryption type on the Sip Endpoint. + example: default + default: default + call_handler: + allOf: + - $ref: '#/components/schemas/CallHandlerType' + description: |- + Specify how the SIP endpoint will handle outbound calls. + These options will control if the call is simply passed to the destination or controlled by a resource. + - **default**: The default behavior for Sip Endpoints. passes the call to the destination with no additional logic. + - **passthrough**: Passes the call to the destination with no additional logic. + - **block-pstn**: Passes the call to the destination while blocking PSTN destination. + - **resource**: Sets a resource to handle the call logic. This allows users ot inject calling logic into the call when calling a destination. + example: default + calling_handler_resource_id: + type: string + allOf: + - $ref: '#/components/schemas/uuid' + nullable: true + description: If `call_handler` is set to `resource`, this field expects the id of the set resouce. Will be `null` otherwise. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + SipEndpointAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressCall' + description: An array of objects that contain a list of SIP Endpoint Addresses + links: + allOf: + - $ref: '#/components/schemas/SipEndpointAddressPaginationResponse' + description: Object containing pagination links + SipEndpointAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=0&page_size=50&type=sip_endpoint + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_size=50&type=sip_endpoint + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints/7ecfd15a-fb9a-45a4-9b89-c0740a44c593/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint + SipEndpointCreateRequest: + type: object + required: + - id + - username + - caller_id + - send_as + - ciphers + - codecs + - encryption + - call_handler + - calling_handler_resource_id + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: The id of the Sip Endpoint + example: 993ed018-9e79-4e50-b97b-984bd5534095 + username: + type: string + description: The username of the Sip Endpoint + example: User + caller_id: + type: string + description: The caller ID that will showup when dialing from this Sip Endpoint + example: '123456789' + send_as: + type: string + description: The Sip username that will show up on the calle's side. Overrides the username. + example: Support + ciphers: + type: array + items: + $ref: '#/components/schemas/Ciphers' + description: Ciphers that can be enabled for calls on this Sip Endpoint. + example: + - AEAD_AES_256_GCM_8 + - AES_256_CM_HMAC_SHA1_32 + codecs: + type: array + items: + $ref: '#/components/schemas/Codecs' + description: Codecs that can be enabled for calls on this Sip Endpoint. + example: + - G722 + - PCMA + - PCMU + - VP8 + encryption: + allOf: + - $ref: '#/components/schemas/Encryption' + description: The set encryption type on the Sip Endpoint. + example: default + default: default + call_handler: + allOf: + - $ref: '#/components/schemas/CallHandlerType' + description: |- + Specify how the SIP endpoint will handle outbound calls. + These options will control if the call is simply passed to the destination or controlled by a resource. + - **default**: The default behavior for Sip Endpoints. passes the call to the destination with no additional logic. + - **passthrough**: Passes the call to the destination with no additional logic. + - **block-pstn**: Passes the call to the destination while blocking PSTN destination. + - **resource**: Sets a resource to handle the call logic. This allows users ot inject calling logic into the call when calling a destination. + example: default + calling_handler_resource_id: + type: string + allOf: + - $ref: '#/components/schemas/uuid' + nullable: true + description: If `call_handler` is set to `resource`, this field expects the id of the set resouce. Will be `null` otherwise. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + SipEndpointCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter + message: Ciphers are invalid + attribute: ciphers + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter + SipEndpointListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/SipEndpointResponse' + description: An array of objects that contain a list of SIP Endpoint data + links: + allOf: + - $ref: '#/components/schemas/SipEndpointPaginationResponse' + description: Object containing pagination links + SipEndpointPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link to the current page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=0&page_size=50&type=sip_endpoint + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_size=50&type=sip_endpoint + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/sip_endpoints?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=sip_endpoint + SipEndpointResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - sip_endpoint + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the SIP Endpoint. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the SIP Endpoint Fabric Resource + example: Conference Room Phone + type: + type: string + enum: + - sip_endpoint + description: Type of the Fabric Resource + example: sip_endpoint + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + sip_endpoint: + allOf: + - $ref: '#/components/schemas/SipEndpoint' + description: SIP Endpoint data. + SipEndpointUpdateRequest: type: object required: - - errors + - calling_handler_resource_id properties: - errors: + username: + type: string + description: The username of the Sip Endpoint + example: User + caller_id: + type: string + description: The caller ID that will showup when dialing from this Sip Endpoint + example: '123456789' + send_as: + type: string + description: The Sip username that will show up on the calle's side. Overrides the username. + example: Support + ciphers: type: array items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: invalid_parameter - message: Ciphers are invalid - attribute: ciphers - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter + $ref: '#/components/schemas/Ciphers' + description: Ciphers that can be enabled for calls on this Sip Endpoint. + example: + - AEAD_AES_256_GCM_8 + - AES_256_CM_HMAC_SHA1_32 + codecs: + type: array + items: + $ref: '#/components/schemas/Codecs' + description: Codecs that can be enabled for calls on this Sip Endpoint. + example: + - G722 + - PCMA + - PCMU + - VP8 + encryption: + allOf: + - $ref: '#/components/schemas/Encryption' + description: The set encryption type on the Sip Endpoint. + example: default + default: default + call_handler: + allOf: + - $ref: '#/components/schemas/CallHandlerType' + description: |- + Specify how the SIP endpoint will handle outbound calls. + These options will control if the call is simply passed to the destination or controlled by a resource. + - **default**: The default behavior for Sip Endpoints. passes the call to the destination with no additional logic. + - **passthrough**: Passes the call to the destination with no additional logic. + - **block-pstn**: Passes the call to the destination while blocking PSTN destination. + - **resource**: Sets a resource to handle the call logic. This allows users ot inject calling logic into the call when calling a destination. + example: default + calling_handler_resource_id: + type: string + allOf: + - $ref: '#/components/schemas/uuid' + nullable: true + description: If `call_handler` is set to `resource`, this field will contain the id of the set resouce. Will be `null` otherwise. + example: 993ed018-9e79-4e50-b97b-984bd5534095 SipEndpointUpdateStatusCode422: type: object required: @@ -3990,6 +10268,7 @@ components: properties: id: type: string + format: uuid description: Unique ID of the SIP Gateway. example: cce59cad-104d-4c28-ada4-98cfd102ae09 uri: @@ -4003,74 +10282,80 @@ components: ciphers: type: array items: - type: string + $ref: '#/components/schemas/Ciphers' description: List of supported SIP ciphers. example: - AEAD_AES_256_GCM_8 - - AES_256_CM_HMAC_SHA1_80 codecs: type: array items: - type: string + $ref: '#/components/schemas/Codecs' description: List of supported codecs. example: - OPUS encryption: - type: string - enum: - - optional - - required - - disabled + allOf: + - $ref: '#/components/schemas/Encryption' description: Specifies the encryption requirement. example: required - SipGatewayAddress: + SipGatewayAddressListResponse: type: object required: - - id - - resource_id - - name - - display_name - - type - - cover_url - - preview_url - - channel + - data + - links properties: - id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of the Fabric Address. - example: 691af061-cd86-4893-a605-173f47afc4c2 - resource_id: + data: + type: array + items: + $ref: '#/components/schemas/FabricAddressCall' + description: An array of objects containing a list of SIP Gateway Addresses + links: allOf: - - $ref: '#/components/schemas/uuid' - description: Fabric resource ID that the Fabric Address belongs to. - example: 691af061-cd86-4893-a605-173f47afc4c2 - name: + - $ref: '#/components/schemas/SipGatewayAddressPaginationResponse' + description: Object containing pagination links + SipGatewayAddressPaginationResponse: + type: object + required: + - self + - first + properties: + self: type: string - description: Name of the Fabric Address. - example: justice-league - display_name: + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + first: type: string - description: Display name of the Fabric Address. - example: Justice League - type: - allOf: - - $ref: '#/components/schemas/DisplayTypes' - description: Type of the Fabric Address. - example: app - cover_url: + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + next: type: string - description: Cover url of the Fabric Address. - example: https://coverurl.com - preview_url: + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: type: string - description: Preview url of the Fabric Address. - example: https://previewurl.com - channel: - allOf: - - $ref: '#/components/schemas/AddressChannel' - description: Channels of the Fabric Address. - SipGatewayAddressListResponse: + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + SipGatewayCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name can't be blank + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + SipGatewayListResponse: type: object required: - data @@ -4079,32 +10364,39 @@ components: data: type: array items: - $ref: '#/components/schemas/SipGatewayAddress' + $ref: '#/components/schemas/SipGatewayResponse' + description: An array of objects that contain a list of SIP Gateway data links: - $ref: '#/components/schemas/SipGatewayAddressPaginationResponse' - SipGatewayAddressPaginationResponse: + allOf: + - $ref: '#/components/schemas/SipGatewayPaginationResponse' + description: Pagination links for the response. + SipGatewayPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link to the current page of results + example: https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50 first: type: string format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link to the first page of results + example: https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50 next: type: string format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - SipGatewayCreateRequest: + description: Link to the next page of results + example: https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: Link to the previous page of results + example: https://example.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + SipGatewayRequest: type: object required: - name @@ -4122,17 +10414,14 @@ components: description: External SIP URI. example: user2@domain.com encryption: - type: string - enum: - - optional - - required - - disabled + allOf: + - $ref: '#/components/schemas/Encryption' description: Specifies the encryption requirement for the SIP connection. example: required ciphers: type: array items: - type: string + $ref: '#/components/schemas/Ciphers' description: List of supported SIP ciphers. example: - AEAD_AES_256_GCM_8 @@ -4140,11 +10429,11 @@ components: codecs: type: array items: - type: string + $ref: '#/components/schemas/Codecs' description: List of supported codecs for media transmission. example: - OPUS - SipGatewayCreateRequestUpdate: + SipGatewayRequestUpdate: type: object properties: name: @@ -4156,17 +10445,14 @@ components: description: External SIP URI. example: user2@domain.com encryption: - type: string - enum: - - optional - - required - - disabled + allOf: + - $ref: '#/components/schemas/Encryption' description: Specifies the encryption requirement for the SIP connection. example: required ciphers: type: array items: - type: string + $ref: '#/components/schemas/Ciphers' description: List of supported SIP ciphers. example: - AEAD_AES_256_GCM_8 @@ -4174,11 +10460,11 @@ components: codecs: type: array items: - type: string + $ref: '#/components/schemas/Codecs' description: List of supported codecs for media transmission. example: - OPUS - SipGatewayCreateResponse: + SipGatewayResponse: type: object required: - id @@ -4191,10 +10477,12 @@ components: properties: id: type: string + format: uuid description: Unique ID of the resource. example: 0823a606-0aff-4c90-9eba-f88ba118fe05 project_id: type: string + format: uuid description: Project ID associated with the resource. example: bc949800-7b40-43cf-8438-a85facfcbdd1 display_name: @@ -4211,77 +10499,16 @@ components: type: string format: date-time description: Timestamp when the resource was created. - example: '2025-04-01T19:05:42Z' + example: '2024-05-06T12:20:00Z' updated_at: type: string format: date-time description: Timestamp when the resource was last updated. - example: '2025-04-01T19:05:42Z' + example: '2024-05-06T12:20:00Z' sip_gateway: allOf: - $ref: '#/components/schemas/SipGateway' description: SIP Gateway configuration details. - SipGatewayCreateStatusCode422: - type: object - required: - - errors - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' - example: - errors: - - type: validation_error - code: missing_required_parameter - message: Name can't be blank - attribute: name - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter - SipGatewayListResponse: - type: object - required: - - data - - links - properties: - data: - type: array - items: - $ref: '#/components/schemas/SipGatewayCreateResponse' - description: List of SIP Gateways. - links: - allOf: - - $ref: '#/components/schemas/SipGatewayPaginationResponse' - description: Pagination links for the response. - SipGatewayPaginationResponse: - type: object - required: - - self - - first - - next - properties: - self: - type: string - format: uri - description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50 - first: - type: string - format: uri - description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50 - next: - type: string - format: uri - description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - SipGatewayResponse: - type: object - allOf: - - $ref: '#/components/schemas/SipGatewayCreateResponse' - SipGatewayUpdateResponse: - type: object - allOf: - - $ref: '#/components/schemas/SipGatewayCreateResponse' StopAction: type: object required: @@ -4370,7 +10597,9 @@ components: - company_name properties: id: - type: string + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of the Subscriber. example: d369a402-7b43-4512-8735-9d5e1f387814 email: @@ -4397,103 +10626,44 @@ components: type: string description: Timezone of the Subscriber. example: America/New_York - country: - type: string - description: Country of the Subscriber. - example: United States - region: - type: string - description: Region of the Subscriber. - example: New York - company_name: - type: string - description: Company name of the Subscriber. - example: SignalWire - SubscriberAddress: - type: object - required: - - id - - resource_id - - name - - display_name - - type - - cover_url - - preview_url - - channels - properties: - id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of a Subscriber Address. - example: acaa5c49-be5e-4477-bce0-48f4b23b7720 - resource_id: - allOf: - - $ref: '#/components/schemas/uuid' - description: Unique ID of a Subscriber Address. - example: acaa5c49-be5e-4477-bce0-48f4b23b7720 - name: - type: string - description: Name of the Subscriber Address. - example: reception - display_name: - type: string - description: Display Name of the Subscriber Address. - example: Reception - type: + country: type: string - description: Type of the Subscriber Address. - example: room - cover_url: + description: Country of the Subscriber. + example: United States + region: type: string - format: uri - description: Cover URL of the Subscriber Address. - example: https://example.com/cover.webp - preview_url: + description: Region of the Subscriber. + example: New York + company_name: type: string - format: uri - description: Preview URL of the Subscriber Address. - example: https://example.com/preview.webp - channels: - type: object - properties: - video: - type: string - description: Video Channel of the Subscriber Address. - example: /public/reception?channel=video - audio: - type: string - description: Audio Channel of the Subscriber Address. - example: /public/reception?channel=audio - messaging: - type: string - description: Messaging Channel of the Subscriber Address. - example: /public/reception?channel=messaging - required: - - video - - audio - - messaging + description: Company name of the Subscriber. + example: SignalWire SubscriberAddressPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50 first: type: string format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50 next: type: string format: uri description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/external_swml_handlers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + example: https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: Link of the previous page + example: https://example.signalwire.com/api/fabric/resources/subscribers/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca SubscriberAddressesResponse: type: object required: @@ -4503,9 +10673,12 @@ components: data: type: array items: - $ref: '#/components/schemas/SubscriberAddress' + $ref: '#/components/schemas/FabricAddressSubscriber' + description: An array of objects that contain a list of Subscriber addresses links: - $ref: '#/components/schemas/SubscriberAddressPaginationResponse' + allOf: + - $ref: '#/components/schemas/SubscriberAddressPaginationResponse' + description: Object containing pagination links SubscriberCreateStatusCode422: type: object required: @@ -4544,11 +10717,15 @@ components: - refresh_token properties: token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: Guest Token example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMuc2lnbmFsd2lyZS5jb20iLCJ0eXAiOiJTQVQifQ..8O4EJs349q97jAcd.H4GNrC6gsWdz91ArWF9ce00Cm62iHfsrFRRUUGW3e96j9C3IphiJXvHYHTmD4qMt8czZ8cniF8c53vVAIZF-yBQibejiMxwnqW6KkLct2EJoPUf9g-wQwM0-lGGj9iPx_7yprkQekFK-7svkLcKlo1voZyavxIsWQlXByppmR_ospVx2u8jbAab0ZjKJNEnr1yPF9oNkyMAnkpkS8k8PwKaxUHBc5SGumKlexUjL3ixZDR6UOcbApVXxrB-DmQBs3otOT7hzME7oKvR-6Xy0XJ1pt4Of7MEzNBUK5Z5NMjtFiA8IqwDlNJz3I5gn8hbjSZwSMJHRJGx2DKpNKiu6fcd-3i2VwCpnKHaNUybMJ5gV3cTNfTFJQBSearCLv-7gMx6Gqy9FF_Hm2bGlfnjTQ9BCsCqXBkQ9EQD6yboi2uUhPyLmpzPqlrBc9ik0c3qR5ey5Jym_VnZXaT_S5NxjzIjLzvs33GOKiooGMsBWOm6mzTPcf398xaSErT4dF2wXwtZANou7Dt4BoTKa.DcLVYpma-iItaGhaOStu9A refresh_token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: Refresh Token example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiUmVmcmVzaCIsImNoIjoidGVzdHB1Yy5zaWduYWx3aXJlLmNvbSJ9..sHcQL_V1tZH2JEAh.FNKYe_49CazNthkgSphf-ov8_I2wGLGWKD6t2q7kiG0guBxBjGzpgD8Y-LM-Nu7ePRUg7Z6vBkKAvh3rjtZpkeXoRXobJ1lov9AO72l8tB9K9RLo-TnBxLDbh0BCDGWVBgGq8DOh9kzHz4Tot-_B8pHXY_bqXX5kC4UUszXCO9nhSi1a4rp6QMD_8b0Mm8pHDK9EtW8I-tfM0HPmXuPMuOnlft3hmZo3tiKN2CarWscveQPCGetufHfQJJssdHjjYup8USAX0gJM8dpsV7FpF9fxfpy4ZU7N9MJXgSYJM5cPrxpLLx3Lj291egob14jDkn7kZQpv7jbCtsGyYxC7HAi1FgGr_sw3AeGaf2esGCkaeE11MxL05_kwdiNYBSOaHqaY62kOzu5pIdfTKQekOogCS1fgiyBgisBZeSIEBWWF.neE9KnL5AzS165dXFXUqhQ SubscriberInviteTokenCreateRequest: @@ -4559,7 +10736,9 @@ components: address_id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: Unique ID of a Subscriber Address + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 expires_at: type: integer description: A unixtime (the number of seconds since 1970-01-01 00:00:00) at which the token should no longer be valid. Defaults to 'two hours from now' @@ -4570,7 +10749,9 @@ components: - token properties: token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: Invite Token example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMuc2lnbmFsd2lyZS5jb20iLCJ0eXAiOiJTQVQifQ..8O4EJs349q97jAcd.H4GNrC6gsWdz91ArWF9ce00Cm62iHfsrFRRUUGW3e96j9C3IphiJXvHYHTmD4qMt8czZ8cniF8c53vVAIZF-yBQibejiMxwnqW6KkLct2EJoPUf9g-wQwM0-lGGj9iPx_7yprkQekFK-7svkLcKlo1voZyavxIsWQlXByppmR_ospVx2u8jbAab0ZjKJNEnr1yPF9oNkyMAnkpkS8k8PwKaxUHBc5SGumKlexUjL3ixZDR6UOcbApVXxrB-DmQBs3otOT7hzME7oKvR-6Xy0XJ1pt4Of7MEzNBUK5Z5NMjtFiA8IqwDlNJz3I5gn8hbjSZwSMJHRJGx2DKpNKiu6fcd-3i2VwCpnKHaNUybMJ5gV3cTNfTFJQBSearCLv-7gMx6Gqy9FF_Hm2bGlfnjTQ9BCsCqXBkQ9EQD6yboi2uUhPyLmpzPqlrBc9ik0c3qR5ey5Jym_VnZXaT_S5NxjzIjLzvs33GOKiooGMsBWOm6mzTPcf398xaSErT4dF2wXwtZANou7Dt4BoTKa.DcLVYpma-iItaGhaOStu9A SubscriberListResponse: @@ -4583,37 +10764,46 @@ components: type: array items: $ref: '#/components/schemas/SubscriberResponse' + description: An array of objects that contain a list of Subscriber data links: - $ref: '#/components/schemas/SubscriberPaginationResponse' + allOf: + - $ref: '#/components/schemas/SubscriberPaginationResponse' + description: Object containing pagination links SubscriberPaginationResponse: type: object required: - self - first - - next properties: self: type: string format: uri description: Link of the current page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50 first: type: string format: uri description: Link to the first page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50 + example: https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50 next: type: string format: uri description: Link to the next page - example: https://{space_name}.signalwire.com/api/fabric/resources/subscribers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + example: https://example.signalwire.com/api/fabric/resources/subscribers?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/subscribers?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca SubscriberRefreshTokenRequest: type: object required: - refresh_token properties: refresh_token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: The refresh token previously issued alongside a subscriber access token. This token is used to request a new access token. example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... SubscriberRefreshTokenResponse: @@ -4623,11 +10813,15 @@ components: - refresh_token properties: token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: A newly generated subscriber access token, valid for 2 hours. example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... refresh_token: - type: string + allOf: + - $ref: '#/components/schemas/jwt' + format: jwt description: A new refresh token, valid for 2 hours and 5 minutes. example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... SubscriberRequest: @@ -4705,20 +10899,64 @@ components: enum: - subscriber description: Type of the resource. + example: subscriber created_at: type: string format: date-time description: Date and time when the resource was created. - example: '2024-10-17T14:14:53Z' + example: '2024-05-06T12:20:00Z' updated_at: type: string format: date-time description: Date and time when the resource was updated. - example: '2024-10-17T14:14:53Z' + example: '2024-05-06T12:20:00Z' subscriber: allOf: - $ref: '#/components/schemas/Subscriber' description: Subscriber data. + SubscriberSIPEndpoint: + type: object + required: + - id + - username + - caller_id + - send_as + - ciphers + - codecs + - encryption + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + description: Unique ID of the Sip Endpoint. + example: acaa5c49-be5e-4477-bce0-48f4b23b7720 + username: + type: string + description: Username of the Sip Endpoint. + example: justice-league + caller_id: + type: string + description: Caller ID of the Sip Endpoint. + example: call-id-123 + send_as: + type: string + description: Purchased or verified number + example: '+14632322867' + ciphers: + type: array + items: + $ref: '#/components/schemas/Ciphers' + description: Ciphers of the Sip Endpoint. + codecs: + type: array + items: + $ref: '#/components/schemas/Codecs' + description: Codecs of the Sip Endpoint. + encryption: + allOf: + - $ref: '#/components/schemas/Encryption' + description: Encryption requirement of the Sip Endpoint. + example: optional SubscriberSipEndpointListResponse: type: object required: @@ -4728,9 +10966,35 @@ components: data: type: array items: - $ref: '#/components/schemas/SIPEndpoint' + $ref: '#/components/schemas/SubscriberSIPEndpoint' links: - $ref: '#/components/schemas/PaginationResponse' + $ref: '#/components/schemas/SubscriberSipEndpointPaginationResponse' + SubscriberSipEndpointPaginationResponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link of the current page + example: https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50 + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=0&page_size=50 + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + prev: + type: string + format: uri + description: The link to the previous page + example: https://example.signalwire.com/api/fabric/resources/subscribers/d369a402-7b43-4512-8735-9d5e1f387814/sip_endpoints?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca SubscriberSipEndpointRequest: type: object required: @@ -4756,16 +11020,16 @@ components: ciphers: type: array items: - $ref: '#/components/schemas/CipherType' + $ref: '#/components/schemas/Ciphers' description: Ciphers of the Sip Endpoint. codecs: type: array items: - $ref: '#/components/schemas/CodecType' + $ref: '#/components/schemas/Codecs' description: Codecs of the Sip Endpoint. encryption: allOf: - - $ref: '#/components/schemas/EncryptionType' + - $ref: '#/components/schemas/Encryption' description: Encryption requirement of the Sip Endpoint. example: optional default: default @@ -4791,16 +11055,16 @@ components: ciphers: type: array items: - $ref: '#/components/schemas/CipherType' + $ref: '#/components/schemas/Ciphers' description: Ciphers of the Sip Endpoint. codecs: type: array items: - $ref: '#/components/schemas/CodecType' + $ref: '#/components/schemas/Codecs' description: Codecs of the Sip Endpoint. encryption: allOf: - - $ref: '#/components/schemas/EncryptionType' + - $ref: '#/components/schemas/Encryption' description: Encryption requirement of the Sip Endpoint. example: optional default: default @@ -4820,6 +11084,7 @@ components: application_id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: The ID of the application that the token is associated with. example: 123e4567-e89b-12d3-a456-426614174000 password: @@ -4868,16 +11133,19 @@ components: subscriber_id: allOf: - $ref: '#/components/schemas/uuid' + format: uuid description: The ID of the subscriber that the token is associated with. example: 32d94154-9297-418c-9a85-4a69e0c67c30 token: allOf: - - $ref: '#/components/schemas/uuid' + - $ref: '#/components/schemas/jwt' + format: jwt description: The token that is associated with the subscriber. example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiU0FUIn0..HahMYxqt4uI14qSH.daMTBR53lfEfEFiVAhr0pPSRqZhEod_YzavoG9-4ieiRQvl8GtP3FFNx0VLfkJqNcjUNbAaiKrEMnfOtCnQjiq1Kn0Iq90MYdM00QJ7cTaQ88vfbqdE92p-d4oDeg6z_vAsgrFgEobmrlDQndKxCWOD921iYxyLP0vqNaokN3kIM06iAWu_UpnTYEeR1l068xhK2xb6P9wbI2FDKFQoMgCdbjvABF7RRyaEzUoaQ5_Wj53YO6PFYuYcPbqMhdtvSSQiK3Nw6bFer2OfFs6s2RTukRGsocgC5Q7pwQwzYky-YgrPCb-pVAJajVSXUJrayvOi8-TeyCpICW4zTeJa5icZ380cWtafUH4rEB_FOJciJf0BCy48ajbz0NE121uBl2mqA1HE0_mQA53UqVjbrbE9hVOfnN4KpwOfULhIjx54tIekJQgG-aK2AYsLPCDNhuSpHvdwJcTM0Gzy3mS2veyaDV8q2qN5F_F9OThTQzcfy.AXzVNrJc_pGVPsticsVM0w refresh_token: allOf: - - $ref: '#/components/schemas/uuid' + - $ref: '#/components/schemas/jwt' + format: jwt description: Refresh token. example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiUmVmcmVzaCIsImNoIjoidGVzdHB1Yy5zaWduYWx3aXJlLmNvbSJ9..sHcQL_V1tZH2JEAh.FNKYe_49CazNthkgSphf-ov8_I2wGLGWKD6t2q7kiG0guBxBjGzpgD8Y-LM-Nu7ePRUg7Z6vBkKAvh3rjtZpkeXoRXobJ1lov9AO72l8tB9K9RLo-TnBxLDbh0BCDGWVBgGq8DOh9kzHz4Tot-_B8pHXY_bqXX5kC4UUszXCO9nhSi1a4rp6QMD_8b0Mm8pHDK9EtW8I-tfM0HPmXuPMuOnlft3hmZo3tiKN2CarWscveQPCGetufHfQJJssdHjjYup8USAX0gJM8dpsV7FpF9fxfpy4ZU7N9MJXgSYJM5cPrxpLLx3Lj291egob14jDkn7kZQpv7jbCtsGyYxC7HAi1FgGr_sw3AeGaf2esGCkaeE11MxL05_kwdiNYBSOaHqaY62kOzu5pIdfTKQekOogCS1fgiyBgisBZeSIEBWWF.neE9KnL5AzS165dXFXUqhQ SubscriberTokenStatusCode422: @@ -4912,6 +11180,199 @@ components: message: Required parameter is missing attribute: password url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter + SwmlScript: + type: object + required: + - id + - contents + - request_url + - display_name + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of a SWML Script. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + contents: + type: string + description: The SWML script contents + example: '{ "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}};' + request_url: + type: string + format: uri + description: The url where the SWML script is hosted at. + example: https://example.com/swml_script + display_name: + type: string + description: The displayed name of the SWML scipt + example: Booking Assistant + status_callback_url: + type: string + format: uri + description: URL to send status callbacks to + example: https://website.com/status + status_callback_method: + type: string + enum: + - POST + description: HTTP method to use for status callbacks + example: POST + SwmlScriptCreateRequest: + type: object + required: + - name + - contents + properties: + name: + type: string + description: Display name of the SWML Script + example: Welcome Script + contents: + type: string + description: The contents of the SWML script. + example: '{ "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}};' + status_callback_url: + type: string + format: uri + description: URL to send status callbacks to + example: https://example.com/status + SwmlScriptCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: contents is required + attribute: contents + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + SwmlScriptListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/SwmlScriptResponse' + description: An array of objects that contain a list of SWML Script data + links: + allOf: + - $ref: '#/components/schemas/SwmlScriptPaginationresponse' + description: Object containing pagination links + SwmlScriptPaginationresponse: + type: object + required: + - self + - first + properties: + self: + type: string + format: uri + description: Link to the current page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50&type=swml_script + first: + type: string + format: uri + description: Link to the first page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts?page_size=50&type=swml_script + next: + type: string + format: uri + description: Link to the next page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_script + prev: + type: string + format: uri + description: Link to the previous page + example: https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca&type=swml_script + SwmlScriptResponse: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - swml_script + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the SWML Script. + example: 993ed018-9e79-4e50-b97b-984bd5534095 + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + format: uuid + description: Unique ID of the Project. + example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 + display_name: + type: string + description: Display name of the SWML Script Fabric Resource + example: Welcome Script + type: + type: string + enum: + - swml_script + description: Type of the Fabric Resource + example: swml_script + created_at: + type: string + format: date-time + description: Date and time when the resource was created. + example: '2024-05-06T12:20:00Z' + updated_at: + type: string + format: date-time + description: Date and time when the resource was updated. + example: '2024-05-06T12:20:00Z' + swml_script: + allOf: + - $ref: '#/components/schemas/SwmlScript' + description: SWML Script data. + SwmlScriptUpdateRequest: + type: object + properties: + display_name: + type: string + description: Display name of the SWML Script + example: Welcome Script + contents: + type: string + description: The contents of the SWML script. + example: '{ "version": "1.0.0", "sections": { "main": [{ "play": { "url": "https://cdn.signalwire.com/swml/audio.mp3" }}]}};' + status_callback_url: + type: string + format: uri + description: URL to send status callbacks to + example: https://example.com/status + SwmlScriptUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: invalid_parameter_value + message: contents must be valid SWML JSON + attribute: contents + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#invalid_parameter_value SwmlWebhookCreateStatusCode422: type: object required: @@ -4971,6 +11432,42 @@ components: description: Whether to toggle the functions on or off. title: toggle_functions title: ToggleFunctionsAction object + Types.StatusCodes.StatusCode401: + type: object + required: + - error + properties: + error: + type: string + enum: + - Unauthorized + Types.StatusCodes.StatusCode403: + type: object + required: + - error + properties: + error: + type: string + enum: + - Forbidden + Types.StatusCodes.StatusCode404: + type: object + required: + - error + properties: + error: + type: string + enum: + - Not Found + Types.StatusCodes.StatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' Types.StatusCodes.StatusCode422Error: type: object required: @@ -4995,6 +11492,15 @@ components: url: type: string description: Link to developer resource for this error. + Types.StatusCodes.StatusCode500: + type: object + required: + - error + properties: + error: + type: string + enum: + - Internal Server Error UnsetGlobalDataAction: type: object required: @@ -5021,12 +11527,6 @@ components: title: unset_meta_data example: extra_cheese title: UnsetMetaDataAction object - UrlMethodType: - type: string - enum: - - GET - - POST - description: The method type to use for the URL UsedForType: type: string enum: @@ -5155,6 +11655,9 @@ components: description: An array of objects that define external API calls. title: webhooks title: Webhook object + jwt: + type: string + format: jwt uuid: type: string format: uuid diff --git a/specs/signalwire-rest/logs-api/conferences/main.tsp b/specs/signalwire-rest/logs-api/conferences/main.tsp index a6a0466e..c6fc8d4b 100644 --- a/specs/signalwire-rest/logs-api/conferences/main.tsp +++ b/specs/signalwire-rest/logs-api/conferences/main.tsp @@ -15,9 +15,6 @@ namespace LogsAPI.Conferences { interface Conferences { @summary("List Conferences") @doc("A list of Conferences.") - list(): - ConferencesResponse | - StatusCode401 | - StatusCode404; + list(): ConferencesResponse | StatusCode401 | StatusCode404; } } diff --git a/specs/signalwire-rest/logs-api/conferences/models/core.tsp b/specs/signalwire-rest/logs-api/conferences/models/core.tsp index af1cbdaf..5306c03d 100644 --- a/specs/signalwire-rest/logs-api/conferences/models/core.tsp +++ b/specs/signalwire-rest/logs-api/conferences/models/core.tsp @@ -1,5 +1,4 @@ @doc("Core conference object.") - model Conference { @doc("Unique identifier for the conference.") @example("b9028451-b1d3-4690-b5d3-37b19d25f573") @@ -49,7 +48,6 @@ model CxmlConference is BaseConference { @summary("Relay Conference") model RelayConference is BaseConference { - @doc("Type of the conference.") @example("relay_conference") type: "relay_conference"; diff --git a/specs/signalwire-rest/logs-api/main.tsp b/specs/signalwire-rest/logs-api/main.tsp index 35875c4f..cb871219 100644 --- a/specs/signalwire-rest/logs-api/main.tsp +++ b/specs/signalwire-rest/logs-api/main.tsp @@ -5,12 +5,14 @@ import "./conferences"; using TypeSpec.Http; using Types.StatusCodes; -@service(#{ - title: "Logs API", -}) -@server("https://{space_name}.signalwire.com/api/logs/", "Endpoint", { - space_name: string = "{Your_Space_Name}"; -}) +@service(#{ title: "Logs API" }) +@server( + "https://{space_name}.signalwire.com/api/logs/", + "Endpoint", + { + space_name: string = "{Your_Space_Name}", + } +) @useAuth(BasicAuth) @doc("API to manage and query log data for SignalWire.") namespace LogsAPI; diff --git a/specs/signalwire-rest/logs-api/tsp-output/@typespec/openapi3/openapi.yaml b/specs/signalwire-rest/logs-api/tsp-output/@typespec/openapi3/openapi.yaml index b5f22ce7..4de5af3f 100644 --- a/specs/signalwire-rest/logs-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/specs/signalwire-rest/logs-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -22,19 +22,15 @@ paths: '401': description: Access is unauthorized. content: - text/plain: + application/json: schema: - type: string - enum: - - Unauthorized + $ref: '#/components/schemas/Types.StatusCodes.StatusCode401' '404': description: The server cannot find the requested resource. content: - text/plain: + application/json: schema: - type: string - enum: - - Not Found + $ref: '#/components/schemas/Types.StatusCodes.StatusCode404' tags: - Conferences security: @@ -206,6 +202,24 @@ components: example: 12345 description: Core conference object. title: Relay Conference + Types.StatusCodes.StatusCode401: + type: object + required: + - error + properties: + error: + type: string + enum: + - Unauthorized + Types.StatusCodes.StatusCode404: + type: object + required: + - error + properties: + error: + type: string + enum: + - Not Found VideoRoomSessionConference: type: object required: diff --git a/specs/signalwire-rest/types/main.tsp b/specs/signalwire-rest/types/main.tsp index 2d3b81bc..fcadd787 100644 --- a/specs/signalwire-rest/types/main.tsp +++ b/specs/signalwire-rest/types/main.tsp @@ -2,4 +2,4 @@ import "./status-codes"; import "./scalar-types"; import "./composite-types"; -namespace Types; \ No newline at end of file +namespace Types; diff --git a/specs/signalwire-rest/types/scalar-types/main.tsp b/specs/signalwire-rest/types/scalar-types/main.tsp index d733a77f..3937eca8 100644 --- a/specs/signalwire-rest/types/scalar-types/main.tsp +++ b/specs/signalwire-rest/types/scalar-types/main.tsp @@ -5,3 +5,6 @@ using TypeSpec.Http; @format("uuid") @doc("Universal Unique Identifier.") scalar uuid extends string; + +@format("jwt") +scalar jwt extends string; diff --git a/specs/signalwire-rest/types/status-codes/main.tsp b/specs/signalwire-rest/types/status-codes/main.tsp index b7f35308..1c0ccb6d 100644 --- a/specs/signalwire-rest/types/status-codes/main.tsp +++ b/specs/signalwire-rest/types/status-codes/main.tsp @@ -2,49 +2,51 @@ import "@typespec/http"; using TypeSpec.Http; - namespace Types.StatusCodes { @error model StatusCode404 { - @statusCode statusCode: 404; - @bodyRoot error: "Not Found" - } + @statusCode statusCode: 404; + error: "Not Found"; + } @error model StatusCode401 { @statusCode statusCode: 401; - @bodyRoot error: "Unauthorized" + error: "Unauthorized"; } model StatusCode422Error { + @doc("Error type.") + type: string; - @doc("Error type.") - type: string; - - @doc("Error code.") - code: string; + @doc("Error code.") + code: string; - @doc("Error details.") - message: string; + @doc("Error details.") + message: string; - @doc("Request parameter associated with this error.") - attribute: string; + @doc("Request parameter associated with this error.") + attribute: string; - @doc("Link to developer resource for this error.") - url: string; - } - - @error - model StatusCode422 { - @statusCode statusCode?: 422; + @doc("Link to developer resource for this error.") + url: string; + } - errors: StatusCode422Error[] - } + @error + model StatusCode422 { + @statusCode statusCode?: 422; + errors: StatusCode422Error[]; } @error model StatusCode403 { - @statusCode statusCode: 401; - @bodyRoot error: "Forbidden" + @statusCode statusCode: 403; + error: "Forbidden"; } + @error + model StatusCode500 { + @statusCode statusCode: 500; + error: "Internal Server Error"; + } +} diff --git a/website/config/pluginsConfig/docusaurus-plugin-openapi-docs.ts b/website/config/pluginsConfig/docusaurus-plugin-openapi-docs.ts index 0857e626..a9c11cf5 100644 --- a/website/config/pluginsConfig/docusaurus-plugin-openapi-docs.ts +++ b/website/config/pluginsConfig/docusaurus-plugin-openapi-docs.ts @@ -47,7 +47,7 @@ export const openapiPlugin: PluginConfig = [ }, }, signalwireFabricApi: { - specPath: "../specs/signalwire-rest/fabric-api/_spec_.yaml", + specPath: "../specs/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml", outputDir: "docs/main/rest/signalwire-rest/endpoints/fabric", sidebarOptions: { categoryLinkSource: "tag", diff --git a/website/provisioning/nginx/redirects.map b/website/provisioning/nginx/redirects.map index ea736f09..0995c1cf 100644 --- a/website/provisioning/nginx/redirects.map +++ b/website/provisioning/nginx/redirects.map @@ -1505,3 +1505,138 @@ /rest/signalwire-rest/endpoints/fabric/delete-swml-application /rest/signalwire-rest/endpoints/fabric/swml-webhooks-delete; /rest/signalwire-rest/endpoints/fabric/delete-swml-application/ /rest/signalwire-rest/endpoints/fabric/swml-webhooks-delete; +# Fabric API to TypeSpec - 7/17/2025 +/rest/signalwire-rest/endpoints/fabric/list-ai-agent-addresses /rest/signalwire-rest/endpoints/fabric/ai-agent-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-ai-agent-addresses/ /rest/signalwire-rest/endpoints/fabric/ai-agent-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-ai-agents /rest/signalwire-rest/endpoints/fabric/ai-agents-list; +/rest/signalwire-rest/endpoints/fabric/list-ai-agents/ /rest/signalwire-rest/endpoints/fabric/ai-agents-list; +/rest/signalwire-rest/endpoints/fabric/create-ai-agent /rest/signalwire-rest/endpoints/fabric/ai-agents-create; +/rest/signalwire-rest/endpoints/fabric/create-ai-agent/ /rest/signalwire-rest/endpoints/fabric/ai-agents-create; +/rest/signalwire-rest/endpoints/fabric/get-ai-agent /rest/signalwire-rest/endpoints/fabric/ai-agents-read; +/rest/signalwire-rest/endpoints/fabric/get-ai-agent/ /rest/signalwire-rest/endpoints/fabric/ai-agents-read; +/rest/signalwire-rest/endpoints/fabric/update-ai-agent /rest/signalwire-rest/endpoints/fabric/ai-agents-update; +/rest/signalwire-rest/endpoints/fabric/update-ai-agent/ /rest/signalwire-rest/endpoints/fabric/ai-agents-update; +/rest/signalwire-rest/endpoints/fabric/delete-ai-agent /rest/signalwire-rest/endpoints/fabric/ai-agents-delete; +/rest/signalwire-rest/endpoints/fabric/delete-ai-agent/ /rest/signalwire-rest/endpoints/fabric/ai-agents-delete; +/rest/signalwire-rest/endpoints/fabric/list-dialogflow-agent-addresses /rest/signalwire-rest/endpoints/fabric/dialogflow-agent-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-dialogflow-agent-addresses/ /rest/signalwire-rest/endpoints/fabric/dialogflow-agent-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-dialogflow-agents /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-list; +/rest/signalwire-rest/endpoints/fabric/list-dialogflow-agents/ /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-list; +/rest/signalwire-rest/endpoints/fabric/get-dialogflow-agent /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-read; +/rest/signalwire-rest/endpoints/fabric/get-dialogflow-agent/ /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-read; +/rest/signalwire-rest/endpoints/fabric/update-dialogflow-agent /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-update; +/rest/signalwire-rest/endpoints/fabric/update-dialogflow-agent/ /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-update; +/rest/signalwire-rest/endpoints/fabric/delete-dialogflow-agent /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-delete; +/rest/signalwire-rest/endpoints/fabric/delete-dialogflow-agent/ /rest/signalwire-rest/endpoints/fabric/dialogflow-agents-delete; +/rest/signalwire-rest/endpoints/fabric/list-call-flow-addresses /rest/signalwire-rest/endpoints/fabric/call-flow-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-call-flow-addresses/ /rest/signalwire-rest/endpoints/fabric/call-flow-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-call-flow-versions /rest/signalwire-rest/endpoints/fabric/call-flow-versions-list; +/rest/signalwire-rest/endpoints/fabric/list-call-flow-versions/ /rest/signalwire-rest/endpoints/fabric/call-flow-versions-list; +/rest/signalwire-rest/endpoints/fabric/deploy-call-flow-version /rest/signalwire-rest/endpoints/fabric/call-flow-versions-deploy; +/rest/signalwire-rest/endpoints/fabric/deploy-call-flow-version/ /rest/signalwire-rest/endpoints/fabric/call-flow-versions-deploy; +/rest/signalwire-rest/endpoints/fabric/list-call-flows /rest/signalwire-rest/endpoints/fabric/call-flows-list; +/rest/signalwire-rest/endpoints/fabric/list-call-flows/ /rest/signalwire-rest/endpoints/fabric/call-flows-list; +/rest/signalwire-rest/endpoints/fabric/create-call-flow /rest/signalwire-rest/endpoints/fabric/call-flows-create; +/rest/signalwire-rest/endpoints/fabric/create-call-flow/ /rest/signalwire-rest/endpoints/fabric/call-flows-create; +/rest/signalwire-rest/endpoints/fabric/get-call-flow /rest/signalwire-rest/endpoints/fabric/call-flows-read; +/rest/signalwire-rest/endpoints/fabric/get-call-flow/ /rest/signalwire-rest/endpoints/fabric/call-flows-read; +/rest/signalwire-rest/endpoints/fabric/update-call-flow /rest/signalwire-rest/endpoints/fabric/call-flows-update; +/rest/signalwire-rest/endpoints/fabric/update-call-flow/ /rest/signalwire-rest/endpoints/fabric/call-flows-update; +/rest/signalwire-rest/endpoints/fabric/delete-call-flow /rest/signalwire-rest/endpoints/fabric/call-flows-delete; +/rest/signalwire-rest/endpoints/fabric/delete-call-flow/ /rest/signalwire-rest/endpoints/fabric/call-flows-delete; +/rest/signalwire-rest/endpoints/fabric/embeds-tokens-create /rest/signalwire-rest/endpoints/fabric/embeds-tokens-create; +/rest/signalwire-rest/endpoints/fabric/embeds-tokens-create/ /rest/signalwire-rest/endpoints/fabric/embeds-tokens-create; +/rest/signalwire-rest/endpoints/fabric/list-freeswitch-connector-addresses /rest/signalwire-rest/endpoints/fabric/freeswitch-connector-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-freeswitch-connector-addresses/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connector-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-freeswitch-connectors /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-list; +/rest/signalwire-rest/endpoints/fabric/list-freeswitch-connectors/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-list; +/rest/signalwire-rest/endpoints/fabric/create-freeswitch-connector /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-create; +/rest/signalwire-rest/endpoints/fabric/create-freeswitch-connector/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-create; +/rest/signalwire-rest/endpoints/fabric/get-freeswitch-connector /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-read; +/rest/signalwire-rest/endpoints/fabric/get-freeswitch-connector/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-read; +/rest/signalwire-rest/endpoints/fabric/update-freeswitch-connector /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-update; +/rest/signalwire-rest/endpoints/fabric/update-freeswitch-connector/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-update; +/rest/signalwire-rest/endpoints/fabric/delete-freeswitch-connector /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-delete; +/rest/signalwire-rest/endpoints/fabric/delete-freeswitch-connector/ /rest/signalwire-rest/endpoints/fabric/freeswitch-connectors-delete; +/rest/signalwire-rest/endpoints/fabric/list-laml-application-addresses /rest/signalwire-rest/endpoints/fabric/cxml-application-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-laml-application-addresses/ /rest/signalwire-rest/endpoints/fabric/cxml-application-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-laml-applications /rest/signalwire-rest/endpoints/fabric/cxml-applications-list; +/rest/signalwire-rest/endpoints/fabric/list-laml-applications/ /rest/signalwire-rest/endpoints/fabric/cxml-applications-list; +/rest/signalwire-rest/endpoints/fabric/get-laml-application /rest/signalwire-rest/endpoints/fabric/cxml-applications-read; +/rest/signalwire-rest/endpoints/fabric/get-laml-application/ /rest/signalwire-rest/endpoints/fabric/cxml-applications-read; +/rest/signalwire-rest/endpoints/fabric/update-laml-application /rest/signalwire-rest/endpoints/fabric/cxml-applications-update; +/rest/signalwire-rest/endpoints/fabric/update-laml-application/ /rest/signalwire-rest/endpoints/fabric/cxml-applications-update; +/rest/signalwire-rest/endpoints/fabric/delete-laml-application /rest/signalwire-rest/endpoints/fabric/cxml-applications-delete; +/rest/signalwire-rest/endpoints/fabric/delete-laml-application /rest/signalwire-rest/endpoints/fabric/cxml-applications-delete; +/rest/signalwire-rest/endpoints/fabric/list-cxml-script-addresses /rest/signalwire-rest/endpoints/fabric/cxml-script-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-cxml-script-addresses/ /rest/signalwire-rest/endpoints/fabric/cxml-script-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-cxml-scripts /rest/signalwire-rest/endpoints/fabric/cxml-scripts-list; +/rest/signalwire-rest/endpoints/fabric/list-cxml-scripts/ /rest/signalwire-rest/endpoints/fabric/cxml-scripts-list; +/rest/signalwire-rest/endpoints/fabric/get-cxml-script /rest/signalwire-rest/endpoints/fabric/cxml-scripts-read; +/rest/signalwire-rest/endpoints/fabric/get-cxml-script/ /rest/signalwire-rest/endpoints/fabric/cxml-scripts-read; +/rest/signalwire-rest/endpoints/fabric/update-cxml-script /rest/signalwire-rest/endpoints/fabric/cxml-scripts-update; +/rest/signalwire-rest/endpoints/fabric/update-cxml-script/ /rest/signalwire-rest/endpoints/fabric/cxml-scripts-update; +/rest/signalwire-rest/endpoints/fabric/delete-cxml-script /rest/signalwire-rest/endpoints/fabric/cxml-scripts-delete; +/rest/signalwire-rest/endpoints/fabric/delete-cxml-script/ /rest/signalwire-rest/endpoints/fabric/cxml-scripts-delete; +/rest/signalwire-rest/endpoints/fabric/list-relay-application-addresses /rest/signalwire-rest/endpoints/fabric/relay-application-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-relay-application-addresses/ /rest/signalwire-rest/endpoints/fabric/relay-application-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-relay-applications /rest/signalwire-rest/endpoints/fabric/relay-applications-list; +/rest/signalwire-rest/endpoints/fabric/list-relay-applications/ /rest/signalwire-rest/endpoints/fabric/relay-applications-list; +/rest/signalwire-rest/endpoints/fabric/create-relay-application /rest/signalwire-rest/endpoints/fabric/relay-applications-create; +/rest/signalwire-rest/endpoints/fabric/create-relay-application/ /rest/signalwire-rest/endpoints/fabric/relay-applications-create; +/rest/signalwire-rest/endpoints/fabric/get-relay-application /rest/signalwire-rest/endpoints/fabric/relay-applications-read; +/rest/signalwire-rest/endpoints/fabric/get-relay-application/ /rest/signalwire-rest/endpoints/fabric/relay-applications-read; +/rest/signalwire-rest/endpoints/fabric/update-relay-application /rest/signalwire-rest/endpoints/fabric/relay-applications-update; +/rest/signalwire-rest/endpoints/fabric/update-relay-application/ /rest/signalwire-rest/endpoints/fabric/relay-applications-update; +/rest/signalwire-rest/endpoints/fabric/delete-relay-application /rest/signalwire-rest/endpoints/fabric/relay-applications-delete; +/rest/signalwire-rest/endpoints/fabric/delete-relay-application/ /rest/signalwire-rest/endpoints/fabric/relay-applications-delete; +/rest/signalwire-rest/endpoints/fabric/list-resource-addresses /rest/signalwire-rest/endpoints/fabric/resource-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-resource-addresses/ /rest/signalwire-rest/endpoints/fabric/resource-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-resources /rest/signalwire-rest/endpoints/fabric/resources-list; +/rest/signalwire-rest/endpoints/fabric/list-resources/ /rest/signalwire-rest/endpoints/fabric/resources-list; +/rest/signalwire-rest/endpoints/fabric/get-resource /rest/signalwire-rest/endpoints/fabric/resources-read; +/rest/signalwire-rest/endpoints/fabric/get-resource/ /rest/signalwire-rest/endpoints/fabric/resources-read; +/rest/signalwire-rest/endpoints/fabric/delete-resource /rest/signalwire-rest/endpoints/fabric/resources-delete; +/rest/signalwire-rest/endpoints/fabric/delete-resource/ /rest/signalwire-rest/endpoints/fabric/resources-delete; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-phone-route /rest/signalwire-rest/endpoints/fabric/phone-routes-assign; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-phone-route/ /rest/signalwire-rest/endpoints/fabric/phone-routes-assign; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-domain-application /rest/signalwire-rest/endpoints/fabric/domain-applications-assign; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-domain-application/ /rest/signalwire-rest/endpoints/fabric/domain-applications-assign; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-sip-endpoint /rest/signalwire-rest/endpoints/fabric/resource-sip-endpoints-assign; +/rest/signalwire-rest/endpoints/fabric/assign-resource-to-sip-endpoint/ /rest/signalwire-rest/endpoints/fabric/resource-sip-endpoints-assign; +/rest/signalwire-rest/endpoints/fabric/list-sip-endpoint-addresses /rest/signalwire-rest/endpoints/fabric/sip-endpoint-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-sip-endpoint-addresses/ /rest/signalwire-rest/endpoints/fabric/sip-endpoint-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-sip-endpoints /rest/signalwire-rest/endpoints/fabric/sip-endpoints-list; +/rest/signalwire-rest/endpoints/fabric/list-sip-endpoints/ /rest/signalwire-rest/endpoints/fabric/sip-endpoints-list; +/rest/signalwire-rest/endpoints/fabric/create-sip-endpoint /rest/signalwire-rest/endpoints/fabric/sip-endpoints-create; +/rest/signalwire-rest/endpoints/fabric/create-sip-endpoint/ /rest/signalwire-rest/endpoints/fabric/sip-endpoints-create; +/rest/signalwire-rest/endpoints/fabric/get-sip-endpoint /rest/signalwire-rest/endpoints/fabric/sip-endpoints-read; +/rest/signalwire-rest/endpoints/fabric/get-sip-endpoint/ /rest/signalwire-rest/endpoints/fabric/sip-endpoints-read; +/rest/signalwire-rest/endpoints/fabric/update-sip-endpoint /rest/signalwire-rest/endpoints/fabric/sip-endpoints-update; +/rest/signalwire-rest/endpoints/fabric/update-sip-endpoint/ /rest/signalwire-rest/endpoints/fabric/sip-endpoints-update; +/rest/signalwire-rest/endpoints/fabric/delete-sip-endpoint /rest/signalwire-rest/endpoints/fabric/sip-endpoints-delete; +/rest/signalwire-rest/endpoints/fabric/delete-sip-endpoint/ /rest/signalwire-rest/endpoints/fabric/sip-endpoints-delete; +/rest/signalwire-rest/endpoints/fabric/list-swml-script-addresses /rest/signalwire-rest/endpoints/fabric/swml-script-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-swml-script-addresses/ /rest/signalwire-rest/endpoints/fabric/swml-script-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-swml-scripts /rest/signalwire-rest/endpoints/fabric/swml-scripts-list; +/rest/signalwire-rest/endpoints/fabric/list-swml-scripts/ /rest/signalwire-rest/endpoints/fabric/swml-scripts-list; +/rest/signalwire-rest/endpoints/fabric/swml-script-create /rest/signalwire-rest/endpoints/fabric/swml-scripts-create; +/rest/signalwire-rest/endpoints/fabric/swml-script-create/ /rest/signalwire-rest/endpoints/fabric/swml-scripts-create; +/rest/signalwire-rest/endpoints/fabric/get-swml-script /rest/signalwire-rest/endpoints/fabric/swml-scripts-read; +/rest/signalwire-rest/endpoints/fabric/get-swml-script/ /rest/signalwire-rest/endpoints/fabric/swml-scripts-read; +/rest/signalwire-rest/endpoints/fabric/update-swml-script /rest/signalwire-rest/endpoints/fabric/swml-scripts-update; +/rest/signalwire-rest/endpoints/fabric/update-swml-script/ /rest/signalwire-rest/endpoints/fabric/swml-scripts-update; +/rest/signalwire-rest/endpoints/fabric/delete-swml-script /rest/signalwire-rest/endpoints/fabric/swml-scripts-delete; +/rest/signalwire-rest/endpoints/fabric/delete-swml-script/ /rest/signalwire-rest/endpoints/fabric/swml-scripts-delete; +/rest/signalwire-rest/endpoints/fabric/list-conference-room-addresses /rest/signalwire-rest/endpoints/fabric/conference-room-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-conference-room-addresses/ /rest/signalwire-rest/endpoints/fabric/conference-room-addresses-list; +/rest/signalwire-rest/endpoints/fabric/list-conference-rooms /rest/signalwire-rest/endpoints/fabric/conference-rooms-list; +/rest/signalwire-rest/endpoints/fabric/list-conference-rooms/ /rest/signalwire-rest/endpoints/fabric/conference-rooms-list; +/rest/signalwire-rest/endpoints/fabric/create-conference-room /rest/signalwire-rest/endpoints/fabric/conference-rooms-create; +/rest/signalwire-rest/endpoints/fabric/create-conference-room/ /rest/signalwire-rest/endpoints/fabric/conference-rooms-create; +/rest/signalwire-rest/endpoints/fabric/get-conference-room /rest/signalwire-rest/endpoints/fabric/conference-rooms-read; +/rest/signalwire-rest/endpoints/fabric/get-conference-room/ /rest/signalwire-rest/endpoints/fabric/conference-rooms-read; +/rest/signalwire-rest/endpoints/fabric/update-conference-room /rest/signalwire-rest/endpoints/fabric/conference-rooms-update; +/rest/signalwire-rest/endpoints/fabric/update-conference-room/ /rest/signalwire-rest/endpoints/fabric/conference-rooms-update; +/rest/signalwire-rest/endpoints/fabric/delete-conference-room /rest/signalwire-rest/endpoints/fabric/conference-rooms-delete; +/rest/signalwire-rest/endpoints/fabric/delete-conference-room/ /rest/signalwire-rest/endpoints/fabric/conference-rooms-delete; diff --git a/yarn.lock b/yarn.lock index bfa03c38..8201de04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -352,7 +352,7 @@ ajv-draft-04 "^1.0.0" call-me-maybe "^1.0.2" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.27.1", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.27.1", "@babel/code-frame@^7.8.3", "@babel/code-frame@~7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== @@ -361,15 +361,6 @@ js-tokens "^4.0.0" picocolors "^1.1.1" -"@babel/code-frame@~7.26.2": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/compat-data@^7.27.2", "@babel/compat-data@^7.27.7", "@babel/compat-data@^7.28.0": version "7.28.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.0.tgz#9fc6fd58c2a6a15243cd13983224968392070790" @@ -531,7 +522,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== -"@babel/helper-validator-identifier@^7.25.9", "@babel/helper-validator-identifier@^7.27.1": +"@babel/helper-validator-identifier@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== @@ -3979,17 +3970,17 @@ dependencies: "@types/yargs-parser" "*" -"@typespec/asset-emitter@^0.70.0": - version "0.70.1" - resolved "https://registry.yarnpkg.com/@typespec/asset-emitter/-/asset-emitter-0.70.1.tgz#31cdef4e0ee766d6c34a8820a58bc4cbc67d4a1d" - integrity sha512-X8hRA7LLWkNIWqAkWaWoa84PzDMUvjj3qCLQKT29k5twS419nN1GGT7BQaDQnYfPTsSssEFxgRgugr0AAErEsA== +"@typespec/asset-emitter@^0.71.0": + version "0.71.0" + resolved "https://registry.yarnpkg.com/@typespec/asset-emitter/-/asset-emitter-0.71.0.tgz#438f8c9e5acc4c94a2637b6aa0cd72a292ccf21d" + integrity sha512-wXDF2kbEPTJksv16mzcEyaz97PUxz1xH/Bl4OFSnvwE5xC1hkb0uKQ2nsunnu4yFzbz6Jmn7aoxM1WlYR5PzkA== -"@typespec/compiler@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@typespec/compiler/-/compiler-1.0.0.tgz#c3f182a9521a453cd851cc160f9cdb4b527271cb" - integrity sha512-QFy0otaB4xkN4kQmYyT17yu3OVhN0gti9+EKnZqs5JFylw2Xecx22BPwUE1Byj42pZYg5d9WlO+WwmY5ALtRDg== +"@typespec/compiler@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@typespec/compiler/-/compiler-1.1.0.tgz#11a39b171de48f3e09824375a369e9602f321920" + integrity sha512-dtwosIqd2UUEEIVBR+oDiUtN4n1lP8/9GxQVno+wbkijQgKDj4Hg0Vaq6HG4BduF7RptDdtzkdGQCS9CgOIdRA== dependencies: - "@babel/code-frame" "~7.26.2" + "@babel/code-frame" "~7.27.1" "@inquirer/prompts" "^7.4.0" ajv "~8.17.1" change-case "~5.4.4" @@ -4007,30 +3998,30 @@ yaml "~2.7.0" yargs "~17.7.2" -"@typespec/http@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@typespec/http/-/http-1.0.0.tgz#9908f590b99063e26cbfb4283872ea3e21d66c52" - integrity sha512-Uy0UnnGxA+pgvakM5IOhA89GBKTxf1vVylXZuA2aWrIHefki4BswcQxYBObzCq1hA7FYJsxDQVAMOSRrhUsbPg== +"@typespec/http@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@typespec/http/-/http-1.1.0.tgz#9d5b05070b5877d2dba39a956a8ee82e233f89d0" + integrity sha512-1doVGmkv3N8l57fVuci4jGMZ61EZBlDzuNZO2b9o0+mexCOs/P96CIpFkaNVvTQgjpyFsW1DlXiUKAvUC9zQfg== -"@typespec/openapi3@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@typespec/openapi3/-/openapi3-1.0.0.tgz#bef16e559d3389b7cf9dddec69b22df2e4d1dbc3" - integrity sha512-cDsnNtJkQCx0R/+9AqXzqAKH6CgtwmnQGQMQHbkw0/Sxs5uk6hoiexx7vz0DUR7H4492MqPT2kE4351KZbDYMw== +"@typespec/openapi3@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@typespec/openapi3/-/openapi3-1.1.0.tgz#8ea14a3834ac231afecb0968323602e77c2d648b" + integrity sha512-+1Ue7+M/PkNX54H6SJAym5ONHzlW7s5ZnA4fCH5jwKvalvI94stMvefOpd8FAesJDVmXc3wZ0kiqYo5EuMTjOQ== dependencies: "@apidevtools/swagger-parser" "~10.1.1" - "@typespec/asset-emitter" "^0.70.0" + "@typespec/asset-emitter" "^0.71.0" openapi-types "~12.1.3" yaml "~2.7.0" -"@typespec/openapi@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@typespec/openapi/-/openapi-1.0.0.tgz#695e8b6df7ce6e9b7d893827c8db90b6ef7a8ecf" - integrity sha512-pONzKIdK4wHgD1vBfD9opUk66zDG55DlHbueKOldH2p1LVf5FnMiuKE4kW0pl1dokT/HBNR5OJciCzzVf44AgQ== +"@typespec/openapi@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@typespec/openapi/-/openapi-1.1.0.tgz#dba688b61b904ef1ed15719c7088edfb32c99c07" + integrity sha512-HPvrpSS7eSVk3fEkWndcDTrAZssWRYv3FyDTqVqljildc7FAiXdo88+r5CCK8endmgIrES7uJdHLkcIGUZx1pg== -"@typespec/rest@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@typespec/rest/-/rest-0.70.0.tgz#56621dd99d3c206643b8cd810ac97c1080aea4a1" - integrity sha512-pn3roMQV6jBNT4bVA/hnrBAAHleXSyfWQqNO+DhI3+tLU4jCrJHmUZDi82nI9xBl+jkmy2WZFZOelZA9PSABeg== +"@typespec/rest@0.71.0": + version "0.71.0" + resolved "https://registry.yarnpkg.com/@typespec/rest/-/rest-0.71.0.tgz#5f779714e30fd263ab73cf6c54340ceeb906b955" + integrity sha512-5qX+nWO5Jx4P1iTTT2REgdCtHsTMjlv/gL90u8cO1ih3yHDtf18a41UL6jSYaVUIvIj6rlmrgopActf0FhhUcw== "@ungap/structured-clone@^1.0.0": version "1.3.0"