Open App

Assets

API endpoints for assets

List assets

GET /api/v1/assets

Parameters

NameInTypeRequiredDescription
organizationIdquerystringNoOrganization scope id. Omit for token default; pass an empty value for personal scope where supported.
scoutIdquerystringNo
projectIdquerystringNo
spaceIdquerystringNo
labelIdquerystringNo
includequerystringNoComma-separated relation names to hydrate, or all.
limitqueryintegerNoMaximum number of items to return.
offsetqueryintegerNoNumber of items to skip.

Example request

curl -X GET \
"https://api.getpilfer.com/api/v1/assets?organizationId=<organizationId>&scoutId=<scoutId>&projectId=<projectId>&spaceId=<spaceId>&labelId=<labelId>&include=<include>&limit=<limit>&offset=<offset>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": [
    {
      "_id": "string",
      "name": "string",
      "scoutId": "string",
      "categoryId": "string",
      "cost": 0
    }
  ]
}

Other statuses: 401, 403.

Response body type

{ data: Asset[] }


Create asset

POST /api/v1/assets

Example request

curl -X POST \
"https://api.getpilfer.com/api/v1/assets" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","organizationId":"string","scoutId":"string","categoryId":"string","heroImage":"string","condition":0,"satisfaction":0,"usage":0,"friction":0,"lifetimeValue":0,"acquisitionDate":0,"cost":0}'

Example response

Status: 201

{
  "data": {
    "_id": "string",
    "name": "string",
    "scoutId": "string",
    "categoryId": "string",
    "cost": 0
  }
}

Other statuses: 400, 401, 403.

Response body type

{ data: Asset }


Get asset

GET /api/v1/assets/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id
includequerystringNoComma-separated relation names to hydrate, or all.

Example request

curl -X GET \
"https://api.getpilfer.com/api/v1/assets/<id>?include=<include>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "name": "string",
    "scoutId": "string",
    "categoryId": "string",
    "cost": 0
  }
}

Other statuses: 401, 403, 404.

Response body type

{ data: Asset }


Update asset

PATCH /api/v1/assets/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id

Example request

curl -X PATCH \
"https://api.getpilfer.com/api/v1/assets/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","scoutId":"string","categoryId":"string","heroImage":"string","condition":0,"satisfaction":0,"usage":0,"friction":0,"lifetimeValue":0,"acquisitionDate":0,"cost":0}'

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "name": "string",
    "scoutId": "string",
    "categoryId": "string",
    "cost": 0
  }
}

Other statuses: 400, 401, 403, 404.

Response body type

{ data: Asset }


Delete asset

DELETE /api/v1/assets/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id

Example request

curl -X DELETE \
"https://api.getpilfer.com/api/v1/assets/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {}
}

Other statuses: 401, 403, 404.

Response body type

{ data: DeleteResult }