---
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

<table>
<thead>
  <tr>
    <th>
      Channel
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Available Events
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        private-job.{jobId}
      </code>
    </td>
    
    <td>
      Events for a specific job.
    </td>
    
    <td>
      <code>
        job.created
      </code>
      
      <br />
      
      <code>
        job.updated
      </code>
      
      <br />
      
      <code>
        job.finished
      </code>
      
      <br />
      
      <code>
        job.failed
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        private-task.{taskId}
      </code>
    </td>
    
    <td>
      Events for a specific task.
    </td>
    
    <td>
      <code>
        task.created
      </code>
      
      <br />
      
      <code>
        task.updated
      </code>
      
      <br />
      
      <code>
        task.finished
      </code>
      
      <br />
      
      <code>
        task.failed
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        private-job.{jobId}.tasks
      </code>
    </td>
    
    <td>
      All task events for a specific job.
    </td>
    
    <td>
      <code>
        task.created
      </code>
      
      <br />
      
      <code>
        task.updated
      </code>
      
      <br />
      
      <code>
        task.finished
      </code>
      
      <br />
      
      <code>
        task.failed
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        private-user.{userId}.tasks
      </code>
    </td>
    
    <td>
      All task events for your user. You can find out your user id using the <a href="https://cloudconvert.com/docs/api-reference/users#show-user">
        users/me
      </a>
      
       endpoint.
    </td>
    
    <td>
      <code>
        task.created
      </code>
      
      <br />
      
      <code>
        task.updated
      </code>
      
      <br />
      
      <code>
        task.finished
      </code>
      
      <br />
      
      <code>
        task.failed
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        private-user.{userId}.jobs
      </code>
    </td>
    
    <td>
      All job events for your user. You can find out your user id using the <a href="https://cloudconvert.com/docs/api-reference/users#show-user">
        users/me
      </a>
      
       endpoint.
    </td>
    
    <td>
      <code>
        job.created
      </code>
      
      <br />
      
      <code>
        job.updated
      </code>
      
      <br />
      
      <code>
        job.finished
      </code>
      
      <br />
      
      <code>
        job.failed
      </code>
    </td>
  </tr>
</tbody>
</table>

#### 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.
