> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emberqa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Call Recording (Audio File Upload)

> Submit a call recording for scoring and analysis by uploading an audio file with multipart form data.

## Audio Requirements

Before submitting recordings, ensure they meet these requirements:

* **Supported formats:** MP3, WAV
* **Maximum file size:** 100MB
* **Audio quality:** Minimum 8kHz sample rate recommended


## OpenAPI

````yaml /api-reference/openapi-call-audio-upload.json post /scoring/submitRecording
openapi: 3.0.3
info:
  title: EmberQA Call Scoring API - Audio Upload
  version: 1.0.0
servers:
  - url: https://api.emberqa.com/api
    description: Production server
security:
  - BearerAuth: []
paths:
  /scoring/submitRecording:
    post:
      tags:
        - Calls
      summary: Submit Call Recording (Audio File Upload)
      description: >-
        Submit a call recording for scoring and analysis by uploading an audio
        file with multipart form data.
      operationId: submitRecordingAudioFileUpload
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudioUploadRequest'
            example:
              file: (binary audio file)
              agent_name: Jane D
              language: en
              is_inbound: true
              metadata: >-
                {"example_property":"example_value","example_property2":"example_value2"}
      responses:
        '202':
          description: File Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
              example:
                message: File Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: '{error message}'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: '{error message}'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: '{error message}'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: '{error message}'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          source: |-
            curl --request POST \
              --url https://api.emberqa.com/api/scoring/submitRecording \
              --header 'Authorization: Bearer <token>' \
              --form 'file=@call-audio.mp3' \
              --form 'agent_name=Jane D' \
              --form 'is_inbound=true' \
              --form 'metadata={"example_property":"example_value","example_property2":"example_value2"}'
        - lang: python
          source: |-
            import json
            import requests

            url = 'https://api.emberqa.com/api/scoring/submitRecording'
            headers = {'Authorization': 'Bearer <token>'}

            with open('call-audio.mp3', 'rb') as audio_file:
                response = requests.post(
                    url,
                    headers=headers,
                    files={'file': ('call-audio.mp3', audio_file, 'audio/mpeg')},
                    data={
                        'agent_name': 'Jane D',
                        'is_inbound': 'true',
                        'metadata': json.dumps({
                            'example_property': 'example_value',
                            'example_property2': 'example_value2',
                        }),
                    },
                    timeout=60,
                )

            print(response.json())
        - lang: javascript
          source: |-
            import fs from 'node:fs';
            import axios from 'axios';
            import FormData from 'form-data';

            const url = 'https://api.emberqa.com/api/scoring/submitRecording';
            const form = new FormData();

            form.append('file', fs.createReadStream('call-audio.mp3'));
            form.append('agent_name', 'Jane D');
            form.append('is_inbound', 'true');
            form.append('metadata', JSON.stringify({
              example_property: 'example_value',
              example_property2: 'example_value2',
            }));

            const response = await axios.post(url, form, {
              headers: {
                Authorization: 'Bearer <token>',
                ...form.getHeaders(),
              },
              maxBodyLength: Infinity,
            });

            console.log(response.data);
        - lang: php
          source: >-
            <?php


            $client = new \GuzzleHttp\Client();

            $response = $client->request('POST',
            'https://api.emberqa.com/api/scoring/submitRecording', [
                'headers' => [
                    'Authorization' => 'Bearer <token>',
                ],
                'multipart' => [
                    [
                        'name' => 'file',
                        'contents' => fopen('call-audio.mp3', 'r'),
                        'filename' => 'call-audio.mp3',
                    ],
                    ['name' => 'agent_name', 'contents' => 'Jane D'],
                    ['name' => 'is_inbound', 'contents' => 'true'],
                    ['name' => 'metadata', 'contents' => json_encode([
                        'example_property' => 'example_value',
                        'example_property2' => 'example_value2',
                    ])],
                ],
            ]);


            echo $response->getBody();
        - lang: java
          source: >-
            import java.io.File;

            import kong.unirest.core.HttpResponse;

            import kong.unirest.core.Unirest;


            HttpResponse<String> response =
            Unirest.post("https://api.emberqa.com/api/scoring/submitRecording")
              .header("Authorization", "Bearer <token>")
              .field("file", new File("call-audio.mp3"))
              .field("agent_name", "Jane D")
              .field("is_inbound", "true")
              .field("metadata", "{\"example_property\":\"example_value\",\"example_property2\":\"example_value2\"}")
              .asString();

            System.out.println(response.getBody());
        - lang: go
          source: |-
            package main

            import (
              "bytes"
              "fmt"
              "io"
              "mime/multipart"
              "net/http"
              "os"
            )

            func main() {
              file, err := os.Open("call-audio.mp3")
              if err != nil {
                panic(err)
              }
              defer file.Close()

              var body bytes.Buffer
              writer := multipart.NewWriter(&body)

              _ = writer.WriteField("agent_name", "Jane D")
              _ = writer.WriteField("is_inbound", "true")
              _ = writer.WriteField("metadata", "{\"example_property\":\"example_value\",\"example_property2\":\"example_value2\"}")

              part, err := writer.CreateFormFile("file", "call-audio.mp3")
              if err != nil {
                panic(err)
              }
              if _, err := io.Copy(part, file); err != nil {
                panic(err)
              }
              writer.Close()

              req, err := http.NewRequest("POST", "https://api.emberqa.com/api/scoring/submitRecording", &body)
              if err != nil {
                panic(err)
              }
              req.Header.Set("Authorization", "Bearer <token>")
              req.Header.Set("Content-Type", writer.FormDataContentType())

              resp, err := http.DefaultClient.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              responseBody, _ := io.ReadAll(resp.Body)
              fmt.Println(string(responseBody))
            }
        - lang: ruby
          source: >-
            require 'faraday'

            require 'faraday/multipart'

            require 'json'


            conn = Faraday.new do |f|
              f.request :multipart
              f.request :url_encoded
              f.adapter Faraday.default_adapter
            end


            response =
            conn.post('https://api.emberqa.com/api/scoring/submitRecording') do
            |req|
              req.headers['Authorization'] = 'Bearer <token>'
              req.body = {
                file: Faraday::Multipart::FilePart.new('call-audio.mp3', 'audio/mpeg'),
                agent_name: 'Jane D',
                is_inbound: 'true',
                metadata: JSON.generate({
                  example_property: 'example_value',
                  example_property2: 'example_value2'
                })
              }
            end


            puts response.body
components:
  schemas:
    AudioUploadRequest:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: Audio file upload (MP3 or WAV, max 100MB)
        agent_name:
          type: string
          description: Name of the agent who handled the call
          example: Jane D
        language:
          type: string
          description: >-
            Language code for the call audio. Defaults to English ("en") if not
            provided.
          example: en
        is_inbound:
          type: boolean
          nullable: true
          default: true
          description: >-
            Boolean flag indicating whether the call was inbound. Defaults to
            true when omitted.
          example: true
        transcript_url:
          type: string
          format: uri
          description: Optional publicly accessible URL to a plain text transcript file.
        transcript_text:
          type: string
          description: Optional inline plain text transcript.
          example: |-
            Speaker 0: Thank you for calling EmberQA.
            Speaker 1: Hi, I need help with my order.
        metadata:
          type: string
          description: >-
            Optional stringified JSON metadata object.


            Example:
            `{"example_property":"example_value","example_property2":"example_value2"}`
    SuccessResponse:
      type: object
      properties:
        message:
          type: string
          example: File Accepted
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: '{error message}'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key obtained from the EmberQA dashboard under the "Integrations" tab

````