Skip to content
Get started

List pins

client.pins.list(PinListParams { rotorAPIVersion, limit, page, 2 more } params, RequestOptionsoptions?): PinListResponse { data, pagination, status }
GET/pins

Returns a paginated list of pins for the authenticated company. Results are ordered by creation date (newest first).

ParametersExpand Collapse
params: PinListParams { rotorAPIVersion, limit, page, 2 more }
rotorAPIVersion: "1.1.0"

Header param: Required OpenAPI version header.

limit?: number

Query param: Number of results per page (max 1000)

minimum1
maximum1000
page?: number

Query param: Page number (1-based)

minimum1
pin_type_id?: string

Query param: Filter pins by pin type

formatuuid
user_id?: string

Query param: Filter pins by the user who created them

formatuuid
ReturnsExpand Collapse
PinListResponse { data, pagination, status }
data?: Array<Data>
id: string
created_at: string
created_by: CreatedBy { email, name, user_id }
email: string
name: string
user_id: string
location: Array<number>

Geographic coordinates [latitude, longitude]

pin_type: PinType { id, color, label }
id: string
color: string

Hex color code for the pin

label: string

Display label for the pin type

Whether more pages are available

Total number of matching records

status?: string

List pins

import Rotor from 'getrotor';

const client = new Rotor({
  rotorAPIVersion: '1.1.0',
  apiKey: process.env['ROTOR_API_KEY'], // This is the default and can be omitted
});

const pins = await client.pins.list({ 'rotor-api-version': '1.1.0' });

console.log(pins.data);
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "email": "dev@stainless.com",
        "name": "name",
        "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      },
      "location": [
        40.7128,
        -74.006
      ],
      "pin_type": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "color": "#FF0000",
        "label": "High Priority"
      }
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 50,
    "page": 1,
    "total": 142
  },
  "status": "success"
}
{
  "status": "error",
  "message": "Authentication required. Provide x-api-key header.",
  "error_code": "AUTHENTICATION_REQUIRED"
}
{
  "status": "error",
  "message": "Forbidden: required scope 'leads:read' not granted for this API key",
  "error_code": "INSUFFICIENT_SCOPE"
}
{
  "status": "error",
  "message": "Daily API key request limit of 1000 exceeded",
  "error_code": "RATE_LIMIT_EXCEEDED"
}
{
  "status": "error",
  "message": "Internal server error"
}
Returns Examples
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "email": "dev@stainless.com",
        "name": "name",
        "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      },
      "location": [
        40.7128,
        -74.006
      ],
      "pin_type": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "color": "#FF0000",
        "label": "High Priority"
      }
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 50,
    "page": 1,
    "total": 142
  },
  "status": "success"
}
{
  "status": "error",
  "message": "Authentication required. Provide x-api-key header.",
  "error_code": "AUTHENTICATION_REQUIRED"
}
{
  "status": "error",
  "message": "Forbidden: required scope 'leads:read' not granted for this API key",
  "error_code": "INSUFFICIENT_SCOPE"
}
{
  "status": "error",
  "message": "Daily API key request limit of 1000 exceeded",
  "error_code": "RATE_LIMIT_EXCEEDED"
}
{
  "status": "error",
  "message": "Internal server error"
}