Skip to content

Workspaces And Artifacts

Workspaces are standing context. Artifacts are produced evidence.

That distinction is central to the platform API. A workspace can exist before any workflow runs. Artifacts only appear after work produces something worth recording.

  • POST /api/v1/workspaces
  • GET /api/v1/workspaces
  • GET /api/v1/workspaces/:id
  • PATCH /api/v1/workspaces/:id
  • GET /api/v1/workspaces/:id/timeline
  • GET /api/v1/workspaces/:id/spec
  • PUT /api/v1/workspaces/:id/spec
  • PATCH /api/v1/workspaces/:id/memory
  • GET /api/v1/workspaces/:id/files
  • POST /api/v1/workspaces/:id/files
  • GET /api/v1/workspaces/:id/artifacts
  • POST /api/v1/workspaces/:id/verify-git-access

POST /api/v1/workspaces

Scope: admin

{
"name": "Platform",
"slug": "platform",
"description": "Workspace for platform API and dashboard work.",
"repository_url": "https://github.com/agirunner/agirunner-platform",
"settings": {
"storage": {
"type": "git_remote"
}
},
"memory": {
"domain": "platform"
}
}
FieldContractMeaning
namestringHuman-readable workspace name shown in platform surfaces.
slugstringStable short identifier for URLs and operator references.
descriptionstringPurpose and ownership context for the workspace.
repository_urlURL stringOptional upstream repository the workspace tracks.
settingsstructured objectDurable workspace configuration such as storage, repository, or runtime-related settings.
memoryarbitrary JSON objectSticky key/value memory owned by the workspace itself rather than by one workflow run.
{
"data": {
"id": "22222222-2222-2222-2222-222222222222",
"name": "Platform",
"slug": "platform",
"description": "Workspace for platform API and dashboard work.",
"repository_url": "https://github.com/agirunner/agirunner-platform",
"settings": {
"storage": {
"type": "git_remote"
}
},
"memory": {
"domain": "platform"
},
"created_at": "2026-03-31T18:55:00.000Z",
"updated_at": "2026-03-31T18:55:00.000Z"
}
}

GET /api/v1/workspaces

Scope: agent

  • q
  • is_active
  • page
  • per_page
{
"data": [
{
"id": "22222222-2222-2222-2222-222222222222",
"name": "Platform",
"slug": "platform",
"is_active": true,
"summary": {
"workflow_count": 4,
"open_workflow_count": 1
}
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20,
"pages": 1
}
}

PATCH /api/v1/workspaces/:id

Scope: admin

Patch fields can include:

  • name
  • slug
  • description
  • repository_url
  • settings
  • is_active

At least one field is required.

POST /api/v1/workspaces/:id/verify-git-access

Scope: admin

{
"repository_url": "https://github.com/agirunner/agirunner-platform",
"default_branch": "main",
"git_token_mode": "preserve"
}

If git_token_mode is replace, git_token is required.

FieldContractMeaning
repository_urlURL stringRepository URL the platform should test access against.
default_branchstringOptional branch hint for verification and repository introspection.
git_token_modeenumWhether to preserve the current token, replace it for this check, or clear it.
git_tokenopaqueToken value only used when git_token_mode=replace.

The result is a verification packet describing whether the platform can access the configured repository with the current workspace settings.

PATCH /api/v1/workspaces/:id/memory

Scope: agent or admin

Request body:

{
"key": "release-policy",
"value": {
"owner": "platform-team"
}
}
FieldContractMeaning
keystringWorkspace memory slot to write.
valuearbitrary JSON valueArbitrary JSON payload stored under that memory key.

DELETE /api/v1/workspaces/:id/memory/:key

Scope: agent or admin

Both routes return the updated workspace record.

GET /api/v1/workspaces/:id/spec

Scope: agent

Optional query:

  • version

PUT /api/v1/workspaces/:id/spec

Scope: admin

Request body:

{
"resources": {},
"documents": {},
"tools": {},
"config": {},
"instructions": {}
}
FieldContractMeaning
file_namestringStored filename presented back to operators and runtimes.
content_base64base64 stringBase64-encoded file content.
content_typestringOptional MIME type hint for previews and downloads.
descriptionstringOptional operator-facing explanation of why the file matters.
keystringOptional stable logical key. If omitted in batch upload, the platform derives one from the filename.

The spec acts as the durable, structured contract for workspace-owned resources and instructions.

GET /api/v1/workspaces/:id/files

Scope: agent

POST /api/v1/workspaces/:id/files

Scope: admin

Request body:

{
"file_name": "release-context.md",
"content_base64": "IyBSZWxlYXNlIGNvbnRleHQK",
"content_type": "text/markdown",
"description": "Operator-provided release context."
}

POST /api/v1/workspaces/:id/files/batch

Scope: admin

Request body:

{
"files": [
{
"file_name": "release-context.md",
"content_base64": "IyBSZWxlYXNlIGNvbnRleHQK"
}
]
}

GET /api/v1/workspaces/:id/files/:fileId/content

Scope: agent

Returns the raw file bytes with preview headers, not a JSON envelope.

GET /api/v1/workspaces/:id/artifacts

Scope: agent

  • q
  • workflow_id
  • work_item_id
  • task_id
  • stage_name
  • role
  • content_type
  • preview_mode
  • created_from
  • created_to
  • sort
  • page
  • per_page

The route returns a paginated explorer packet for produced evidence files, not just the raw workspace file list.

POST /api/v1/workspaces/:id/planning-workflow

Scope: admin

Request body:

{
"brief": "Survey the workspace and propose a staged delivery plan.",
"name": "Workspace planning run"
}

Response:

Returns the created workflow record in { "data": ... }.