Skip to content
  • Auto
  • Light
  • Dark
Get Started

List

List
client.vals.list(ValListParamsquery, RequestOptionsoptions?): dataarraylinksPaginationLinksValListResponse
get/v2/vals

Lists all vals including all public vals and your unlisted and private vals

Parameters
querylimitnumbercursorstringprivacyunionuser_idstringValListParams
Hide ParametersShow Parameters
limitnumber

Maximum items to return in each paginated response

minimum1
maximum100
cursorstring
optional

Cursor to start the pagination from

formatdate-time
privacyunion
optional
"public" | "unlisted" | "private"

This resource's privacy setting. Unlisted resources do not appear on profile pages or elsewhere, but you can link to them.

Hide ParametersShow Parameters
"public"
"unlisted"
"private"
user_idstring
optional

User ID to filter by

formatuuid
Returns
ValListResponse

A paginated result set

Hide ParametersShow Parameters
dataarray
Array<idstringauthorAuthorcreatedAtstringdescriptionunionimageUrlunionlinksLinksnamestringprivacyunionVal>
Hide ParametersShow Parameters
idstring

The id of the val

formatuuid
authoridstringusernameunionAuthor
Hide ParametersShow Parameters
idstring
formatuuid
usernameunion
string | null
createdAtstring
formatdate-time
descriptionunion
string | null
imageUrlunion
string | null

The URL of this val's image

namestring
privacyunion
"public" | "unlisted" | "private"

This resource's privacy setting. Unlisted resources do not appear on profile pages or elsewhere, but you can link to them.

Hide ParametersShow Parameters
"public"
"unlisted"
"private"
import ValTown from '@valtown/sdk';

const client = new ValTown({
  bearerToken: 'My Bearer Token',
});

const vals = await client.vals.list({ limit: 1 });

console.log(vals.data);
200 Example
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "author": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "username": "username"
      },
      "createdAt": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "imageUrl": "imageUrl",
      "links": {
        "html": "https://example.com",
        "self": "https://example.com"
      },
      "name": "name",
      "privacy": "public"
    }
  ],
  "links": {
    "self": "https://example.com",
    "next": "https://example.com",
    "prev": "https://example.com"
  }
}