Skip to content

Get session

Viewing v2— current version

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

New in v2. This endpoint has no v1 equivalent.

Get one session. A 404 means the session is gone, or belongs to another workspace; either way a client holding its id should stop using it.

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.

Successful Response

Media typeapplication/json
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
Examplegenerated
{
"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"
}

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