JavaScript SDK
const [sequence1, sequence2] = await client.sequences.retrieve([{id: 123}, {externalId: 'abc'}]);res = client.sequences.retrieve(id=1)
res = client.sequences.retrieve()
res = client.sequences.retrieve_multiple(ids=[1, 2, 3])
res = client.sequences.retrieve_multiple(external_ids=["abc", "def"])List<SequenceMetadata> retrievedByExternalIds = client.sequences().retrieve("10");//by varargs of String
List<Item> listItemsExternalIds = List.of(Item.newBuilder().setExternalId("10").build());
List<SequenceMetadata> retrievedSequencesExternalIds = client.sequences().retrieve(listItemsExternalIds);//by list of items
List<SequenceMetadata> retrievedByInternalIds = client.sequences().retrieve(10, 20);//by varargs of Long
List<Item> listItemsInternalIds = List.of(Item.newBuilder().setId(10).build());
List<SequenceMetadata> retrievedSequencesInternalIds = client.sequences().retrieve(listItemsInternalIds);curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": 4503599627370496
}
],
"ignoreUnknownIds": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'id' => 4503599627370496
]
],
'ignoreUnknownIds' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": 4503599627370496\n }\n ],\n \"ignoreUnknownIds\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": 4503599627370496\n }\n ],\n \"ignoreUnknownIds\": false\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 1,
"columns": [
{
"valueType": "DOUBLE",
"createdTime": 100000000000,
"lastUpdatedTime": 100000000000,
"name": "depth",
"externalId": "DPS1",
"description": "Optional description",
"metadata": {
"extracted-by": "cognite"
}
}
],
"createdTime": 100000000000,
"lastUpdatedTime": 100000000000,
"name": "Any relevant name",
"description": "Optional description",
"assetId": 1221123111,
"externalId": "my.known.id",
"metadata": {
"extracted-by": "cognite"
},
"dataSetId": 2718281828459
}
]
}Retrieve sequences
Required capabilities:
sequencesAcl:READ
Retrieves one or more sequences by ID or external ID. The response returns the sequences in the same order as in the request.
POST
/
sequences
/
byids
JavaScript SDK
const [sequence1, sequence2] = await client.sequences.retrieve([{id: 123}, {externalId: 'abc'}]);res = client.sequences.retrieve(id=1)
res = client.sequences.retrieve()
res = client.sequences.retrieve_multiple(ids=[1, 2, 3])
res = client.sequences.retrieve_multiple(external_ids=["abc", "def"])List<SequenceMetadata> retrievedByExternalIds = client.sequences().retrieve("10");//by varargs of String
List<Item> listItemsExternalIds = List.of(Item.newBuilder().setExternalId("10").build());
List<SequenceMetadata> retrievedSequencesExternalIds = client.sequences().retrieve(listItemsExternalIds);//by list of items
List<SequenceMetadata> retrievedByInternalIds = client.sequences().retrieve(10, 20);//by varargs of Long
List<Item> listItemsInternalIds = List.of(Item.newBuilder().setId(10).build());
List<SequenceMetadata> retrievedSequencesInternalIds = client.sequences().retrieve(listItemsInternalIds);curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": 4503599627370496
}
],
"ignoreUnknownIds": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'id' => 4503599627370496
]
],
'ignoreUnknownIds' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": 4503599627370496\n }\n ],\n \"ignoreUnknownIds\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://{cluster}.cognitedata.com/api/v1/projects/{project}/sequences/byids")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": 4503599627370496\n }\n ],\n \"ignoreUnknownIds\": false\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 1,
"columns": [
{
"valueType": "DOUBLE",
"createdTime": 100000000000,
"lastUpdatedTime": 100000000000,
"name": "depth",
"externalId": "DPS1",
"description": "Optional description",
"metadata": {
"extracted-by": "cognite"
}
}
],
"createdTime": 100000000000,
"lastUpdatedTime": 100000000000,
"name": "Any relevant name",
"description": "Optional description",
"assetId": 1221123111,
"externalId": "my.known.id",
"metadata": {
"extracted-by": "cognite"
},
"dataSetId": 2718281828459
}
]
}Authorizations
oidc-tokenoauth2-client-credentialsoauth2-open-industrial-dataoauth2-auth-code
Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.
Body
application/json
Ids of the sequences
Response
200 - application/json
Response with the requested sequences.
Show child attributes
Show child attributes
Last modified on July 10, 2026
Was this page helpful?
⌘I