Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls deletion documentation #682

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 70 additions & 5 deletions docusaurus/video/docusaurus/docs/api/gdpr/calls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


## Calls deletion
## Delete a call

You can either soft-delete or hard-delete a call and all its related data (members, sessions, recordings, transcriptions).

### Soft delete

Soft-delete a call means that the call and all its related data will not be completely removed from our system but will no longer be accessible via the API.
Soft-deleting a call means that the call and all its related data will not be completely removed from our system but will no longer be accessible via the API.


<Tabs groupId="examples">
Expand Down Expand Up @@ -50,14 +50,14 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C

:::note

_This endpoint requires a server-side authentication._
_This endpoint requires server-side authentication._

:::

Hard-delete a call means that the call and all its related data will be completely wiped out from our system.
Hard-deleting a call means that the call and all its related data will be completely wiped out from our system.
This action is irrevocable, and the data cannot be recovered.

This operation is done asynchronously and you can use the returned `task_id` to monitor its progress.
This operation is done asynchronously, and you can use the returned `task_id` to monitor its progress.
See [how to monitor an async task](../../misc/async).

<Tabs groupId="examples">
Expand Down Expand Up @@ -88,3 +88,68 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C

</TabItem>
</Tabs>


## Delete many calls

:::note

_This endpoint requires server-side authentication._

:::

If you have more than one call to delete, you can use the batch endpoint, which allows you to delete up to 100 calls in one API call.


<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
// hard-delete calls
const resp = await client.deleteCalls({
cids: ["cid1", "cid2", "cid3"],
hard: true,
});
// resp.task_id is the ID to be used for monitoring the task
```

</TabItem>
<TabItem value="curl" label="cURL">

```bash
# Hard-delete calls
curl -X POST "https://video.stream-io-api.com/api/v2/video/calls/delete?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt" \
-H "Content-Type: application/json" \
-d '{
"cids": ["cid1", "cid2", "cid3"]
"hard": true
}'
```

</TabItem>
</Tabs>


The main difference with the single call deletion endpoint is that the actual deletion will be done asynchronously, whether or not the `hard` paremeter is true.

When the operation is done, the [GetTask endpoint](../../misc/async) returns a map in the `result` field, which provides information about the success or failure of each deletion.
```js
// example of the result field
{
"cid1": {
"status": "ok",
},
"cid2": {
"status": "error",
"error": "something wrong happened, please retry"
}
"cid3": {
"status": "error",
"error": "call not found"
}
}
```

In the snippet above, we can see that `cid2` and `cid3` failed to be deleted. `cid3` doesn't exist so there is nothing to do; however, we can make another API call to delete `cid2`.
Loading