---
title: "Socket API"
description: "Real-time task updates using Socket.io."
canonical_url: "https://cloudconvert.com/docs/integrations/socket"
---
# Socket API

> Real-time task updates using Socket.io.

## Socket API

The CloudConvert Socket API offers real time task updates. We use the [Socket.io](https://socket.io) protocol. Socket.io clients are available in [JavaScript](https://github.com/socketio/socket.io-client) and other languages. [The official Node SDK](https://github.com/cloudconvert/cloudconvert-node) has a built in handling for the Websocket API.

The Socket.io base host is `https://socketio.cloudconvert.com`. When joining channels you need to authorize using the `Authorization: Bearer API_KEY` header (see example below).

#### Channels and Events

| Channel | Description | Available Events |
| --- | --- | --- |
| `private-job.{jobId}` | Events for a specific job. | `job.created`<br>`job.updated`<br>`job.finished`<br>`job.failed` |
| `private-task.{taskId}` | Events for a specific task. | `task.created`<br>`task.updated`<br>`task.finished`<br>`task.failed` |
| `private-job.{jobId}.tasks` | All task events for a specific job. | `task.created`<br>`task.updated`<br>`task.finished`<br>`task.failed` |
| `private-user.{userId}.tasks` | All task events for your user. You can find out your user id using the [users/me](https://cloudconvert.com/docs/raw/api-reference/users.md#show-user) endpoint. | `task.created`<br>`task.updated`<br>`task.finished`<br>`task.failed` |
| `private-user.{userId}.jobs` | All job events for your user. You can find out your user id using the [users/me](https://cloudconvert.com/docs/raw/api-reference/users.md#show-user) endpoint. | `job.created`<br>`job.updated`<br>`job.finished`<br>`job.failed` |

#### Node.js Example

```js
const socket = io.connect('https://socketio.cloudconvert.com');

socket.emit('subscribe', {
    channel: 'private-jobs.6559c281-ed85-4728-80db-414561c631e9.tasks',
    auth: {
        headers: {
            Authorization: 'Bearer API_KEY'
        }
    },
});

socket.on('task.created', function (channel, data) {
    console.log(data.task);
});

socket.on('task.finished', function (channel, data) {
    console.log(data.task);
});
```


## Sitemap

See the full [sitemap](https://cloudconvert.com/docs/sitemap.md) for all pages.
