> 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/ai-transcription.md).

# AI Transcription

## Create AI Transcription

> Creates an AI transcription record.  \
> The source is identified by the \`res\_id\` and \`item\_type\` provided in the request body.  \
> This endpoint can be called multiple times. If a previous transcription attempt has failed (status indicates failure),  \
> calling this endpoint again will retry the transcription process.  \
> The response may contain multiple IDs because a single call can include multiple recording files.<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":{"/transcription":{"post":{"tags":["AI Transcription"],"operationId":"createTranscription","summary":"Create AI Transcription","description":"Creates an AI transcription record.  \nThe source is identified by the `res_id` and `item_type` provided in the request body.  \nThis endpoint can be called multiple times. If a previous transcription attempt has failed (status indicates failure),  \ncalling this endpoint again will retry the transcription process.  \nThe response may contain multiple IDs because a single call can include multiple recording files.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"res_id":{"type":"string","description":"ID from a `/voicemails` or `/recordings` item used to create the transcription."},"item_type":{"type":"string","description":"Type of the source item. Allowed values are `CALL_RECORD_ITEM` or `VOICE_MAIL_ITEM`.","enum":["CALL_RECORD_ITEM","VOICE_MAIL_ITEM"]}},"required":["res_id","item_type"]}}}},"responses":{"200":{"description":"Successfully created","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"integer"},"description":"List of created transcription IDs."}}}}}},"400":{"description":"Invalid parameters"},"500":{"description":"Internal server error"}}}}}}
```

## Get AI Transcription Details

> Retrieve all AI transcription records associated with a specific resource ID (\`id\`).  \
> The \`id\` comes from the \`id\` field of an item in either the \`/recordings\` or \`/voicemails\` list.  \
> A single resource may have multiple transcription or analysis results, so the response is returned as an array of transcription detail objects.<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":{"/transcription/{id}":{"get":{"tags":["AI Transcription"],"operationId":"getTranscriptions","summary":"Get AI Transcription Details","description":"Retrieve all AI transcription records associated with a specific resource ID (`id`).  \nThe `id` comes from the `id` field of an item in either the `/recordings` or `/voicemails` list.  \nA single resource may have multiple transcription or analysis results, so the response is returned as an array of transcription detail objects.\n","parameters":[{"name":"id","in":"path","required":true,"description":"The resource ID from `/recordings` or `/voicemails` to retrieve transcription records for.","schema":{"type":"string"}}],"responses":{"200":{"description":"Transcription details retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique ID of the transcription record."},"item_id":{"type":"string","description":"The item ID of the original recording."},"file_id":{"type":"string","description":"The file ID associated with the transcription."},"file_url":{"type":"string","readOnly":true,"description":"The relative path to file url for file downloading.\n"},"session_id":{"allOf":[{"type":"string"}],"description":"The session ID of call log.\n"},"type":{"type":"string","description":"Type of the source item. Allowed values are `CALL_RECORD_ITEM` or `VOICE_MAIL_ITEM`.","enum":["CALL_RECORD_ITEM","VOICE_MAIL_ITEM"]},"caller":{"type":"string","maxLength":256,"description":"The caller number of the call.\n"},"callee":{"type":"string","maxLength":256,"description":"The callee number of the call.\n"},"transcription_id":{"type":"string","description":"The unique ID of the transcription."},"analyze_id":{"type":"string","description":"The unique ID of the analysis result."},"status":{"type":"string","description":"AI transcription status.\n- TranscriptionNotStarted\n- TranscriptionQuotaLimited\n- TranscriptionRunning\n- TranscriptionFailed\n- TranscriptionSucceeded\n- AnalyzeRunning\n- AnalyzeFailed\n- AnalyzeSucceeded\n- TranscriptionUploadFailed\n- TranscriptionOtherFailed\n","enum":["TRANSCRIPTION_NOTSTARTED","TRANSCRIPTION_QUOTALIMITED","TRANSCRIPTION_RUNNING","TRANSCRIPTION_FAILED","TRANSCRIPTION_SUCCEEDED","ANALYZE_RUNNING","ANALYZE_FAILED","ANALYZE_SUCCEEDED","TRANSCRIPTION_UPLOAD_FAILED","TRANSCRIPTION_OTHER_FAILED"]},"status_description":{"type":"string","description":"AI transcription status description."},"transcription_display":{"type":"string","description":"Display version of the AI transcription in JSON format."},"intelligent_summary":{"type":"string","description":"AI-generated summary of the transcription."},"sentiment":{"type":"string","enum":["SENTIMENT_POSITIVE","SENTIMENT_NEUTRAL","SENTIMENT_NEGATIVE"],"description":"AI transcription sentiment.\n- `SENTIMENT_POSITIVE`: positive\n- `SENTIMENT_NEUTRAL`: neutral\n- `SENTIMENT_NEGATIVE`: negative\n"},"created_at":{"type":"string","format":"date-time","description":"Time at which the transcription record was created."}}}}}}},"404":{"description":"Transcription not found"}}}}}}
```

## Update AI Transcription

> Update transcription information for a specific transcription record.  \
> The \`id\` parameter refers to the primary key of the transcription.<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":{"/transcription/{id}":{"post":{"tags":["AI Transcription"],"summary":"Update AI Transcription","description":"Update transcription information for a specific transcription record.  \nThe `id` parameter refers to the primary key of the transcription.\n","operationId":"updateTranscription","parameters":[{"name":"id","in":"path","required":true,"description":"The primary key ID of the transcription record to update.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"transcription_display":{"type":"string","description":"Transcription display content (JSON string)."},"intelligent_summary":{"type":"string","description":"Intelligent summary content."},"sentiment":{"type":"string","enum":["SENTIMENT_POSITIVE","SENTIMENT_NEUTRAL","SENTIMENT_NEGATIVE"],"description":"AI transcription sentiment.\n- `SENTIMENT_POSITIVE`: positive\n- `SENTIMENT_NEUTRAL`: neutral\n- `SENTIMENT_NEGATIVE`: negative\n"}}}}}},"responses":{"200":{"description":"Transcription updated successfully"}}}}}}
```
