Skip to content
V2 (Legacy) API ReferenceGet started

Send a voice memo to a chat

client.Chats.SendVoicememo(ctx, chatID, body) (*ChatSendVoicememoResponse, error)
POST/v3/chats/{chatId}/voicememo

Send an audio file as an iMessage voice memo bubble to all participants in a chat. Voice memos appear with iMessageโ€™s native inline playback UI, unlike regular audio attachments sent via media parts which appear as downloadable files.

Supported audio formats:

  • MP3 (audio/mpeg)
  • M4A (audio/x-m4a, audio/mp4)
  • AAC (audio/aac)
  • CAF (audio/x-caf) - Core Audio Format
  • WAV (audio/wav)
  • AIFF (audio/aiff, audio/x-aiff)
  • AMR (audio/amr)
ParametersExpand Collapse
chatID string
formatuuid
body ChatSendVoicememoParams
AttachmentID param.Field[string]Optional

Reference to a voice memo file pre-uploaded via POST /v3/attachments. The file is already stored, so sends using this ID skip the download step.

Either voice_memo_url or attachment_id must be provided, but not both.

formatuuid
VoiceMemoURL param.Field[string]Optional

URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.

Either voice_memo_url or attachment_id must be provided, but not both.

formaturi
ReturnsExpand Collapse
type ChatSendVoicememoResponse struct{โ€ฆ}

Response for sending a voice memo to a chat

VoiceMemo ChatSendVoicememoResponseVoiceMemo
ID string

Message identifier

formatuuid
Chat ChatSendVoicememoResponseVoiceMemoChat
ID string

Chat identifier

formatuuid
Handles []ChatHandle

Chat participants

ID string

Unique identifier for this handle

formatuuid
Handle string

Phone number (E.164) or email address of the participant

JoinedAt Time

When this participant joined the chat

formatdate-time
Service ServiceType

Messaging service type

One of the following:
const ServiceTypeiMessage ServiceType = "iMessage"
const ServiceTypeSMS ServiceType = "SMS"
const ServiceTypeRCS ServiceType = "RCS"
IsMe boolOptional

Whether this handle belongs to the sender (your phone number)

LeftAt TimeOptional

When they left (if applicable)

formatdate-time
Status ChatHandleStatusOptional

Participant status

One of the following:
const ChatHandleStatusActive ChatHandleStatus = "active"
const ChatHandleStatusLeft ChatHandleStatus = "left"
const ChatHandleStatusRemoved ChatHandleStatus = "removed"
IsActive bool

Whether the chat is active

IsGroup bool

Whether this is a group chat

Service ServiceType

Messaging service type

One of the following:
const ServiceTypeiMessage ServiceType = "iMessage"
const ServiceTypeSMS ServiceType = "SMS"
const ServiceTypeRCS ServiceType = "RCS"
CreatedAt Time

When the voice memo was created

formatdate-time
From string

Sender phone number

Status string

Current delivery status

To []string

Recipient handles (phone numbers or email addresses)

VoiceMemo ChatSendVoicememoResponseVoiceMemoVoiceMemo
ID string

Attachment identifier

formatuuid
Filename string

Original filename

MimeType string

Audio MIME type

SizeBytes int64

File size in bytes

URL string

CDN URL for downloading the voice memo

formaturi
DurationMs int64Optional

Duration in milliseconds

Service ServiceTypeOptional

Messaging service type

One of the following:
const ServiceTypeiMessage ServiceType = "iMessage"
const ServiceTypeSMS ServiceType = "SMS"
const ServiceTypeRCS ServiceType = "RCS"

Send a voice memo to a chat

package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Chats.SendVoicememo(
    context.TODO(),
    "f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",
    linqgo.ChatSendVoicememoParams{
      VoiceMemoURL: linqgo.String("https://example.com/voice-memo.m4a"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.VoiceMemo)
}
{
  "voice_memo": {
    "id": "69a37c7d-af4f-4b5e-af42-e28e98ce873a",
    "chat": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "handles": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "handle": "+15551234567",
          "joined_at": "2025-05-21T15:30:00.000-05:00",
          "service": "iMessage",
          "is_me": false,
          "left_at": "2019-12-27T18:11:19.117Z",
          "status": "active"
        }
      ],
      "is_active": true,
      "is_group": true,
      "service": "iMessage"
    },
    "created_at": "2019-12-27T18:11:19.117Z",
    "from": "+12052535597",
    "status": "queued",
    "to": [
      "+12052532136"
    ],
    "voice_memo": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "voice-memo.m4a",
      "mime_type": "audio/x-m4a",
      "size_bytes": 524288,
      "url": "https://cdn.linqapp.com/voice-memos/abc123.m4a",
      "duration_ms": 15000
    },
    "service": "iMessage"
  }
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found"
  },
  "success": false
}
{
  "error": {
    "status": 413,
    "code": 5001,
    "message": "Voice memo file too large - maximum size is 10MB"
  },
  "success": false
}
{
  "error": {
    "status": 422,
    "code": 1003,
    "message": "Request is valid but cannot be processed"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}
Returns Examples
{
  "voice_memo": {
    "id": "69a37c7d-af4f-4b5e-af42-e28e98ce873a",
    "chat": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "handles": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "handle": "+15551234567",
          "joined_at": "2025-05-21T15:30:00.000-05:00",
          "service": "iMessage",
          "is_me": false,
          "left_at": "2019-12-27T18:11:19.117Z",
          "status": "active"
        }
      ],
      "is_active": true,
      "is_group": true,
      "service": "iMessage"
    },
    "created_at": "2019-12-27T18:11:19.117Z",
    "from": "+12052535597",
    "status": "queued",
    "to": [
      "+12052532136"
    ],
    "voice_memo": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "voice-memo.m4a",
      "mime_type": "audio/x-m4a",
      "size_bytes": 524288,
      "url": "https://cdn.linqapp.com/voice-memos/abc123.m4a",
      "duration_ms": 15000
    },
    "service": "iMessage"
  }
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found"
  },
  "success": false
}
{
  "error": {
    "status": 413,
    "code": 5001,
    "message": "Voice memo file too large - maximum size is 10MB"
  },
  "success": false
}
{
  "error": {
    "status": 422,
    "code": 1003,
    "message": "Request is valid but cannot be processed"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}