API reference / Tasks and projects
Find stock photos for a task
Finds 1 to 4 stock photos on Pexels, and attaches them to the task. Each search takes the first photo that is not on the task yet. Troopy searches with its own key, so a workspace connects nothing. A workspace finds 60 photos a day. The words of each search go to Pexels. When stock photos are off, the call fails with not_connected.
/api/v1/tasks/{key}/photosOther ways to call it
troopy tasks photostroopy_find_task_photosIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Path parameters
key*stringA task's key (VIR-12), its number (12) or its id
At least 1 characters · At most 40 characters
Body
application/jsonphotos*array<object>At most 4 items
2 properties
search*stringA few plain words for the scene, like: dark bedroom phone glow. No names of people or brands
At least 2 characters · At most 60 characters
shapeenum<string>cover and wide are landscape photos. square is a square one
coverwidesquare
Default "wide"
Response
201 · application/jsondata*object2 properties
photos*array<object>The photos
3 properties
file*objectThe photo, as a file of the task
7 properties
id*stringA 24-character id
name*stringcontentType*stringAs Troopy serves it; a type a browser could run is served as plain bytes
size*integerIn bytes
by*objectWho wrote it
3 properties
type*enum<string>personagentapi
id*stringname*stringcreatedAt*stringISO 8601 date and time
url*stringDownloads it: send your API key, or be signed in
shows*stringWhat the photo shows, in the words of Pexels
by*stringWho took it
failed*array<string>Why a search found no photo, one line for each