> For the complete documentation index, see [llms.txt](https://support.portsip.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.portsip.com/development-portsip/rest-apis/version-22.9/admin.md).

# Admin

## Get AI Engine configuration

> Get the ai engine configuration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/ai_engine":{"get":{"tags":["Admin"],"operationId":"getAiIntegration","summary":"Get AI Engine configuration","description":"Get the ai engine configuration.\n","parameters":[{"in":"query","name":"id","required":true,"schema":{"type":"string"},"description":"Unique identifier of the AI Engine configuration."}],"responses":{"200":{"description":"Successfully retrieved AI Engine configuration","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"access_key":{"type":"string","minLength":1,"description":"AWS access key ID used to authenticate with AWS services.\n"},"secret_key":{"type":"string","format":"password","minLength":1,"description":"AWS secret access key used to authenticate with AWS services."},"region":{"type":"string","minLength":1,"description":"AWS region where the AI services and related resources are located.\n"},"bucket_name":{"type":"string","minLength":1,"description":"Name of the Amazon S3 bucket used to store AI-related data.\n"},"locale":{"type":"string","minLength":1,"description":"Locale used by the AI service for language and regional processing.\n"},"lang_code":{"type":"string","minLength":1,"description":"Language code used by AI services for language-specific processing.\n"},"max_speech_to_text_queue":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests that can be queued for processing.\n"},"max_sentiment_requests_per_10s":{"type":"integer","minimum":1,"description":"Maximum number of sentiment analysis requests allowed within a 10-second period.\n"}},"description":"AWS configuration for AI service integration.","required":["access_key","secret_key","region","bucket_name","locale","lang_code","max_speech_to_text_queue","max_sentiment_requests_per_10s"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"account_name":{"type":"string","minLength":1,"description":"Name of the Azure storage account used by the AI services.\n"},"account_key":{"type":"string","format":"password","minLength":1,"description":"Access key used to authenticate with the Azure storage account.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with Azure AI services.\n"},"region":{"type":"string","minLength":1,"description":"Azure region where the AI services and related resources are located.\n"},"container_name":{"type":"string","minLength":1,"description":"Name of the Azure Blob Storage container used to store AI-related data.\n"},"locale":{"type":"string","minLength":1,"description":"Locale used by Azure AI services for language and regional processing.\n"},"max_stt_requests_per_10s":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests allowed within a 10-second period.\n"},"max_sentiment_requests_per_minute":{"type":"integer","minimum":1,"description":"Maximum number of sentiment analysis requests allowed within a one-minute period.\n"}},"description":"Schema for Azure AI Engine configuration","required":["account_name","account_key","api_key","region","container_name"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with Deepgram services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription.\n"},"model":{"type":"string","minLength":1,"description":"Deepgram speech-to-text model used for transcription.\n"},"max_speech_to_text_concurrent":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"redaction":{"type":"boolean","default":true,"description":"Whether sensitive information should be redacted from the transcription.\n"},"ssn":{"type":"boolean","default":true,"description":"Whether Social Security numbers should be redacted from the transcription.\n"},"pci":{"type":"boolean","default":true,"description":"Whether payment card information should be redacted from the transcription.\n"},"numbers":{"type":"boolean","default":false,"description":"Whether numbers should be redacted from the transcription.\n"}},"description":"Configuration for integrating Deepgram AI services.","required":["api_key","language","model","max_speech_to_text_concurrent","redaction","ssn","pci","numbers"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"analyze_model":{"type":"string","minLength":1,"description":"OpenAI model used for analyzing transcripts or other AI-generated content.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with OpenAI services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription and AI processing.\n"},"max_speech_to_text_concurrent":{"type":"string","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"transcript_model":{"type":"string","minimum":1,"description":"OpenAI model used for generating speech-to-text transcripts.\n"}},"description":"Configuration for integrating OpenAI AI services.","required":["analyze_model","api_key","language","max_speech_to_text_concurrent","transcript_model"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"base_url":{"type":"string","format":"uri","minLength":1,"description":"OpenAI compatible service base URL.\n"},"analyze_model":{"type":"string","minLength":1,"description":"OpenAI compatible model used for analyzing transcripts or other AI-generated content.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with OpenAI compatible services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription and AI processing.\n"},"max_speech_to_text_concurrent":{"type":"string","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"transcript_model":{"type":"string","minimum":1,"description":"OpenAI model used for generating speech-to-text transcripts.\n"}},"description":"Configuration for integrating OpenAI compatible AI services.","required":["base_url","analyze_model","api_key","language","max_speech_to_text_concurrent","transcript_model"]}}}],"required":["provider","opts"]}],"discriminator":{"propertyName":"provider","mapping":{"aws":"#/components/schemas/aws","azure":"#/components/schemas/azure","deepgram":"#/components/schemas/deepgram","openai":"#/components/schemas/openai","openai_compatible":"#/components/schemas/openai_compatible"}}}}}},"4XX":{"description":"Invalid input or retrieval failed."}}}}}}
```

## Update AI Engine configuration

> Create a new AI Engine configuration if it does not exist,  \
> or update the existing configuration by its ID.  \
> The \`config\` field varies depending on the selected engine type.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/ai_engine":{"post":{"tags":["Admin"],"operationId":"updateAiIntegration","summary":"Update AI Engine configuration","description":"Create a new AI Engine configuration if it does not exist,  \nor update the existing configuration by its ID.  \nThe `config` field varies depending on the selected engine type.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"access_key":{"type":"string","minLength":1,"description":"AWS access key ID used to authenticate with AWS services.\n"},"secret_key":{"type":"string","format":"password","minLength":1,"description":"AWS secret access key used to authenticate with AWS services."},"region":{"type":"string","minLength":1,"description":"AWS region where the AI services and related resources are located.\n"},"bucket_name":{"type":"string","minLength":1,"description":"Name of the Amazon S3 bucket used to store AI-related data.\n"},"locale":{"type":"string","minLength":1,"description":"Locale used by the AI service for language and regional processing.\n"},"lang_code":{"type":"string","minLength":1,"description":"Language code used by AI services for language-specific processing.\n"},"max_speech_to_text_queue":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests that can be queued for processing.\n"},"max_sentiment_requests_per_10s":{"type":"integer","minimum":1,"description":"Maximum number of sentiment analysis requests allowed within a 10-second period.\n"}},"description":"AWS configuration for AI service integration.","required":["access_key","secret_key","region","bucket_name","locale","lang_code","max_speech_to_text_queue","max_sentiment_requests_per_10s"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"account_name":{"type":"string","minLength":1,"description":"Name of the Azure storage account used by the AI services.\n"},"account_key":{"type":"string","format":"password","minLength":1,"description":"Access key used to authenticate with the Azure storage account.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with Azure AI services.\n"},"region":{"type":"string","minLength":1,"description":"Azure region where the AI services and related resources are located.\n"},"container_name":{"type":"string","minLength":1,"description":"Name of the Azure Blob Storage container used to store AI-related data.\n"},"locale":{"type":"string","minLength":1,"description":"Locale used by Azure AI services for language and regional processing.\n"},"max_stt_requests_per_10s":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests allowed within a 10-second period.\n"},"max_sentiment_requests_per_minute":{"type":"integer","minimum":1,"description":"Maximum number of sentiment analysis requests allowed within a one-minute period.\n"}},"description":"Schema for Azure AI Engine configuration","required":["account_name","account_key","api_key","region","container_name"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with Deepgram services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription.\n"},"model":{"type":"string","minLength":1,"description":"Deepgram speech-to-text model used for transcription.\n"},"max_speech_to_text_concurrent":{"type":"integer","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"redaction":{"type":"boolean","default":true,"description":"Whether sensitive information should be redacted from the transcription.\n"},"ssn":{"type":"boolean","default":true,"description":"Whether Social Security numbers should be redacted from the transcription.\n"},"pci":{"type":"boolean","default":true,"description":"Whether payment card information should be redacted from the transcription.\n"},"numbers":{"type":"boolean","default":false,"description":"Whether numbers should be redacted from the transcription.\n"}},"description":"Configuration for integrating Deepgram AI services.","required":["api_key","language","model","max_speech_to_text_concurrent","redaction","ssn","pci","numbers"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"analyze_model":{"type":"string","minLength":1,"description":"OpenAI model used for analyzing transcripts or other AI-generated content.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with OpenAI services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription and AI processing.\n"},"max_speech_to_text_concurrent":{"type":"string","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"transcript_model":{"type":"string","minimum":1,"description":"OpenAI model used for generating speech-to-text transcripts.\n"}},"description":"Configuration for integrating OpenAI AI services.","required":["analyze_model","api_key","language","max_speech_to_text_concurrent","transcript_model"]}}}],"required":["provider","opts"]},{"allOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["aws","azure","deepgram","openai","openai-compatible"],"description":"The AI provider for integration.   \n- `aws`: Use AI integration on AWS.\n- `azure`: Use AI integration on Azure.\n- `deepgram`: Use AI integration on Deepgram.\n- `openai`: Use AI integration on OpenAI.\n- `openai-compatible`: Use AI integration on compatible OpenAI.\n"}}},{"type":"object","properties":{"opts":{"type":"object","properties":{"base_url":{"type":"string","format":"uri","minLength":1,"description":"OpenAI compatible service base URL.\n"},"analyze_model":{"type":"string","minLength":1,"description":"OpenAI compatible model used for analyzing transcripts or other AI-generated content.\n"},"api_key":{"type":"string","format":"password","minLength":1,"description":"API key used to authenticate with OpenAI compatible services.\n"},"language":{"type":"string","minLength":1,"description":"Language used for speech-to-text transcription and AI processing.\n"},"max_speech_to_text_concurrent":{"type":"string","minimum":1,"description":"Maximum number of speech-to-text requests that can be processed concurrently.\n"},"transcript_model":{"type":"string","minimum":1,"description":"OpenAI model used for generating speech-to-text transcripts.\n"}},"description":"Configuration for integrating OpenAI compatible AI services.","required":["base_url","analyze_model","api_key","language","max_speech_to_text_concurrent","transcript_model"]}}}],"required":["provider","opts"]}],"discriminator":{"propertyName":"provider","mapping":{"aws":"#/components/schemas/aws","azure":"#/components/schemas/azure","deepgram":"#/components/schemas/deepgram","openai":"#/components/schemas/openai","openai_compatible":"#/components/schemas/openai_compatible"}}}}}},"responses":{"200":{"description":"AI Engine configuration updated successfully."},"4XX":{"description":"Invalid input or update failed."}}}}}}
```
