Skip to content

Resources

CompozyOS Resources HTTP endpoints.

For people running agent work32 pages in this section
GET
/api/resources

Query Parameters

kind?string

Filter by resource kind

scope_kind?string

Filter by resource scope kind

Value in"user""workspace"
scope_id?string

Filter by workspace scope id

owner_kind?string

Filter by stamped owner kind

owner_id?string

Filter by stamped owner id

source_kind?string

Filter by stamped source kind

source_id?string

Filter by stamped source id

limit?integer

Maximum number of records to return

Formatint32

Response Body

OK

application/json
  1. response
records*array<>
curl -X GET "https://example.com/api/resources"
{  "records": [    {      "created_at": "2019-08-24T14:15:22Z",      "id": "string",      "kind": "string",      "owner": {        "id": "string",        "kind": "string"      },      "scope": {        "id": "string",        "kind": "user"      },      "source": {        "id": "string",        "kind": "string"      },      "spec": null,      "updated_at": "2019-08-24T14:15:22Z",      "version": 0    }  ]}
GET
/api/resources/{kind}

Path Parameters

kind*string

Resource kind

Query Parameters

scope_kind?string

Filter by resource scope kind

Value in"user""workspace"
scope_id?string

Filter by workspace scope id

owner_kind?string

Filter by stamped owner kind

owner_id?string

Filter by stamped owner id

source_kind?string

Filter by stamped source kind

source_id?string

Filter by stamped source id

limit?integer

Maximum number of records to return

Formatint32

Response Body

OK

application/json
  1. response
records*array<>
curl -X GET "https://example.com/api/resources/string"
{  "records": [    {      "created_at": "2019-08-24T14:15:22Z",      "id": "string",      "kind": "string",      "owner": {        "id": "string",        "kind": "string"      },      "scope": {        "id": "string",        "kind": "user"      },      "source": {        "id": "string",        "kind": "string"      },      "spec": null,      "updated_at": "2019-08-24T14:15:22Z",      "version": 0    }  ]}
GET
/api/resources/{kind}/{id}

Path Parameters

kind*string

Resource kind

id*string

Resource id

Response Body

OK

application/json
  1. response
record*
curl -X GET "https://example.com/api/resources/string/string"
{  "record": {    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "kind": "string",    "owner": {      "id": "string",      "kind": "string"    },    "scope": {      "id": "string",      "kind": "user"    },    "source": {      "id": "string",      "kind": "string"    },    "spec": null,    "updated_at": "2019-08-24T14:15:22Z",    "version": 0  }}
DELETE
/api/resources/{kind}/{id}

Path Parameters

kind*string

Resource kind

id*string

Resource id

Request Body

JSON request body

application/json
  1. body
expected_version*integer
Formatint64

Response Body

Deleted

curl -X DELETE "https://example.com/api/resources/string/string" \  -H "Content-Type: application/json" \  -d '{    "expected_version": 0  }'
Empty
PUT
/api/resources/{kind}/{id}

Path Parameters

kind*string

Resource kind

id*string

Resource id

Request Body

JSON request body

application/json
  1. body
expected_version?integer
Formatint64
scope*
spec*unknown

Response Body

Updated

application/json
  1. response
record*
curl -X PUT "https://example.com/api/resources/string/string" \  -H "Content-Type: application/json" \  -d '{    "scope": {      "kind": "user"    },    "spec": null  }'
{  "record": {    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "kind": "string",    "owner": {      "id": "string",      "kind": "string"    },    "scope": {      "id": "string",      "kind": "user"    },    "source": {      "id": "string",      "kind": "string"    },    "spec": null,    "updated_at": "2019-08-24T14:15:22Z",    "version": 0  }}