Skip to content

REST API Reference

The Sprites REST API allows you to manage Sprites programmatically via HTTP requests.

https://api.sprites.dev

All API requests require authentication via Bearer token:

Terminal window
curl -H "Authorization: Bearer $SPRITE_TOKEN" \
https://api.sprites.dev/v1/sprites

Create a token at sprites.dev/account, or generate one via the CLI or SDK:

Terminal window
# Via CLI (stores in config)
sprite org auth
# View token (after disabling keyring)
sprite org keyring disable
cat ~/.sprites/sprites.json | grep api_token

Or programmatically:

const token = await SpritesClient.createToken(flyMacaroon, orgSlug);
POST/v1/sprites
Create a new Sprite.
GET/v1/sprites
List all Sprites for the authenticated organization.
GET/v1/sprites/:name
Get details for a specific Sprite.
PUT/v1/sprites/:name
Update Sprite settings. Only url_settings is supported.
DELETE/v1/sprites/:name
Delete a Sprite and all associated resources.
GET/v1/sprites/:name/check
Check if a Sprite is healthy and responding.
POST/v1/sprites/:name/upgrade
Upgrade a Sprite to the latest configuration.
GET/v1/organization
Get info for the organization that owns the authenticated token.

Requests to /v1/sprites/:name/* are proxied to the Sprite’s environment.

GET/v1/sprites/:name/*
The request is forwarded to the Sprite, and the response is returned.

Errors return appropriate HTTP status codes with JSON bodies:

{
"error": "sprite not found"
}

Validation errors return a list:

{
"errors": ["invalid wait_for_capacity parameter"]
}
200Success
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
422Unprocessable Entity
429Too Many Requests
500Internal Server Error

List endpoints support pagination:

Terminal window
# First page
curl -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites?max_results=10"
# Response includes continuation token
# {
# "sprites": [...],
# "has_more": true,
# "next_continuation_token": "abc123"
# }
# Next page
curl -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites?max_results=10&continuation_token=abc123"
Terminal window
# Create sprite
curl -X POST \
-H "Authorization: Bearer $SPRITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "api-test"
}' \
https://api.sprites.dev/v1/sprites
# Make URL public
curl -X PUT \
-H "Authorization: Bearer $SPRITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url_settings": {"auth": "public"}}' \
https://api.sprites.dev/v1/sprites/api-test
# Check health
curl -H "Authorization: Bearer $SPRITE_TOKEN" \
https://api.sprites.dev/v1/sprites/api-test/check
#!/bin/bash
TOKEN="$SPRITE_TOKEN"
BASE_URL="https://api.sprites.dev/v1/sprites"
CONTINUATION=""
while true; do
if [ -z "$CONTINUATION" ]; then
RESPONSE=$(curl -s -H "Authorization: Bearer $TOKEN" "$BASE_URL?max_results=50")
else
RESPONSE=$(curl -s -H "Authorization: Bearer $TOKEN" "$BASE_URL?max_results=50&continuation_token=$CONTINUATION")
fi
echo "$RESPONSE" | jq '.sprites[].name'
HAS_MORE=$(echo "$RESPONSE" | jq -r '.has_more')
if [ "$HAS_MORE" != "true" ]; then
break
fi
CONTINUATION=$(echo "$RESPONSE" | jq -r '.next_continuation_token')
done