LogoPhotopurr Docs
LogoPhotopurr Docs
HomepageWhat is PhotopurrGenerating imagesCreditsAPI reference
Developer Center
Quick startKey managementScopesImage downloadError formatRate limitsImage pack pulling
Developer Center

Scopes

Which endpoints each key can reach

Scopes are ticked when a key is created and cannot be changed afterwards; for different scopes create another key. Revoking one key does not affect the others.

ScopeEndpointsTypical use
generate:writePOST /api/v1/generateGenerate images. Spends credits
assets:readGET /api/file/<filename>Download generation results and images inside image packs
documents:readGET /api/v1/image-pack-publications, GET /api/v1/image-pack-publications/<id>Pull published image packs

Calling an endpoint without its scope returns 403 insufficient_scope, with message naming the missing scope.

Common combinations

ScenarioTick
Script that generates in bulk and saves the filesgenerate:write + assets:read
Listing tool that pulls image packsdocuments:read + assets:read
Generate only, review results on the websitegenerate:write

Keys with read-only scopes (assets:read / documents:read) get a higher rate limit, see rate limits.

Early keys

Keys created before scopes existed have no scope record and are treated as generate:write only. For other scopes create a new key.

Resource ownership

Scopes decide which endpoints a key may call. They never change who owns the data: each key can only reach the images, sessions and image packs of its own account. Requesting someone else's resource always returns 404, not 403.

Once an account is banned, every key under it immediately returns 403 banned.

Website login

Calls made from the browser with a cookie session are not subject to scopes; that is the website itself at work. Scopes only constrain Authorization: Bearer requests.

Key management

Creation, expiry, revocation, logs and security advice

Image download

Originals, thumbnails, download parameters and retention

Table of Contents

Common combinationsEarly keysResource ownershipWebsite login