Skip to content

Read a file's scores

Viewing v2— current version

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

Unchanged from v1. This endpoint’s documented request and response schemas are identical in v1 and v2 — change the /v1 prefix to /v2. Schema equality is not a promise about behaviour, so keep your usual smoke tests.

The output scoring verdicts recorded against one file: the current score per rule, plus the headline score stamped on the file by whichever rule its scope nominated.

An empty scores list means the file has not been judged, not that it scored zero.

workspace_id
required
Workspace Id

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

file_id
required
File Id

Id of the file.

string format: uuid

Id of the file.

Successful Response

Media typeapplication/json
FileScoresOutput
object
file_id
required
File Id

Echoes the requested file id.

string format: uuid
scores
required
Scores

The current verdict per rule — the newest one, where a file has been scored more than once.

Array<object>
FileScore
object
rule_id
required
Rule Id

The rule that produced this verdict.

string format: uuid
rule_name
required
Rule Name

The rule’s name as it was when the file was judged.

string
score
required
Score

The verdict, 0-100. Higher is a closer match to what the rule asks for.

integer
rationale
required
Rationale

The judge’s explanation of the score.

string
judged_by_model
required
Judged By Model

The model that judged it.

string
judged_at
required
Judged At

When the verdict was recorded.

string format: date-time
headline_score
Any of:
integer
headline_rule_id
Any of:
string format: uuid
headline_scored_at
Any of:
string format: date-time
Examplegenerated
{
"file_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"scores": [
{
"rule_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"rule_name": "example",
"score": 1,
"rationale": "example",
"judged_by_model": "example",
"judged_at": "2026-04-15T12:00:00Z"
}
],
"headline_score": 1,
"headline_rule_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"headline_scored_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.

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

Invalid input parameters.

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 — too many concurrent requests.

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