Skip to content

List sessions

Viewing v2— current version

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

New in v2. This endpoint has no v1 equivalent.

List the workspace’s active sessions, most recently used first. A client resuming work can take the first row; one letting a person choose can page through the rest.

workspace_id
required
Workspace Id

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

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
ListSessionsOutput
object
sessions
required
Sessions
Array<object>
SessionSummary
object
session_id
required
Session Id

The session’s unique identifier.

string format: uuid
name
required
Name

The session’s display name.

string
project_id
Project Id

The project the session is filed under, if any.

string format: uuid
nullable
created_at
required
Created At

When the session was created.

string format: date-time
last_interacted_at
Last Interacted At

When anyone last worked in the session, or null if nobody has yet.

string format: date-time
nullable
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
Examplegenerated
{
"sessions": [
{
"session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"created_at": "2026-04-15T12:00:00Z",
"last_interacted_at": "2026-04-15T12:00:00Z"
}
],
"pagination": {
"next_cursor": "example",
"has_more_results": true,
"total_count": 1
}
}

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."
}