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

# Recordings

> Access and manage call recordings and transcriptions

<Info>
  **Base path: `/recordings`**
</Info>

This API manages call recordings created during flow execution (via `COLLECT_AUDIO` nodes).

**Related APIs:**

* [Call Flow API](/features/call-flows) - Flow types including CollectAudioNode
* [Call Report API](/features/call-reports) - Query call execution details

***

## Types

<Accordion title="Type Definitions">
  ```typescript theme={null}
  // ============ Recording Types ============

  type RecordingType = 'segment' | 'full_call';

  interface Recording {
    id: string;                    // Recording UUID
    callId: string;                // Associated call UUID
    fileId: string;                // S3 file reference UUID
    recordingType: RecordingType;
    nodeId: string | null;         // Node that created this recording
    durationMs: number | null;     // Duration in milliseconds
    deletedAt: string | null;      // Soft delete timestamp
    createdAt: string;             // ISO date
    updatedAt: string;             // ISO date
  }

  interface RecordingWithFile extends Recording {
    file: {
      id: string;
      name: string;
      contentType: string;         // e.g., "audio/wav"
      fileSize: number;            // Size in bytes
    };
  }

  // ============ Query Parameters ============

  interface RecordingListQueryParams {
    limit?: number;                // default: 20
    offset?: number;               // default: 0
  }

  // ============ Response Types ============

  interface MessageResponse {
    message: string;
  }
  ```
</Accordion>

***

### Get paginated list of all recordings

```bash theme={null}
curl -X GET https://api.gomobile.ma/api/recordings?limit=20&offset=0 \
  -H "x-api-key: YOUR_API_KEY"
```

Response:

```json theme={null}
[
  {
    "id": "a20ad48b-cb36-4448-86c3-f1b4a56cd02a",
    "callId": "f12d3637-45e8-4088-9712-2c5243da131b",
    "fileId": "ddf3bb4c-4e0a-4a67-9964-5623527355c2",
    "recordingType": "segment",
    "nodeId": "collect-audio-1",
    "durationMs": 7920,
    "deletedAt": null,
    "createdAt": "2026-01-02T14:02:10.358Z",
    "updatedAt": "2026-01-02T14:02:10.358Z"
  }
]
```

***

### Stream recording audio for playback

***

### Download recording as a file attachment

***

### Get recording metadata without audio content

```bash theme={null}
curl -X GET https://api.gomobile.ma/api/recordings/a20ad48b-cb36-4448-86c3-f1b4a56cd02a/metadata \
  -H "x-api-key: YOUR_API_KEY"
```

Response:

```json theme={null}
{
  "id": "a20ad48b-cb36-4448-86c3-f1b4a56cd02a",
  "callId": "f12d3637-45e8-4088-9712-2c5243da131b",
  "fileId": "ddf3bb4c-4e0a-4a67-9964-5623527355c2",
  "recordingType": "segment",
  "nodeId": "collect-audio-1",
  "durationMs": 7920,
  "deletedAt": null,
  "createdAt": "2026-01-02T14:02:10.358Z",
  "updatedAt": "2026-01-02T14:02:10.358Z",
  "file": {
    "id": "ddf3bb4c-4e0a-4a67-9964-5623527355c2",
    "name": "recording.wav",
    "contentType": "audio/wav",
    "fileSize": 126720
  }
}
```

***

### Get all recordings for a specific call

```bash theme={null}
curl -X GET https://api.gomobile.ma/api/recordings/call/f12d3637-45e8-4088-9712-2c5243da131b \
  -H "x-api-key: YOUR_API_KEY"
```

Response:

```json theme={null}
[
  {
    "id": "a20ad48b-cb36-4448-86c3-f1b4a56cd02a",
    "callId": "f12d3637-45e8-4088-9712-2c5243da131b",
    "fileId": "ddf3bb4c-4e0a-4a67-9964-5623527355c2",
    "recordingType": "segment",
    "nodeId": "collect-audio-1",
    "durationMs": 7920,
    "deletedAt": null,
    "createdAt": "2026-01-02T14:02:10.358Z",
    "updatedAt": "2026-01-02T14:02:10.358Z"
  }
]
```

***

### Soft delete a recording

```bash theme={null}
curl -X DELETE https://api.gomobile.ma/api/recordings/a20ad48b-cb36-4448-86c3-f1b4a56cd02a \
  -H "x-api-key: YOUR_API_KEY"
```

Response:

```json theme={null}
{
  "message": "Recording deleted"
}
```

***

## Usage Notes

### Recording ID from Flow

When using `COLLECT_AUDIO` node in a flow, the recording ID is stored in the variable specified by `recordingIdVariable`. This ID can be used to:

1. Stream/download the recording via this API
2. Reference the recording in call reports

### Soft Delete

Recordings are soft-deleted (marked with `deletedAt` timestamp) rather than permanently removed. Soft-deleted recordings are excluded from all API queries.

### Audio Format

All recordings are stored as WAV files:

* Sample rate: 8kHz
* Bit depth: 16-bit
* Channels: Mono (1)
* Content-Type: `audio/wav`
