Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Realtime

Transfer a SIP call

POST /openai/v1/realtime/calls/{call_id}/refer

Transfers an active SIP call to a new destination using the SIP REFER verb.

Path parameters

call_id string required

The identifier for the call provided in the realtime.call.incoming webhook.

Request Body

Destination URI for the REFER request.

Content-Type: application/json
target_uri string required

URI that should appear in the SIP Refer-To header. Supports values like tel:+14155550123 or sip:agent\@example.com.

Responses

The request has succeeded.

Client error

Body

Content-Type: application/json
error OpenAI.Error required
code string | null required
message string required
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Any of the following:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string required

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Body

Content-Type: application/json
error OpenAI.Error required
code string | null required
message string required
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Any of the following:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string required

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Request

curl -X POST https://api.openai.com/v1/realtime/calls/$CALL_ID/refer \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_uri": "tel:+14155550123"}'
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

await client.realtime.calls.refer('call_id', { target_uri: 'tel:+14155550123' });
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
client.realtime.calls.refer(
    call_id="call_id",
    target_uri="tel:+14155550123",
)
package main

import (
    "context"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
    "github.com/openai/openai-go/realtime"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    err := client.Realtime.Calls.Refer(
        context.TODO(),
        "call_id",
        realtime.CallReferParams{
            TargetUri: "tel:+14155550123",
        },
    )
    if err != nil {
        panic(err.Error())
    }
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.realtime.calls.CallReferParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        CallReferParams params = CallReferParams.builder()
            .callId("call_id")
            .targetUri("tel:+14155550123")
            .build();
        client.realtime().calls().refer(params);
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

result = openai.realtime.calls.refer("call_id", target_uri: "tel:+14155550123")

puts(result)
en-us
Your Privacy Choices
  • AI Disclaimer
  • Previous Versions
  • Blog
  • Contribute
  • Privacy
  • Consumer Health Privacy
  • Terms of Use
  • Trademarks
  • © Microsoft 2026