GraphQL API
Make your first authenticated request to the Raster GraphQL API.
The Raster GraphQL API gives you read and write access to your libraries from outside the Raster app. A single endpoint serves every query and mutation, and every request authenticates with an API key or an OAuth access token. A key belongs to one organization.
The GraphQL API is in Alpha. Queries, fields, and behavior may change before the Beta release. Every change is listed in the changelog.
The endpoint
All requests are POST requests to a single URL:
https://api.raster.app/Requests must use HTTPS and include a valid API key or OAuth access token. Plain HTTP requests and unauthenticated requests are rejected. Authentication explains how to create a key.
Quickstart
To confirm your key works, list the assets in a library.
Create an API key
In your organization settings, generate a key and enable Read access for at least one library. Full instructions are in Authentication.
Send your first query
Replace <API_KEY> with your key, and the organization and library IDs with
your own:
curl --request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--url 'https://api.raster.app/' \
--data '{"query": "query Assets { assets(organizationId: \"acme-co\", libraryId: \"barcelona\") { id name url } }"}'Read the response
A successful request returns a JSON object with a data field:
{
"data": {
"assets": [
{ "id": "asset-123", "name": "Sagrada Família", "url": "https://cdn.raster.app/..." }
]
}
}Finding your IDs
Both organizationId and libraryId are the human-readable slugs from the
Raster app. The organization ID is the slug in your URL right after
raster.app/. The library ID is the library's slug, visible in the URL when the
library is open.