Skip to content
Skip to Content
Coder Docs

Post Workspace Usage by ID

POST
/api/v2/workspaces/{workspace}/usage

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

workspace*string

Workspace ID

Formatuuid

Request Body

Post workspace usage request

application/json
  1. body
agent_id?string
Formatuuid
app_name?string

AppName is any name for the app reporting usage. The server normalizes it at ingestion, so a new app needs no server change. The UsageAppName constants are the well-known names.

Response Body

No Content

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/workspaces/{workspace}/usage" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",  "app_name": "string"}'
Example Response204
Empty