Queries
Read assets, libraries, and tags from your Raster organization.
Queries read data from Raster. Every query is a POST request to
https://api.raster.app/ and needs an API key or OAuth access token with at
least Read access to the libraries it touches.
assets
Retrieves a paginated list of assets from a library.
Parameters
Prop
Type
Returns
An array of Asset objects.
Example
query {
assets(
organizationId: "acme-co"
libraryId: "barcelona"
page: 1
pageSize: 20
tags: ["landscape", "nature"]
) {
id
name
type
url
tags
}
}The API checks your key and its library access before it fetches anything. If
the key is not authorized for the library, the query fails with an
API_KEY_NOT_AUTHORIZED_FOR_LIBRARY error.
asset
Retrieves a single Asset by id from a library. Use it to
read one asset's metadata when you already have its id.
Parameters
Prop
Type
Returns
A single Asset. A missing asset, an asset in a different
library, and a trashed asset all fail with the same 404 (RESOURCE_NOT_FOUND).
Example
query {
asset(organizationId: "acme-co", libraryId: "barcelona", assetId: "asset-123") {
id
name
url
tags
description
}
}searchAssets
Searches assets across the libraries your credential can reach and returns hits
ranked by relevance, with optional highlighted snippets. A search covers one
organization, and the libraries parameter selects which of its authorized
libraries to search.
Parameters
Prop
Type
Returns
A SearchResult. See also SearchHit.
Example
query {
searchAssets(
organizationId: "acme-co"
q: "sunset"
libraries: ["barcelona", "lisbon"]
page: 1
pageSize: 10
) {
hits {
id
name
url
libraryId
score
highlights {
name
tags
}
}
found
page
}
}libraries
Retrieves a paginated list of libraries in an organization.
Parameters
Prop
Type
Returns
An array of Library objects.
Example
query {
libraries(organizationId: "acme-co", page: 1, pageSize: 10) {
id
name
assetsCount
trashCount
tags {
id
count
type
}
}
}tags
Retrieves the tags used in a library, sorted by usage count (descending).
Parameters
Prop
Type
Returns
An array of Tag objects.
Example
query {
tags(organizationId: "acme-co", libraryId: "barcelona", limit: 10) {
id
count
type
}
}viewer
Resolves the organizations and libraries your credential (an API key or an
OAuth access token) can act on. Call it first when you have only a credential
and need the organizationId and authorized library ids for every other query
and mutation.
Parameters
None.
Returns
Prop
Type
Example
query {
viewer {
organizationId
organizationName
plan
libraries {
library
access
}
user {
name
}
}
}photos (deprecated)
Deprecated. Use assets instead. photos remains for backward
compatibility and may be removed in a future release.
Retrieves a list of assets from a library, with a fixed page size of 500 items.
Parameters
Prop
Type
Returns
An array of Asset objects, the same type assets returns.
Example
query {
photos(organizationId: "acme-co", libraryId: "barcelona", page: 0) {
id
name
url
created
updated
}
}