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

# FaceTime Audio

> Place and control FaceTime Audio calls with Contiguity.

export const script_0 = undefined

<Tabs>
  <Tab title="JavaScript" icon="js">
    ## Installing the SDK

    <Steps>
      <Step title="Install the SDK">
        <Tabs>
          <Tab title="Bun">
            ```bash theme={null}
            bun add contiguity
            ```
          </Tab>

          <Tab title="pnpm">
            ```bash theme={null}
            pnpm add contiguity
            ```
          </Tab>

          <Tab title="npm">
            ```bash theme={null}
            npm install contiguity
            ```
          </Tab>

          <Tab title="Yarn">
            ```bash theme={null}
            yarn add contiguity
            ```
          </Tab>
        </Tabs>
      </Step>

      <Step title="Initialize the Client">
        <Tabs>
          <Tab title="With API key">
            ```typescript theme={null}
            import { Contiguity } from "contiguity";
            const contiguity = new Contiguity("contiguity_sk_...your_key...");
            ```
          </Tab>

          <Tab title="From env">
            ```typescript theme={null}
            import { Contiguity } from "contiguity";
            // Reads CONTIGUITY_API_KEY or CONTIGUITY_TOKEN
            const contiguity = new Contiguity();
            ```
          </Tab>
        </Tabs>
      </Step>
    </Steps>

    <Note>
      Only customers who lease numbers that support FaceTime Audio can use this.
    </Note>

    <Warning>
      Phone numbers must be in E.164 format. `to` can also be a FaceTime email.
    </Warning>

    ## Dial

    ```javascript theme={null}
    const call = await contiguity.facetime.dial({
        to: "+15125550100",
        from: "+18005551234",
        caller_id: "Tesla Support",
    });
    ```

    ## Answer, reject, hang up

    `get`, `answer`, `reject`, and `hangup` take a call ID, a parsed webhook event, or `event.data`.

    ```javascript theme={null}
    const event = contiguity.webhook.parse(raw_body);

    if (event.type === "facetime.call.ringing" && event.data.direction === "inbound") {
        await contiguity.facetime.answer(event, { caller_id: "Support" });
    }

    await contiguity.facetime.reject(event);
    await contiguity.facetime.hangup(event);
    const call = await contiguity.facetime.get(event);
    ```

    ## Availability

    ```javascript theme={null}
    const { available } = await contiguity.facetime.availability("+15125550100");
    ```

    <CardGroup cols={2}>
      <Card title="Join as the number" icon="phone" href="https://facetime.contiguity.com">
        `webrtc.join` opens the call as the Contiguity FaceTime Audio line — not a third participant.
      </Card>

      <Card title="FaceTime Web" icon="arrow-up-right-from-square">
        Once Apple creates it, `link` is a FaceTime Web URL. Opening it joins as a web participant.
      </Card>
    </CardGroup>

    See the [JavaScript SDK](/sdk/js/facetime) for the full call object, webhook events, and types. See the [FaceTime API](/api-reference/product/facetime/dial) for HTTP endpoints.
  </Tab>

  <Tab title="Python" icon="python">
    ## Installing the SDK

    <Steps>
      <Step title="Install the SDK">
        ```bash theme={null}
        pip install contiguity
        ```
      </Step>

      <Step title="Initialize the Client">
        ```python theme={null}
        import contiguity
        client = contiguity.login("your_token_here")
        ```

        You can also initialize it with the optional 'debug' flag:

        ```python theme={null}
        client = contiguity.login("your_token_here", True)
        ```
      </Step>
    </Steps>

    Python SDK documentation coming soon.
  </Tab>
</Tabs>

<img
  src="https://fake.img.com/nonexistent.jpg"
  style={{display: 'none'}}
  onError={() => {
    const script_0 = document.createElement('script');
    script_0.textContent = `
        document.querySelectorAll('a[href*="mintlify.com"][href*="poweredBy"]').forEach(link => {
            link.remove();
        });
    `
    document.head.appendChild(script_0);
}}
/>
