Skip to content

List session objects

Viewing v2— current version

GET
/v2/workspaces/{workspace_id}/sessions/{session_id}/objects
curl --request GET \
--url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/sessions/:session_id/objects \
--header 'Authorization: Bearer <token>'

New in v2. This endpoint has no v1 equivalent.

The files and assets in the session, newest first, each as a SessionEvent describes it. To keep a view of the session current, open the event stream first and read this once it has connected: nothing is missed between the two, and a change may appear in both.

workspace_id
required
Workspace Id

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

session_id
required
Session Id

Id of the session.

string format: uuid

Id of the session.

limit
Limit

Maximum number of results to return.

integer
default: 20 >= 1 <= 100

Maximum number of results to return.

cursor
Cursor

Cursor from a previous response to fetch the next page.

string
nullable

Cursor from a previous response to fetch the next page.

Successful Response

Media typeapplication/json
ListSessionObjectsOutput
object
objects
required
Objects
Array<object>
SessionObject

A file or asset in the session, as it stands now: what a SessionEvent carries.

object
kind
required
Kind

Whether the object is a single file or a composite asset.

string
Allowed values: file asset
name
required
Name

The object’s display name.

string
content_type
Content Type

MIME type, for a file.

string
nullable
status
Status

Processing status, for a file. A file is ready to download once it reads processed.

string
nullable
url
Url

Download URL, for a processed file.

string
nullable
preview_url
Preview Url

Thumbnail URL, for a file that has one.

string
nullable
width
Width

Width in pixels, for an image or video file.

integer
nullable
height
Height

Height in pixels, for an image or video file.

integer
nullable
metadata
Any of:
FileMetadataView

What an engine needs beyond the image to build a resource from a file. Each kind is null when absent.

object
tile
Any of:
TileMetadataView

Where a game tile’s sprite sits on its grid, in the sprite’s own pixels from its top-left corner.

object
shape
required
TileShape

The outline of one grid cell seen from straight above.

string
Allowed values: SQUARE HEXAGON
orientation
required
TileOrientation

How the cell is turned to the camera: DIAMOND or ALIGNED for a square, POINTY_TOP or FLAT_TOP for a hexagon.

string
Allowed values: DIAMOND ALIGNED POINTY_TOP FLAT_TOP
elevation
required
Elevation

Camera tilt in degrees above the ground plane; 90 is straight down.

number
facing
required
Facing

Quarter turn of the camera around the tile, in degrees clockwise seen from above: 0, 90, 180, or 270. A hexagon is only drawn facing 0.

integer
footprint_width
required
Footprint Width

Cells the footprint covers across (the base’s right-hand edge) at facing 0.

integer
footprint_depth
required
Footprint Depth

Cells the footprint covers deep (the base’s left-hand edge) at facing 0.

integer
height
required
Height

Wall height in cell sides: 0 is a flat ground tile, 1 a cube on a square.

number
tile_width
required
Tile Width

Width in pixels of one cell’s base outline in the sprite.

integer
tile_height
required
Tile Height

Height in pixels of one cell’s base outline in the sprite.

integer
anchor
required
TilePointView

The point the tile is placed by: the bottom centre of the cell it stands on (the front cell of a footprint wider than one).

object
x
required
X

Pixels right of the sprite’s left edge.

number
y
required
Y

Pixels down from the sprite’s top edge.

number
cell_center
required
TilePointView

The centre of the anchor’s cell. Godot and Unity pin a tile here rather than at the anchor.

object
x
required
X

Pixels right of the sprite’s left edge.

number
y
required
Y

Pixels down from the sprite’s top edge.

number
base_outline
required
Base Outline

The footprint’s whole base outline, clockwise on screen from the anchor’s vertex or edge.

Array<object>
TilePointView
object
x
required
X

Pixels right of the sprite’s left edge.

number
y
required
Y

Pixels down from the sprite’s top edge.

number
subject_id
Subject Id

What the tile shows. Every facing of one subject shares it, so a tileset can group them.

string format: uuid
nullable
nine_slice
Any of:
NineSliceMetadataView

The insets a 9-slice draws a UI element by, in the image’s own pixels in from each edge.

The corners are drawn at their own size, the edges stretch along their length, and the centre stretches both ways.

object
left
required
Left

Pixels in from the left edge.

integer
top
required
Top

Pixels in from the top edge.

integer
right
required
Right

Pixels in from the right edge.

integer
bottom
required
Bottom

Pixels in from the bottom edge.

integer
source
required
NineSliceSource

DETECTED when measured off the pixels, USER when a person set the insets.

string
Allowed values: DETECTED USER
sprite_sheet
Any of:
SpriteSheetMetadataView

The frame grid a sprite sheet was packed on, in the sheet’s own pixels from its top-left corner.

Cells start margin pixels in from the sheet’s edges with spacing pixels between them.

object
columns
required
Columns

Cells across.

integer
rows
required
Rows

Cells down.

integer
cell_width
required
Cell Width

Width of one cell in pixels.

integer
cell_height
required
Cell Height

Height of one cell in pixels.

integer
margin
required
Margin

Pixels between the sheet’s edges and the outer cells.

integer
spacing
required
Spacing

Pixels between neighbouring cells.

integer
frames
required
Frames

The frames, in play order: left to right, then top to bottom, unless the list orders them otherwise.

Array<object>
SpriteSheetFrameView

One frame’s rect on the sheet, in the sheet’s own pixels from its top-left corner.

object
index
required
Index

The frame’s cell in reading order over the whole grid (left to right, then top to bottom). Cells that hold no frame are left out, so indexes can skip.

integer
x
required
X

The frame’s left edge on the sheet, in pixels.

integer
y
required
Y

The frame’s top edge on the sheet, in pixels.

integer
w
required
W

The frame’s width in pixels.

integer
h
required
H

The frame’s height in pixels.

integer
anchor
Any of:
TilePointView
object
x
required
X

Pixels right of the sprite’s left edge.

number
y
required
Y

Pixels down from the sprite’s top edge.

number
animations
required
Animations

Named animations over the frames. When empty, play the sheet as one animation named default over every frame in frames order, at 12 fps, looping.

Array<object>
SpriteSheetAnimationView
object
name
required
Name

The animation’s name.

string
frames
required
Frames

Frame indexes (frames[].index), in play order.

Array<integer>
fps
required
Fps

Frames per second.

number
loop
required
Loop

Whether the animation restarts after its last frame.

boolean
object_id
required
Object Id

The object’s id, the same one its SessionEvents carry. For a file this is its file_id.

string format: uuid
pagination
required
PaginationOutput
object
next_cursor
Next Cursor

Cursor to use to get the next page

string
nullable
has_more_results
required
Has More Results

If there are more results to page through

boolean
total_count
Total Count

Total number of results matching the query

integer
nullable
Example
{
"objects": [
{
"kind": "file",
"metadata": {
"tile": {
"shape": "SQUARE",
"orientation": "DIAMOND"
},
"nine_slice": {
"source": "DETECTED"
}
}
}
]
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Invalid input parameters, or an Idempotency-Key reused for a different request.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Rate limited — retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}