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

# cancel

### GET api/v1/ai\_voice/organizations/2140/appointments/8943588/cancel

This endpoint will cancel the appointment for patient on both TeamCare and Practice PMS.

#### Parameters

* Ai Agent will just have to hit on cancel end point as above to cancel the scheduled appointment.
* Organization id in url will be the id for practice in teamcare database.
* Appointment id will be the id we'll be passing in rather metadata for during call.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://app.teamcaredental.com/api/v1/ai_voice/organizations/:organization_id/appointments/:appointment_id/cancel" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://app.teamcaredental.com/api/v1/ai_voice/organizations/:organization_id/appointments/:appointment_id/cancel", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_ACCESS_TOKEN"
    }
  })

  const data = await response.json()
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://app.teamcaredental.com/api/v1/ai_voice/organizations/:organization_id/appointments/:appointment_id/cancel",
      headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
  )

  data = response.json()
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "json"

  uri = URI("https://app.teamcaredental.com/api/v1/ai_voice/organizations/:organization_id/appointments/:appointment_id/cancel")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end

  data = JSON.parse(response.body)
  ```
</CodeGroup>

Response

Content-Type: application/json Data attribute returned just to give you insights, it has nothing to do with patient.

```json theme={null}
{
    "message": "Appointment cancelled successfully"
}
```

And In case of appointment not found,

```json theme={null}
{
    "errors": "Couldn't find Appointment with 'id'=1 [WHERE \"appointments\".\"deleted\" = $1 AND \"appointments\".\"tenant_id\" = $2]"
}
```
