Skip to main content
Views API is provided at https://YOUR_ACCOUNT.fibery.io/api/views/json-rpc. It follows the JSON-RPC specification.

Getting views

To get a list of Views, use the query-views method. All filters and params are optional. If omitted, all Views will be returned.
const response = await fetch('https://YOUR_ACCOUNT.fibery.io/api/views/json-rpc', {
  method: 'POST',
  headers: {
    'Authorization': 'Token YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'query-views',
    params: {
      filter: {
        ids: ['b190008d-3fef-4df5-b8b9-1b432a0e0f05', 'dd62b0df-537e-4c12-89f2-d937da128c7b'],
        publicIds: ['1001', '1002']
      }
    }
  })
});
const data = await response.json();
Possible filters are:
idsarray of UUID stringsMatches views by the fibery/id field.
publicIdsarray of numeric stringsMatches views by the fibery/public-id field.
isPrivatetrue or falseIf true, return only matching views from “My space”. If false, return only matching views outside of “My space”. If omitted, matching views both from and outside of “My space” are returned.
container{type: "entity"; typeId: "6ded97e6-b4ca-4a8c-a740-6c34c3651cd1"; publicIds: ["1", "2"]}If provided, the query will return only views attached to entities with the given public ids in the database (type) with the given typeId.

Creating views

To create one or more Views, use the create-views method: “Container app” in this example contains a fibery/id reference to the space where the new View is to be created.
const response = await fetch('https://YOUR_ACCOUNT.fibery.io/api/views/json-rpc', {
  method: 'POST',
  headers: {
    'Authorization': 'Token YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'create-views',
    params: {
      views: [
        {
          'fibery/id': '3541bdf6-ab15-4d5e-b17b-eb124b8fe2f7',
          'fibery/name': 'My Board',
          'fibery/type': 'board',
          'fibery/meta': {},
          'fibery/container-app': {
            'fibery/id': '760ee2e2-e8ca-4f92-aaf2-4cde7f9dad0e'
          }
        }
      ]
    }
  })
});
const data = await response.json();

Updating views

To update one or more Views, use the update-views method:
const response = await fetch('https://YOUR_ACCOUNT.fibery.io/api/views/json-rpc', {
  method: 'POST',
  headers: {
    'Authorization': 'Token YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'update-views',
    params: {
      updates: [
        {
          id: '3541bdf6-ab15-4d5e-b17b-eb124b8fe2f7',
          values: {
            'fibery/name': 'My Updated Board',
            'fibery/meta': {}
          }
        }
      ]
    }
  })
});
const data = await response.json();

Deleting views

To delete one or more Views, use the delete-views method:
const response = await fetch('https://YOUR_ACCOUNT.fibery.io/api/views/json-rpc', {
  method: 'POST',
  headers: {
    'Authorization': 'Token YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'delete-views',
    params: {
      ids: ['3541bdf6-ab15-4d5e-b17b-eb124b8fe2f7']
    }
  })
});
const data = await response.json();