NAV Navbar
Shell HTTP JavaScript Node.JS Ruby Python Java Go
  • Cognite API v0.5
  • Authentication
  • Projects
  • Assets
  • Time series
  • Datapoints
  • Events
  • Files
  • API Keys
  • Analytics
  • Groups
  • Login
  • Logout
  • Pipelines
  • Raw
  • Security categories
  • Similarity Search
  • Users
  • Schemas
  • Cognite API v0.5

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    This is the reference documentation for the Cognite API. Here you can see an overview of all methods available through the API. We also offer an API guide, which is more useful as a first introduction.

    Base URLs:

    Authentication

    Projects

    Projects are used to separate customers from one another, and all objects in CDP are linked to a project. A customer usually has only one project. The project object contains configuration for how to authenticate users.

    Automatically assigned object ids are unique only within each project.

    Warning: The projects API is currently in experimental alpha; if you have issues, contact Cognite.

    Retrieve a project

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}

    Retrieves information about a project given the project name.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "urlName": "string",
            "defaultGroupId": 0,
            "authentication": {
              "type": "AzureAD",
              "protocol": "oauth2",
              "azureADConfiguration": {},
              "validDomains": [],
              "oauth2Configuration": {}
            }
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Information about the project. ProjectsResponse

    Update a project

    Code samples

    # You can also use wget
    curl -X PUT https://api.cognitedata.com/api/0.5/projects/{project} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    PUT https://api.cognitedata.com/api/0.5/projects/{project} HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}',
      method: 'put',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "urlName": "string",
          "defaultGroupId": 0,
          "authentication": {
            "type": "AzureAD",
            "protocol": "oauth2",
            "azureADConfiguration": {
              "appId": "string",
              "appSecret": "string",
              "tenantId": "string",
              "appResourceId": "string"
            },
            "validDomains": [
              "string"
            ],
            "oauth2Configuration": {
              "loginUrl": "string",
              "logoutUrl": "string",
              "tokenUrl": "string",
              "clientId": "string",
              "clientSecret": "string"
            }
          }
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.cognitedata.com/api/0.5/projects/{project}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.put('https://api.cognitedata.com/api/0.5/projects/{project}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}")
      .put(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.cognitedata.com/api/0.5/projects/{project}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    PUT /api/0.5/projects/{project}

    Updates the specified project with the values provided.

    Warning: Even though this endpoint takes a list of items, it currently only supports updating one project at a time (i.e. the list of items has to have exactly one element).

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "urlName": "string",
          "defaultGroupId": 0,
          "authentication": {
            "type": "AzureAD",
            "protocol": "oauth2",
            "azureADConfiguration": {
              "appId": "string",
              "appSecret": "string",
              "tenantId": "string",
              "appResourceId": "string"
            },
            "validDomains": [
              "string"
            ],
            "oauth2Configuration": {
              "loginUrl": "string",
              "logoutUrl": "string",
              "tokenUrl": "string",
              "clientId": "string",
              "clientSecret": "string"
            }
          }
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataProject true List of projects to update, with new values. Currently only supports one project. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "urlName": "string",
            "defaultGroupId": 0,
            "authentication": {
              "type": "AzureAD",
              "protocol": "oauth2",
              "azureADConfiguration": {},
              "validDomains": [],
              "oauth2Configuration": {}
            }
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Project was updated. ProjectsResponse

    Assets

    CDP organizes digital information about the physical world. Assets are digital representations of physical objects or groups of objects, and assets are organized into an asset hierarchy. For example, an asset can represent a water pump which is part of a subsystem on an oil platform.

    Assets are used to connect related data together, even if the data comes from different sources; Time series of data points, events and files are all connected to one or more assets. The pump asset can be connected to a time series measuring pressure within the pump, as well as events recording maintenance operations, and a file with a 3D diagram of the pump.

    At the top of an asset hierarchy is a root asset (e.g., the oil platform). Each project can have multiple root assets. All assets have a name and a parent asset. No assets with the same parent can have the same name.

    Create assets

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/assets \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/assets HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "parentId": 0,
          "description": "string",
          "metadata": {},
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "refId": "string",
          "parentName": "string",
          "parentRefId": "string"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/assets', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/assets", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/assets

    Creates new assets in the given project.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "parentId": 0,
          "description": "string",
          "metadata": {},
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "refId": "string",
          "parentName": "string",
          "parentRefId": "string"
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataPostAssetDTO true List of assets to create N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of the posted assets. AssetDataResponse

    Retrieve an asset

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/assets/{assetId}

    Retrieves information about an asset in a certain project given an asset id.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    assetId path integer(int64) true No description N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Asset matching the id. AssetDataResponse

    Retrieve multiple assets

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/byids", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/assets/byids

    Retrieves information about multiple assets in the same project.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of IDs of assets to retrieve N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of assets matching the ids. AssetDataResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update an asset

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "id": 0,
      "name": {
        "set": "string",
        "setNull": true
      },
      "description": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "source": {
        "set": "string",
        "setNull": true
      },
      "sourceId": {
        "set": "string",
        "setNull": true
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/{id}/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/assets/{id}/update

    Updates an asset object. Supports partial updates i.e. updating only some fields but leaving the rest unchanged.

    Under DataAssetChange -> SinglePathString, you can use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    Body parameter

    {
      "id": 0,
      "name": {
        "set": "string",
        "setNull": true
      },
      "description": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "source": {
        "set": "string",
        "setNull": true
      },
      "sourceId": {
        "set": "string",
        "setNull": true
      }
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of the asset N/A
    body body AssetChange true Content of changes N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Corresponding asset after applying the update. AssetDataResponse

    Update multiple assets

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "name": {
            "set": "string",
            "setNull": true
          },
          "description": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "source": {
            "set": "string",
            "setNull": true
          },
          "sourceId": {
            "set": "string",
            "setNull": true
          }
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/assets/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/assets/update

    Updates multiple assets within the same project. Updating assets does not replace the existing asset hierarchy. This operation supports partial updates, meaning that fields omitted from the requests are not changed.

    Under DataAssetChange -> SinglePathString, you can use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "name": {
            "set": "string",
            "setNull": true
          },
          "description": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "source": {
            "set": "string",
            "setNull": true
          },
          "sourceId": {
            "set": "string",
            "setNull": true
          }
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataAssetChange true List of changes. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Corresponding assets after applying the updates. AssetDataResponse

    Overwrite multiple assets

    Code samples

    # You can also use wget
    curl -X PUT https://api.cognitedata.com/api/0.5/projects/{project}/assets \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    PUT https://api.cognitedata.com/api/0.5/projects/{project}/assets HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      method: 'put',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "parentId": 0,
          "description": "string",
          "metadata": {},
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "id": 0,
          "path": [
            0
          ],
          "depth": 0
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.put('https://api.cognitedata.com/api/0.5/projects/{project}/assets', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets")
      .put(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.cognitedata.com/api/0.5/projects/{project}/assets", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    PUT /api/0.5/projects/{project}/assets

    This operation does not support partial updates e.g. updating just the name of the asset without specifying values for other fields.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "parentId": 0,
          "description": "string",
          "metadata": {},
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "id": 0,
          "path": [
            0
          ],
          "depth": 0
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataGetAssetDTO true List of assets to update N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Delete assets

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/delete", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/assets/delete

    Deletes multiple assets in the same project, along with all their descendants in the asset hierarchy.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of IDs of assets to delete N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Ids duplicated. ErrorResponse

    List all assets

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/assets \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/assets HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/assets',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/assets', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/assets", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/assets

    Retrieve a list of all assets in the given project. The list is sorted alphabetically by name. This operation supports pagination.

    You can retrieve a subset of assets by supplying additional fields; Only assets satisfying all criterias will be returned. Names and descriptions are fuzzy searched using edit distance. The fuzziness parameter controls the maximum edit distance when considering matches for the name and description fields.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name query string false The name of the asset(s) to get. N/A
    fuzziness query integer(int32) false The degree of fuzziness in the name matching N/A
    path query string false The path of the subtree to search in. N/A
    depth query integer(int32) false Get sub assets up to this many levels below the specified path. N/A
    metadata query string false The metadata values used to filter the results N/A
    description query string false Only return assets that contain this description N/A
    source query string false The source of the assets used to filter the results N/A
    cursor query string false Cursor to use for paging through results N/A
    limit query integer(int32) false The maximum number of assets to be returned. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of assets in lexicographic order. AssetDataWithCursorResponse

    List descendants of an asset

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/{assetId}/subtree", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/assets/{assetId}/subtree

    Retrieves a list of assets descending from the given asset. The asset hierarchy is traversed breadth first, meaning that assets with the same parent will appear next to each other in the reply. This operation supports pagination.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    assetId path integer(int64) true No description N/A
    depth query integer(int32) false Get sub assets up to this many levels below the specified asset. N/A
    cursor query string false Cursor to use for paging through results N/A
    limit query integer(int32) false The maximum number of assets to be returned. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of assets in breadth first order. AssetDataWithCursorResponse

    Search for assets

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/search \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/assets/search HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/search',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/assets/search',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/assets/search',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/assets/search', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/assets/search")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/assets/search", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/assets/search

    Retrieves a list of assets matching the given criteria. This operation does not support pagination.

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name query string false Prefix and fuzzy search on name. N/A
    description query string false Prefix and fuzzy search on description. N/A
    query query string false Search on name and description using wildcard search on each of the words (separated by spaces). Retrieves results where at least one word must match. Example: 'some other' N/A
    metadata query string false Only include assets that match these metadata fields and values (case-sensitive). Format is {"key1":"value1","key2":"value2"}. N/A
    assetSubtrees query string false Filter out assets that are not in the subtree rooted at these assets. Format is [12,345,6,7890]. N/A
    minCreatedTime query integer(int64) false Filter out assets with createdTime before this. Format is milliseconds since epoch. N/A
    maxCreatedTime query integer(int64) false Filter out assets with createdTime after this. Format is milliseconds since epoch. N/A
    minLastUpdatedTime query integer(int64) false Filter out assets with lastUpdatedTime before this. Format is milliseconds since epoch. N/A
    maxLastUpdatedTime query integer(int64) false Filter out assets with lastUpdatedTime after this. Format is milliseconds since epoch. N/A
    sort query string false field to be sorted. If not specified, results are sorted by relevance score. createdTime,lastUpdatedTime
    dir query string false Sort direction: descending or ascending. Only applicable if sort is specified. Default 'desc'. asc,desc
    limit query integer(int32) false Return up to this many results. Maximum is 1000. Default is 25. Max: 1000
    offset query integer(int32) false Offset from the first result. Sum of limit and offset must not exceed 1000. Default is 0. N/A
    boostName query boolean false Whether or not boosting name field. This option is experimental and can be changed. N/A

    Enumerated Values

    Parameter Value
    sort createdTime
    sort lastUpdatedTime
    dir asc
    dir desc

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "parentId": 0,
            "description": "string",
            "metadata": {},
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "id": 0,
            "path": [
              0
            ],
            "depth": 0
          }
        ]
      }
    }
    
    Status Meaning Description Schema
    200 OK Experimental endpoint. Search on assets. AssetDataResponse

    Time series

    A time series consists of a sequence of data points connected to a single asset.

    For example: A water pump asset can have a temperature time series that records a data point in units of °C every second.

    A single asset can have several time series. The water pump could have additional time series measuring pressure within the pump, rpm, flow volume, power consumption, and more.

    Time series store data points as either number or strings. This is controlled by the is_string flag on the time series object. Numerical data points can be aggregated before they are returned from a query (e.g., to find the average temperature for a day). String data points, on the other hand, cannot be aggregated by CDP, but can store arbitrary information like states (e.g. “open”/”closed”) or more complex information (JSON).

    Cognite stores discrete data points, but the underlying process measured by the data points can vary continuously. When interpolating between data points, we can either assume that each value stays the same until the next measurement, or that it linearly changes between the two measurements. This is controlled by the is_step flag on the time series object. For example, if we estimate the average over a time containing two data points, the average will either be close to the first (is step) or close to the mean of the two (not is step).

    Deprecation warning: In the future, CDP will phase out name as a unique identifier for time series, and instead use a primary key of externalId. Time series names must currently be unique across across all time series in the same project. In version 0.6 of CDP, time series names will no longer be unique.

    Create multiple time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "isString": true,
          "metadata": {},
          "unit": "string",
          "assetId": 0,
          "isStep": true,
          "description": "string",
          "securityCategories": [
            0
          ]
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries

    Creates one or more time series objects in the given project.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "isString": true,
          "metadata": {},
          "unit": "string",
          "assetId": 0,
          "isStep": true,
          "description": "string",
          "securityCategories": [
            0
          ]
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataPostTimeSeriesV2DTO true The time series to create. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Missing required fields. MissingFieldError

    Retrieve a time series

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/timeseries/{id}

    Retrieves the details of an existing time series given a project id and the unique time series identifier generated when the time series was created.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of time series to look up N/A
    includeMetadata query boolean false No description N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A time series object TimeSeriesResponse

    Retrieve multiple time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/byids", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/byids

    Retrieves the details of multiple time series within the same project given the project id and a list of time series ids. Time series are returned in the same order as they appeared in the list of ids in the request.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of time series IDs to retrieve N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK List of time-series matching the ids. TimeSeriesResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update a time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "id": 0,
      "name": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "unit": {
        "set": "string",
        "setNull": true
      },
      "assetId": {
        "set": 0,
        "setNull": true
      },
      "description": {
        "set": "string",
        "setNull": true
      },
      "securityCategories": {
        "add": [
          0
        ],
        "remove": [
          0
        ],
        "set": [
          0
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/{id}/update

    Updates the time series object with the given id. This operation supports partial updates, meaning that fields not specified in the request are left unchanged on the object.

    For primitive fields (String, Long Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    For the Json Array field (e.g. securityCategories), use 'set': [value1, value2] to update value; use 'add': [v1, v2] to add values to current list of values; use 'remove': [v1, v2] to remove these values from current list of values if exist.

    Body parameter

    {
      "id": 0,
      "name": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "unit": {
        "set": "string",
        "setNull": true
      },
      "assetId": {
        "set": 0,
        "setNull": true
      },
      "description": {
        "set": "string",
        "setNull": true
      },
      "securityCategories": {
        "add": [
          0
        ],
        "remove": [
          0
        ],
        "set": [
          0
        ]
      }
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of the time series N/A
    body body TimeSeriesChange true Content of changes N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Corresponding time series after applying the update. TimeSeriesResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update multiple time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "name": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "unit": {
            "set": "string",
            "setNull": true
          },
          "assetId": {
            "set": 0,
            "setNull": true
          },
          "description": {
            "set": "string",
            "setNull": true
          },
          "securityCategories": {
            "add": [
              0
            ],
            "remove": [
              0
            ],
            "set": [
              0
            ]
          }
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/update

    Updates multiple time series objects within a single project at the same time. This operation supports partial updates, meaning that fields not specified in the request are left unchanged on the object.

    For primitive fields (String, Long Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    For the Json Array field (e.g. securityCategories), use 'set': [value1, value2] to update value; use 'add': [v1, v2] to add values to current list of values; use 'remove': [v1, v2] to remove these values from current list of values if exist.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "name": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "unit": {
            "set": "string",
            "setNull": true
          },
          "assetId": {
            "set": 0,
            "setNull": true
          },
          "description": {
            "set": "string",
            "setNull": true
          },
          "securityCategories": {
            "add": [
              0
            ],
            "remove": [
              0
            ],
            "set": [
              0
            ]
          }
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataTimeSeriesChange true List of changes. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Corresponding time series after applying the updates. TimeSeriesResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update all fields of a time series

    Code samples

    # You can also use wget
    curl -X PUT https://api.cognitedata.com/api/0.5/projects/{project}/timeseries \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    PUT https://api.cognitedata.com/api/0.5/projects/{project}/timeseries HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      method: 'put',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "isString": true,
          "metadata": {},
          "unit": "string",
          "assetId": 0,
          "isStep": true,
          "description": "string",
          "securityCategories": [
            0
          ]
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.put('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries")
      .put(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    PUT /api/0.5/projects/{project}/timeseries

    Overwrites all fields of a time series object. This operation does not support partial updates; All fields on the time series object will be overwritten by the supplied values.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "isString": true,
          "metadata": {},
          "unit": "string",
          "assetId": 0,
          "isStep": true,
          "description": "string",
          "securityCategories": [
            0
          ]
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataPostTimeSeriesV2DTO true The time series to update. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Delete a time series

    Code samples

    # You can also use wget
    curl -X DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}',
      method: 'delete',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.delete('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}")
      .delete(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{name}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /api/0.5/projects/{project}/timeseries/{name}

    Deletes a time series object given the time series name and the project name.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name path string true The name of the time series to delete. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    List all time series

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/timeseries

    Retrieves a list of all time series in a project, sorted by name alphabetically. Parameters can be used to select a subset of time series. This operation supports pagination.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    q query string false List time series with this prefix in the name. N/A
    description query string false Filter time series that contains this string in its description. N/A
    limit query integer(int32) false Limit the number of results. Min/Max: 1/10000
    includeMetadata query boolean false Decide if the metadata field should be returned or not. N/A
    cursor query string false Cursor for paging through time series. N/A
    assetId query integer(int64) false Get timeseries related to this asset. N/A
    path query string false Get timeseries under this asset path branch. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of time series in lexicographic order. TimeSeriesCursorResponse

    Search for time series

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/search", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/timeseries/search

    Retrieves a list of time series matching the given criteria. This operation does not support pagination.

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name query string false Prefix and fuzzy search on name. N/A
    description query string false Prefix and fuzzy search on description. N/A
    query query string false Search on name and description using wildcard search on each of the words (separated by spaces). Retrieves results where at least one word must match. Example: 'some other' N/A
    unit query string false Filter on unit (case-sensitive). N/A
    isString query boolean false Filter on isString. N/A
    isStep query boolean false Filter on isStep. N/A
    metadata query string false Filter out timeseries that do not match these metadata fields and values (case-sensitive). Format is {"key1":"value1","key2":"value2"}. N/A
    assetIds query string false Filter out time series that are not linked to any of these assets. Format is [12,345,6,7890]. N/A
    assetSubtrees query string false Filter out time series that are not linked to assets in the subtree rooted at these assets. Format is [12,345,6,7890]. N/A
    minCreatedTime query integer(int64) false Filter out time series with createdTime before this. Format is milliseconds since epoch. N/A
    maxCreatedTime query integer(int64) false Filter out time series with createdTime after this. Format is milliseconds since epoch. N/A
    minLastUpdatedTime query integer(int64) false Filter out time series with lastUpdatedTime before this. Format is milliseconds since epoch. N/A
    maxLastUpdatedTime query integer(int64) false Filter out time series with lastUpdatedTime after this. Format is milliseconds since epoch. N/A
    sort query string false Field to be sorted. If not specified, results are sorted by relevance score. createdTime,lastUpdatedTime
    dir query string false Sort direction: descending or ascending. Only applicable if sort is specified. Default 'desc'. asc,desc
    limit query integer(int32) false Return up to this many results. Maximum is 1000. Default is 25. Max: 1000
    offset query integer(int32) false Offset from the first result. Sum of limit and offset must not exceed 1000. Default is 0. N/A
    boostName query boolean false Whether or not boosting name field. This option is experimental and can be changed. N/A

    Enumerated Values

    Parameter Value
    sort createdTime
    sort lastUpdatedTime
    dir asc
    dir desc

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "isString": true,
            "unit": "string",
            "assetId": 0,
            "isStep": true,
            "description": "string",
            "securityCategories": [
              0
            ],
            "id": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    
    Status Meaning Description Schema
    200 OK Experimental endpoint. Search on time series. TimeSeriesResponse

    Datapoints

    A data point stores a single piece of information, a number or a string, associated with a specific time. Data points are identified by their timestamps, measured in milliseconds since the unix epoch -- 00:00, January 1st, 1970. Milliseconds is the finest time resolution supported by CDP i.e. fractional milliseconds are not supported. Leap seconds are not counted.

    Numerical data points can be aggregated before they are retrieved from CDP. This allows for faster queries by reducing the amount of data transferred. You can aggregate data points by specifying one or more aggregates (e.g. average, minimum, maximum) as well as the time granularity over which the aggregates should be applied (e.g. “1h” for one hour).

    Aggregates are aligned to the start time modulo the granularity unit. For example, if you ask for daily average temperatures since monday afternoon last week, the first aggregated data point will contain averages for monday, the second for tuesday, etc. Determining aggregate alignment without considering data point timestamps allows CDP to pre-calculate aggregates (e.g. to quickly return daily average temperatures for a year). As a consequence, aggregating over 60 minutes can return a different result that aggregating over 1 hour because the two queries will be aligned differently.

    Insert a list of data points

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "timestamp": 0,
          "value": "string"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/{id}/data

    Inserts a list of data points to a time series. If a data point is posted to a timestamp that is already in the series, the existing data point for that timestamp will be overwritten.

    Body parameter

    {
      "items": [
        {
          "timestamp": 0,
          "value": "string"
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of time series to insert to N/A
    body body DataDatapoint true The list of datapoints to insert. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Ids not found. IdsNotFoundResponse

    Insert a list of data points by name

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name} HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "timestamp": 0,
          "value": "string"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/data/{name}

    Inserts a list of data points to a time series. If a data point is posted to a timestamp that is already in the series, the existing data point for that timestamp will be overwritten.

    Body parameter

    {
      "items": [
        {
          "timestamp": 0,
          "value": "string"
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name path string true Name of time series to insert to N/A
    body body DataDatapoint true The list of datapoints to insert. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Insert a list of data points into multiple time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "datapoints": [
            {
              "timestamp": 0,
              "value": "string"
            }
          ]
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/data

    Inserts multiple data points into multiple time series in the same project.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "datapoints": [
            {
              "timestamp": 0,
              "value": "string"
            }
          ]
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataDatapoints true Datapoints to insert. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Retrieve data points from a single time series

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/{id}/data", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/timeseries/{id}/data

    Retrieves a list of data points from a single time series. This operation supports aggregation but not pagination.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true The time-series name to get datapoints from. N/A
    start query integer(int64) false Get datapoints after this time. Format is ms since epoch. N/A
    end query integer(int64) false Get datapoints up to this time. Format is ms since epoch. N/A
    aggregates query string false Get aggregate values for this interval. The format is 'f1,f2,f3' where each entry is an aggregate function. Valid aggregate functions: 'average/avg, max, min, count, sum, interpolation/int, stepinterpolation/step, continuousvariance/cv, discretevariance/dv, totalvariation/tv'. The query parameter 'granularity' must also be specified. Max limit for aggregates is 10000. N/A
    granularity query string false The granularity of the aggregate values. Valid entries are: 'day/d, hour/h, minute/m, second/s', or a multiple of these indicated by a number as a prefix. Example: 12hour. N/A
    limit query integer(int32) false Return up to this number of datapoints. Min/Max: 1/100000
    includeOutsidePoints query boolean false No description N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "timestamp": 0,
            "value": "string"
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of datapoints for the given query. DatapointsResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Ids not found. IdsNotFoundResponse

    Retrieve data points from multiple time series

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "function": "string",
          "name": "string",
          "start": "string",
          "end": "string",
          "limit": 0,
          "aggregates": "string",
          "granularity": "string",
          "includeOutsidePoints": true
        }
      ],
      "start": "string",
      "end": "string",
      "limit": 0,
      "aggregates": "string",
      "granularity": "string",
      "includeOutsidePoints": true
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataquery", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/dataquery

    Retrieves a list of data points from multiple time series in the same project. This operation supports aggregation but not pagination.

    Body parameter

    {
      "items": [
        {
          "function": "string",
          "name": "string",
          "start": "string",
          "end": "string",
          "limit": 0,
          "aggregates": "string",
          "granularity": "string",
          "includeOutsidePoints": true
        }
      ],
      "start": "string",
      "end": "string",
      "limit": 0,
      "aggregates": "string",
      "granularity": "string",
      "includeOutsidePoints": true
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DatapointsMultiQuery true The list of DatapointsQueries to perform. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "datapoints": [
              {}
            ]
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Lists of datapoints for the given queries. MultiDatapointsResponseLegacy
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Retrieve the latest data point in a time series

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/latest/{name}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/timeseries/latest/{name}

    Retrieves the single latest data point in a time series.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name path string true Name of time series N/A
    before query string false Get latest datapoint before this timestamp. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "timestamp": 0,
            "value": "string"
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list containing a single point, the most recent datapoint, or an empty list if no points found. DatapointsResponseLegacy
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found The time series does not exist. ErrorResponse

    Retrieve time-aligned data points

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe \
      -H 'Content-Type: application/json' \
      -H 'Accept: text/csv' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: text/csv
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'text/csv',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "aggregates": [
            "string"
          ]
        }
      ],
      "start": "string",
      "end": "string",
      "limit": 0,
      "aggregates": [
        "string"
      ],
      "granularity": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'text/csv',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'text/csv',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'text/csv',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "text/csv")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"text/csv"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/dataframe", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/timeseries/dataframe

    Retrieves a CSV table of aggregated, time-aligned data points from multiple time series in the same project. This operation uses aggregation to group values from data points in multiple time series to the same timestamps. JSON output is not supported.

    The first column, named “timestamp”, will contain aligned timestamps in milliseconds since the UNIX epoch. Remaining columns will be named on the form “

    You can approximate aligned, raw data with this endpoint by using the interpolation aggregate with one second granularity. If you would like to retrieve raw (unaggregated) data points you can use the postMultiTimeSeries endpoint instead.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "aggregates": [
            "string"
          ]
        }
      ],
      "start": "string",
      "end": "string",
      "limit": 0,
      "aggregates": [
        "string"
      ],
      "granularity": "string"
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DatapointsFrameMultiQuery true The list of DatapointsQueries to perform. N/A

    Example responses

    200 Response

    Responses

    Status Meaning Description Schema
    200 OK A table of datapoints for the given query. DatapointsFrameResponse
    400 Bad Request Bad request. ErrorResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Delete a single data point

    Code samples

    # You can also use wget
    curl -X DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle?timestamp=0 \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle?timestamp=0 HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle',
      method: 'delete',
      data: '?timestamp=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle?timestamp=0',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle',
      params: {
      'timestamp' => 'integer(int64)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.delete('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle', params={
      'timestamp': '0'
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle?timestamp=0")
      .delete(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deletesingle", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /api/0.5/projects/{project}/timeseries/data/{name}/deletesingle

    Deletes a single data point.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name path string true Name of time series to delete from. N/A
    timestamp query integer(int64) true Timestamp of the data point to delete. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Delete a range of multiple data points

    Code samples

    # You can also use wget
    curl -X DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange?timestampInclusiveBegin=0&timestampExclusiveEnd=0 \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    DELETE https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange?timestampInclusiveBegin=0&timestampExclusiveEnd=0 HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange',
      method: 'delete',
      data: '?timestampInclusiveBegin=0&timestampExclusiveEnd=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange?timestampInclusiveBegin=0&timestampExclusiveEnd=0',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange',
      params: {
      'timestampInclusiveBegin' => 'integer(int64)',
    'timestampExclusiveEnd' => 'integer(int64)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.delete('https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange', params={
      'timestampInclusiveBegin': '0',  'timestampExclusiveEnd': '0'
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange?timestampInclusiveBegin=0&timestampExclusiveEnd=0")
      .delete(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.cognitedata.com/api/0.5/projects/{project}/timeseries/data/{name}/deleterange", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /api/0.5/projects/{project}/timeseries/data/{name}/deleterange

    Delete all data points between two timestamps in a single time series.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name path string true Name of time series to delete from. N/A
    timestampInclusiveBegin query integer(int64) true Inclusive begin timestamp of data points to delete. N/A
    timestampExclusiveEnd query integer(int64) true Exclusive end timestamp of data points to delete. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    403 Forbidden Forbidden. ErrorResponse
    404 Not Found Names not found. NamesNotFoundResponse

    Events

    Event objects store complex information about multiple assets over a time period. For example, an event can describe two hours of maintenance on a water pump and some associated pipes, or a future time window where the pump is scheduled for inspection. This is in contrast with data points in time series that store single pieces of information about one asset at specific points in time (e.g., temperature measurements).

    An event’s time period is defined by a start time and end time, both millisecond timestamps since the UNIX epoch. The timestamps can be in the future. Events can also be categorized by a type (e.g, “fault”) and a subtype (e.g., “electrical”), both arbitrary strings defined when creating the event. In addition, events can have a text description as well as arbitrary metadata and properties.

    Create events

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/events \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/events HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "startTime": 0,
          "endTime": 0,
          "description": "string",
          "type": "string",
          "subtype": "string",
          "assetIds": [
            0
          ],
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/events',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/events', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/events", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/events

    Creates multiple event objects in the same project.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "startTime": 0,
          "endTime": 0,
          "description": "string",
          "type": "string",
          "subtype": "string",
          "assetIds": [
            0
          ],
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataEvent true List of events to be posted. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "startTime": 0,
            "endTime": 0,
            "description": "string",
            "type": "string",
            "subtype": "string",
            "assetIds": [
              0
            ],
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The events that were created. EventDataResponse
    400 Bad Request Missing required fields. MissingFieldError

    Retrieve an event

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/events/{eventId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/events/{eventId}

    Retrieves information about an event.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    eventId path integer(int64) true The event ID. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "startTime": 0,
            "endTime": 0,
            "description": "string",
            "type": "string",
            "subtype": "string",
            "assetIds": [
              0
            ],
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Event matching the id. EventDataResponse

    Retrieve multiple events

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/events/byids \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/events/byids HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events/byids',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events/byids',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/events/byids',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/events/byids', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events/byids")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/events/byids", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/events/byids

    Retrieves information about multiple events in the same project. Events are returned in the same order as the ids listed in the query.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of IDs of events to retrieve N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "startTime": 0,
            "endTime": 0,
            "description": "string",
            "type": "string",
            "subtype": "string",
            "assetIds": [
              0
            ],
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK List of events matching the ids. EventDataResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update events

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/events/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/events/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "startTime": 0,
          "endTime": 0,
          "description": "string",
          "type": "string",
          "subtype": "string",
          "assetIds": [
            0
          ],
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/events/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/events/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/events/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/events/update

    Updates multiple events in the same project. This operation does not support partial updates.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "startTime": 0,
          "endTime": 0,
          "description": "string",
          "type": "string",
          "subtype": "string",
          "assetIds": [
            0
          ],
          "source": "string",
          "sourceId": "string",
          "createdTime": 0,
          "lastUpdatedTime": 0
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataEvent true List of events to be updated. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse

    Delete events

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/events/delete \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/events/delete HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events/delete',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events/delete',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/events/delete',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/events/delete', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events/delete")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/events/delete", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/events/delete

    Deletes multiple events in the same project.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of event IDs for the events to be deleted. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Ids duplicated. ErrorResponse

    List all events

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/events \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/events HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/events',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/events', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/events", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/events

    Retrieve a list of all events in the same project. This operation supports pagination by cursor. Criteria can be applied to select a subset of events.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    type query string false Type (class) of event, e.g 'failure'. N/A
    subtype query string false Sub-type of event, e.g 'electrical'. N/A
    assetId query integer(int64) false Return events associated with this assetId. Filtering by assetId disables the parameters 'type', 'subtype', 'hasDescription', 'minStartTime', 'maxStartTime' and 'source'. N/A
    sort query string false Sort descending or ascending. Default 'ASC'. N/A
    cursor query string false Cursor to use for paging through results. N/A
    limit query integer(int32) false Return up to this many results. Maximum is 10000. Default is 25. Max: 10000
    hasDescription query boolean false Return only events that have a textual description. Default null. False gives only those without description. N/A
    minStartTime query integer(int64) false Only return events from after this time. N/A
    maxStartTime query integer(int64) false Only return events from before this time. N/A
    source query string false Returns only events originated from this source. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "startTime": 0,
            "endTime": 0,
            "description": "string",
            "type": "string",
            "subtype": "string",
            "assetIds": [
              0
            ],
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Events matching the query. EventDataWithCursorResponse

    Search for events

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/events/search \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/events/search HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/events/search',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/events/search',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/events/search',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/events/search', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/events/search")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/events/search", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/events/search

    Retrieves a list of events in the same project matching the given criteria. This operation has limited pagination support with an offset parameter, but does not allow retrieving all events in a project.

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    description query string false Prefix and fuzzy search on description. N/A
    type query string false Filter on type (case-sensitive). N/A
    subtype query string false Filter on subtype (case-sensitive). N/A
    minStartTime query integer(int64) false Filter out events with startTime before this. Format is milliseconds since epoch. N/A
    maxStartTime query integer(int64) false Filter out events with startTime after this. Format is milliseconds since epoch. N/A
    minEndTime query integer(int64) false Filter out events with endTime before this. Format is milliseconds since epoch. N/A
    maxEndTime query integer(int64) false Filter out events with endTime after this. Format is milliseconds since epoch. N/A
    minCreatedTime query integer(int64) false Filter out events with createdTime before this. Format is milliseconds since epoch. N/A
    maxCreatedTime query integer(int64) false Filter out events with createdTime after this. Format is milliseconds since epoch. N/A
    minLastUpdatedTime query integer(int64) false Filter out events with lastUpdatedTime before this. Format is milliseconds since epoch. N/A
    maxLastUpdatedTime query integer(int64) false Filter out events with lastUpdatedTime after this. Format is milliseconds since epoch. N/A
    metadata query string false Filter out events that do not match these metadata fields and values (case-sensitive). Format is {"key1":"value1","key2":"value2"}. N/A
    assetIds query string false Filter out events that are not linked to any of these assets. Format is [12,345,6,7890]. N/A
    assetSubtrees query string false Filter out events that are not linked to assets in the subtree rooted at these assets. Format is [12,345,6,7890]. N/A
    sort query string false Field to be sorted. If not specified, results are sorted by relevance score. startTime,endTime,createdTime,lastUpdatedTime
    dir query string false Sort direction: descending or ascending. Only applicable if sort is specified. Default 'desc'. asc,desc
    limit query integer(int32) false Return up to this many results. Maximum is 1000. Default is 25. Max: 1000
    offset query integer(int32) false Offset from the first result. Sum of limit and offset must not exceed 1000. Default is 0. N/A

    Enumerated Values

    Parameter Value
    sort startTime
    sort endTime
    sort createdTime
    sort lastUpdatedTime
    dir asc
    dir desc

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "startTime": 0,
            "endTime": 0,
            "description": "string",
            "type": "string",
            "subtype": "string",
            "assetIds": [
              0
            ],
            "source": "string",
            "sourceId": "string",
            "createdTime": 0,
            "lastUpdatedTime": 0
          }
        ]
      }
    }
    
    Status Meaning Description Schema
    200 OK Experimental endpoint. Search on events. EventDataResponse

    Files

    A file stores a sequence of bytes connected to one or more assets. For example, a file can contain a piping and instrumentation diagram (P&IDs) showing how multiple assets are connected.

    Each file is identified by a unique ID that is generated when it is a created, as well as a name and a directory path. File names are limited to 256 bytes, and directory paths to 512. The combination of file name and directory path must be unique within a project.

    Directories in CDP differ from ones in normal file systems; They exist only as string attributes on individual file objects. This means that directories themselves cannot be created, deleted, or moved. There is no particular path separator, and no notion of a directory hierarchy.

    Files are created in two steps; First the metadata is stored in a file object, and then the file contents are uploaded. This means that files can exist in a non-uploaded state.

    Upload a file

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'X-Upload-Content-Type: string' \
      -H 'Origin: string' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    X-Upload-Content-Type: string
    Origin: string
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'X-Upload-Content-Type':'string',
      'Origin':'string',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "id": 0,
      "fileName": "string",
      "directory": "string",
      "source": "string",
      "sourceId": "string",
      "fileType": "string",
      "assetIds": [
        0
      ],
      "uploadedAt": 0,
      "createdTime": 0,
      "lastUpdatedTime": 0,
      "isUploaded": true
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'X-Upload-Content-Type':'string',
      'Origin':'string',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'X-Upload-Content-Type' => 'string',
      'Origin' => 'string',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'X-Upload-Content-Type': 'string',
      'Origin': 'string',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("X-Upload-Content-Type", "string")
      .header("Origin", "string")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "X-Upload-Content-Type": []string{"string"},
            "Origin": []string{"string"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files/initupload", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files/initupload

    Stores the given metadata in a file object and returns an URL for uploading the file contents. Immediately after this operation, the client must issue a PUT request to the returned URL with the contents of the file. The upload link can only be used once and will expire if not used.

    File uploads can be resumable (see https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload). Resumable links (the default) expire after one week. Non-resumable links expire after 30 seconds.

    Body parameter

    {
      "id": 0,
      "fileName": "string",
      "directory": "string",
      "source": "string",
      "sourceId": "string",
      "fileType": "string",
      "assetIds": [
        0
      ],
      "uploadedAt": 0,
      "createdTime": 0,
      "lastUpdatedTime": 0,
      "isUploaded": true
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    X-Upload-Content-Type header string false The content type of the file to be uploaded. N/A
    Origin header string false Origin for Cross Origin Resource Sharing. This field is required in resumable upload if there is a Cross Origin issue N/A
    resumable query boolean false Whether to generate a resumable URL or not. Default is true. N/A
    overwrite query boolean false Whether to overwrite existing data if duplicate or not. Default is false. If true, metadata will be overwritten; actual file will be overwritten after successfully uploading. If there is no successful upload, current file will not change. File-Asset mappings only change if explicitly stated in assetIds field of json body. DO NOT set assetIds if want to keep current file-asset mappings. N/A
    body body FileInfo true Specify the content-type of upload file. In case of non-resumable upload, when setting content-type of file, the client MUST provide HTTP header 'Content-Type' (in upload request) set to the same value. N/A

    Example responses

    200 Response

    {
      "data": {
        "fileId": 0,
        "uploadURL": "string"
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Upload URL and file ID. URLResponse
    400 Bad Request Missing required fields. MissingFieldError

    Download a file’s contents

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/downloadlink", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/files/{id}/downloadlink

    Returns a download link for downloading the contents of a file. After getting the download link, the client then has to issue a GET request to the returned URL which will respond with the contents of the file. The link will expire after 30 seconds.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of the file to download. N/A

    Example responses

    200 Response

    {
      "data": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Download link. SingleStringResponse

    Retrieve a file’s metadata

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/files/{id} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/files/{id} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/files/{id}

    Retrieves information about a file object. This operation does not return file contents.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of the file. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "fileName": "string",
            "directory": "string",
            "source": "string",
            "sourceId": "string",
            "fileType": "string",
            "assetIds": [
              0
            ],
            "uploadedAt": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "isUploaded": true
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Get file information FileResponse

    Retrieve multiple files’ metadata

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files/byids \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files/byids HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/byids',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/byids',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files/byids',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files/byids', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/byids")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files/byids", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files/byids

    Retrieves information about multiple files in the same project. Results are returned in the same order as in the query. This operation does not return file contents.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of IDs of files to retrieve N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "fileName": "string",
            "directory": "string",
            "source": "string",
            "sourceId": "string",
            "fileType": "string",
            "assetIds": [
              0
            ],
            "uploadedAt": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "isUploaded": true
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK List of files matching the ids. FileResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Update a file’s metadata

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "id": 0,
      "fileName": {
        "set": "string",
        "setNull": true
      },
      "directory": {
        "set": "string",
        "setNull": true
      },
      "fileType": {
        "set": "string",
        "setNull": true
      },
      "source": {
        "set": "string",
        "setNull": true
      },
      "sourceId": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "assetIds": {
        "add": [
          0
        ],
        "remove": [
          0
        ],
        "set": [
          0
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files/{id}/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files/{id}/update

    Update information about a file. This operation supports partial updates; Fields omitted from the query are left unchanged.

    For primitive fields (String, Long, Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    For the Json Array field (e.g. assetIds), use 'set': [value1, value2] to update value; use 'add': [v1, v2] to add values to current list of values; use 'remove': [v1, v2] to remove these values from current list of values if exists.

    Body parameter

    {
      "id": 0,
      "fileName": {
        "set": "string",
        "setNull": true
      },
      "directory": {
        "set": "string",
        "setNull": true
      },
      "fileType": {
        "set": "string",
        "setNull": true
      },
      "source": {
        "set": "string",
        "setNull": true
      },
      "sourceId": {
        "set": "string",
        "setNull": true
      },
      "metadata": {
        "set": {},
        "setNull": true
      },
      "assetIds": {
        "add": [
          0
        ],
        "remove": [
          0
        ],
        "set": [
          0
        ]
      }
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    id path integer(int64) true Id of the file N/A
    body body FileChange true content of changes N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "fileName": "string",
            "directory": "string",
            "source": "string",
            "sourceId": "string",
            "fileType": "string",
            "assetIds": [
              0
            ],
            "uploadedAt": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "isUploaded": true
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Corresponding file after applying the update. FileResponse
    400 Bad Request Ids duplicated. ErrorResponse
    404 Not Found Ids not found. IdsNotFoundResponse

    Update multiple files’ metadata

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files/update \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files/update HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/update',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "fileName": {
            "set": "string",
            "setNull": true
          },
          "directory": {
            "set": "string",
            "setNull": true
          },
          "fileType": {
            "set": "string",
            "setNull": true
          },
          "source": {
            "set": "string",
            "setNull": true
          },
          "sourceId": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "assetIds": {
            "add": [
              0
            ],
            "remove": [
              0
            ],
            "set": [
              0
            ]
          }
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/update',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files/update',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files/update', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/update")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files/update", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files/update

    Updates information about multiple files in the same project. This operation does not alter file contents, and partial updates are supported.

    For primitive fields (String, Long, Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.

    For the Json Array field (e.g. assetIds), use 'set': [value1, value2] to update value; use 'add': [v1, v2] to add values to current list of values; use 'remove': [v1, v2] to remove these values from current list of values if exists.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "fileName": {
            "set": "string",
            "setNull": true
          },
          "directory": {
            "set": "string",
            "setNull": true
          },
          "fileType": {
            "set": "string",
            "setNull": true
          },
          "source": {
            "set": "string",
            "setNull": true
          },
          "sourceId": {
            "set": "string",
            "setNull": true
          },
          "metadata": {
            "set": {},
            "setNull": true
          },
          "assetIds": {
            "add": [
              0
            ],
            "remove": [
              0
            ],
            "set": [
              0
            ]
          }
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataFileChange true List of changes. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Ids duplicated. ErrorResponse

    Delete multiple files

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files/delete \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files/delete HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/delete',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/delete',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files/delete',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files/delete', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/delete")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files/delete", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files/delete

    Deletes the files with the given ids.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of IDs of files to delete. N/A

    Example responses

    200 Response

    {
      "data": {
        "property1": [
          0
        ],
        "property2": [
          0
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The name of the deleted files and the files that failed to delete. DeleteFilesResponse
    400 Bad Request Ids duplicated. ErrorResponse

    List all files

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/files \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/files HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/files',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/files', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/files", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/files

    Retrieves a list with information about all files in a project. Criteria can be supplied to select a subset of files. This operation supports pagination with cursors.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    assetId query integer(int64) false Returns all files associated with this assetId. N/A
    dir query string false Directory to list files from. N/A
    name query string false List all files with this name. N/A
    type query string false Type of files to list. N/A
    source query string false List files coming from this source. N/A
    isUploaded query boolean false List only uploaded files if true. If false, list only other files. If not set, list all files without considering whether they are uploaded or not. N/A
    limit query integer(int32) false Return up to this many results. Default is 25. N/A
    sort query string false Sort descending or ascending. Default 'DESC' - Show recently uploaded files first. ASC,DESC
    cursor query string false Cursor to use for paging through results. N/A

    Enumerated Values

    Parameter Value
    sort ASC
    sort DESC

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "fileName": "string",
            "directory": "string",
            "source": "string",
            "sourceId": "string",
            "fileType": "string",
            "assetIds": [
              0
            ],
            "uploadedAt": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "isUploaded": true
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of files with file info and cursors. FileWithCursorResponse

    Search for files

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/files/search \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/files/search HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files/search',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files/search',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/files/search',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/files/search', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files/search")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/files/search", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/files/search

    Retrieves a list with information about files matching the given criteria. This operation supports limited pagination with the offset parameter, but does not support retrieving all files in a project.

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    name query string false Prefix and fuzzy search on file name. N/A
    directory query string false Filter on directory (case-sensitive). N/A
    type query string false Filter on file type (case-sensitive). N/A
    uploaded query boolean false Filter on upload status. N/A
    minUploadedAt query integer(int64) false Filter out files uploaded before this. Format is milliseconds since epoch. N/A
    maxUploadedAt query integer(int64) false Filter out files uploaded after this. Format is milliseconds since epoch. N/A
    minCreatedTime query integer(int64) false Filter out files with createdTime before this. Format is milliseconds since epoch. N/A
    maxCreatedTime query integer(int64) false Filter out files with createdTime after this. Format is milliseconds since epoch. N/A
    minLastUpdatedTime query integer(int64) false Filter out files with lastUpdatedTime before this. Format is milliseconds since epoch. N/A
    maxLastUpdatedTime query integer(int64) false Filter out files with lastUpdatedTime after this. Format is milliseconds since epoch. N/A
    metadata query string false Filter out files that do not match these metadata fields and values (case-sensitive). Format is {"key1":"value1","key2":"value2"}. N/A
    assetIds query string false Filter out files that are not linked to any of these assets. Format is [12,345,6,7890]. N/A
    assetSubtrees query string false Filter out files that are not linked to assets in the subtree rooted at these assets. Format is [12,345,6,7890]. N/A
    sort query string false Field to be sorted. If not specified, results are sorted by relevance score. createdTime,lastUpdatedTime
    dir query string false Sort direction: descending or ascending. Only applicable if sort is specified. Default 'desc'. asc,desc
    limit query integer(int32) false Return up to this many results. Maximum is 1000. Default is 25. Max: 1000
    offset query integer(int32) false Offset from the first result. Sum of limit and offset must not exceed 1000. Default is 0. N/A

    Enumerated Values

    Parameter Value
    sort createdTime
    sort lastUpdatedTime
    dir asc
    dir desc

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "id": 0,
            "fileName": "string",
            "directory": "string",
            "source": "string",
            "sourceId": "string",
            "fileType": "string",
            "assetIds": [
              0
            ],
            "uploadedAt": 0,
            "createdTime": 0,
            "lastUpdatedTime": 0,
            "isUploaded": true
          }
        ]
      }
    }
    
    Status Meaning Description Schema
    200 OK Experimental endpoint. Search on files. FileResponse

    Replace multiple files’ metadata

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/files \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/files HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/files',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "id": 0,
          "fileName": "string",
          "directory": "string",
          "source": "string",
          "sourceId": "string",
          "fileType": "string",
          "assetIds": [
            0
          ],
          "uploadedAt": 0,
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "isUploaded": true
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/files',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/files',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/files', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/files")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/files", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/files

    Updates information about multiple files. This operation does not support partial updates, but replaces all fields in the file object.

    Body parameter

    {
      "items": [
        {
          "id": 0,
          "fileName": "string",
          "directory": "string",
          "source": "string",
          "sourceId": "string",
          "fileType": "string",
          "assetIds": [
            0
          ],
          "uploadedAt": 0,
          "createdTime": 0,
          "lastUpdatedTime": 0,
          "isUploaded": true
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataFileInfo true List of file IDs and corresponding meta data and assetIds. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse
    400 Bad Request Ids duplicated. ErrorResponse

    API Keys

    An API key is a secret string that grants a user access to a project when making requests to the API. Each API key connects exactly one user to one project. A single user can have multiple API keys for the same project.

    Create API keys

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/apikeys \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/apikeys HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "userId": 0
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/apikeys")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/apikeys", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/apikeys

    Creates one API key for each of the given user IDs.

    Body parameter

    {
      "items": [
        {
          "userId": 0
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataApiKeyRequest true List of api keys to create. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          null
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of the created api keys. NewApiKeyResponse
    400 Bad Request Missing required fields. MissingFieldError

    Delete API keys

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/apikeys/delete", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/apikeys/delete

    Deletes one or more API keys with the given API key IDs. The key IDs were returned when the keys were created, or can be obtained by listing all API Keys.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of ids of api keys to delete. N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse

    List all API Keys

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/apikeys \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/apikeys HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/apikeys',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/apikeys', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/apikeys")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/apikeys", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/apikeys

    Retrieves a list of all API Keys connected to the current user in a given project. Administrators can optionally list keys for either a specific user or all users.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    all query boolean false Whether to get api keys for all users, only available to admin users. N/A
    userId query integer(int64) false Get api keys for a specific user, only available to admin users. N/A
    includeDeleted query boolean false Whether to include deleted api keys N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          null
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of api keys. ApiKeyResponse

    Analytics

    Cognite offers a set of services that make it faster to do machine learning on data in the Cognite Data Platform.

    Most of the services we provide are asynchronous. There are two types of services available.

    One service allows you to do pattern search. A pattern search returns a jobId, and the jobId can be used to retrieve the current status of the job. When a pattern search is complete, you can send a new request to retrieve the result of it.

    The other type of services allows you to train a model and make use of it. A typical work flow is:

    Launch a pattern search job

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Api-Key: string' \
      -H 'Accept: string' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    Api-Key: string
    Accept: string
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'Api-Key':'string',
      'Accept':'string',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "timeSeriesDataSpec": [
        {
          "timeSeries": [
            {
              "name": "string",
              "aggregates": [],
              "missingDataStrategy": "ffill"
            }
          ],
          "aggregates": [
            "string"
          ],
          "granularity": "string",
          "missingDataStrategy": "ffill",
          "start": "string",
          "end": "string",
          "label": "string"
        }
      ],
      "description": "string",
      "algorithm": "DTW",
      "arguments": {
        "limit": 5,
        "minRange": "string",
        "maxRange": "string"
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'Api-Key':'string',
      'Accept':'string',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'Api-Key' => 'string',
      'Accept' => 'string',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'Api-Key': 'string',
      'Accept': 'string',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("Api-Key", "string")
      .header("Accept", "string")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "Api-Key": []string{"string"},
            "Accept": []string{"string"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/search", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/analytics/patternsearch/search

    It is often useful to search over patterns in timeseries. For example, if there is an operational incident affecting the sensor values, then one might want to search in other timeseries to look for similar timeseries patterns. This endpoint launches a job to search for patterns.

    Body parameter

    {
      "timeSeriesDataSpec": [
        {
          "timeSeries": [
            {
              "name": "string",
              "aggregates": [],
              "missingDataStrategy": "ffill"
            }
          ],
          "aggregates": [
            "string"
          ],
          "granularity": "string",
          "missingDataStrategy": "ffill",
          "start": "string",
          "end": "string",
          "label": "string"
        }
      ],
      "description": "string",
      "algorithm": "DTW",
      "arguments": {
        "limit": 5,
        "minRange": "string",
        "maxRange": "string"
      }
    }
    
    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    Api-Key header string false No description N/A
    Accept header string false No description N/A
    body body PatternSearchInput true Input data to search on N/A

    Example responses

    200 Response

    {
      "jobId": 0
    }
    
    Status Meaning Description Schema
    200 OK Job Id JobIdResponseDTO
    400 Bad Request Missing required fields. MissingFieldError

    Retrieve information about a job

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/analytics/jobs/{jobId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/analytics/jobs/{jobId}

    Get information about a job. This is useful, e.g., to see if a job is running or if it is done.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    jobId path integer(int64) true JobId to get information from. N/A

    Example responses

    200 Response

    {
      "createdTime": 0,
      "completedTime": 0,
      "description": "string",
      "id": 0,
      "project": "string",
      "service": "string",
      "status": "DONE"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Job information DataJobInfo

    Retrieve pattern search result

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId} \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId} HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/analytics/patternsearch/{jobId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/analytics/patternsearch/{jobId}

    Retrieves the result of a patternSearch job.

    The patternSearch endpoint launches a job, and when the job is complete you can view the result of the patternSearch job at the getPatternSearchResult endpoint.

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    jobId path integer(int64) true The jobId returned from using patternSearch N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "from": 0,
            "to": 0,
            "score": 0
          }
        ]
      }
    }
    
    Status Meaning Description Schema
    200 OK A patternSearch response object PatternSearchResponse

    Groups

    Groups control which resources users can access. Each group has a set of permissions. A user has all the permissions of all the groups that user is a member of. Users can only be granted permissions through group membership.

    A permission grants one or more access types (READ, WRITE, ADMIN, or RAW_READ). Optionally, permissions can be limited to some assets in the asset hierarchy (and their descendants). If a permission is not limited to some assets, it grants access to all assets. For example, a READ permission to a water pump asset lets users in groups with that permission retrieve data points from all the sensors on the pump.

    A permission can optionally be connected to a set of security categories. Security categories hide assets from all users except those that have permissions explicitly granting access to that security category. This allows e.g. stock sensitive data to be hidden from most users by default.

    Create groups

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/groups \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/groups HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/groups',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        {
          "name": "string",
          "source": "string",
          "sourceId": "string",
          "permissions": {
            "accessTypes": [
              "READ"
            ],
            "assetIds": [
              0
            ],
            "securityCategoryIds": [
              0
            ]
          }
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/groups',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/groups',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/groups', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/groups")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/groups", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/groups

    Creates one or more named groups, each with a set of permissions.

    Body parameter

    {
      "items": [
        {
          "name": "string",
          "source": "string",
          "sourceId": "string",
          "permissions": {
            "accessTypes": [
              "READ"
            ],
            "assetIds": [
              0
            ],
            "securityCategoryIds": [
              0
            ]
          }
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataGroupSpec true List of groups to create. N/A

    Example responses

    400 Response

    {
      "code": 0,
      "message": "string",
      "extra": {},
      "missingFields": [
        {}
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of the created groups. None
    400 Bad Request Missing required fields. MissingFieldError

    Delete groups

    Code samples

    # You can also use wget
    curl -X POST https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    POST https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete HTTP/1.1
    Host: api.cognitedata.com
    Content-Type: application/json
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "items": [
        0
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.post('https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    String json = <body parameter>;
    RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json);
    
    Request request = new Request.Builder()
      .header("Content-Type", "application/json")
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete")
      .post(body)
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.cognitedata.com/api/0.5/projects/{project}/groups/delete", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/0.5/projects/{project}/groups/delete

    Deletes the groups with the given IDs.

    Body parameter

    {
      "items": [
        0
      ]
    }
    

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    body body DataLong true List of group ids to delete N/A

    Example responses

    200 Response

    {}
    

    Responses

    Status Meaning Description Schema
    200 OK Empty response. EmptyResponse

    List groups

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/groups \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/groups HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/groups',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/groups',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'api-key' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.cognitedata.com/api/0.5/projects/{project}/groups',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'api-key': 'API_KEY'
    }
    
    r = requests.get('https://api.cognitedata.com/api/0.5/projects/{project}/groups', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .header("Accept", "application/json")
      .header("api-key", "API_KEY")
      .url("https://api.cognitedata.com/api/0.5/projects/{project}/groups")
      .build();
    
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "api-key": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.cognitedata.com/api/0.5/projects/{project}/groups", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/0.5/projects/{project}/groups

    Retrieves a list of groups the current user is a member of. Admin users can optionally use the all flag to list all groups in a project.

    Parameters

    Parameter In Type Required Description Restrictions
    project path string true Project name. N/A
    all query boolean false Whether to get all groups, only available to admin users. N/A

    Example responses

    200 Response

    {
      "data": {
        "items": [
          {
            "name": "string",
            "source": "string",
            "sourceId": "string",
            "permissions": {
              "accessTypes": [],
              "assetIds": [],
              "securityCategoryIds": []
            },
            "id": 0,
            "isDeleted": true,
            "deletedTime": 0
          }
        ]
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK A list of security groups. GroupResponse

    List users in a group

    Code samples

    # You can also use wget
    curl -X GET https://api.cognitedata.com/api/0.5/projects/{project}/groups/{groupId}/users \
      -H 'Accept: application/json' \
      -H 'api-key: API_KEY' \
    
    
    GET https://api.cognitedata.com/api/0.5/projects/{project}/groups/{groupId}/users HTTP/1.1
    Host: api.cognitedata.com
    Accept: application/json
    api-key: API_KEY
    
    
    var headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.cognitedata.com/api/0.5/projects/{project}/groups/{groupId}/users',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'api-key':'API_KEY'
    
    };
    
    fetch('https://api.cognitedata.com/api/0.5/projects/{project}/groups/{groupId}/users',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function