---
agentTools:
  projectIndex: https://uspacy.readme.io/llms.txt
---

# Get CRM entity items list

Returns a paginated list of CRM entity items with metadata.
Supports pagination via `page` and `list` query parameters.
Example: `GET /crm/v1/entities/leads?page=1&list=20`

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CRM service",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://{domain}.uspacy.ua",
      "description": "Ukrainian server"
    },
    {
      "url": "https://{domain}.uspacy.eu",
      "description": "EU server"
    },
    {
      "url": "https://{domain}.uspacy.com.br",
      "description": "Brazilian server"
    },
    {
      "url": "https://{domain}.uspacy.com",
      "description": "International server"
    }
  ],
  "tags": [
    {
      "name": "items",
      "description": "CRM entity items (leads, deals, contacts, companies)"
    }
  ],
  "paths": {
    "/crm/v1/entities/{entity}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/entity"
        }
      ],
      "get": {
        "tags": [
          "items"
        ],
        "summary": "Get CRM entity items list",
        "description": "Returns a paginated list of CRM entity items with metadata.\nSupports pagination via `page` and `list` query parameters.\nExample: `GET /crm/v1/entities/leads?page=1&list=20`\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/list"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "allOf": [
                              {
                                "$ref": "#/components/schemas/CrmEntity"
                              },
                              {
                                "$ref": "#/components/schemas/CrmEAdditionalFields"
                              }
                            ]
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "meta": {
                          "$ref": "#/components/schemas/Meta"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "title": "Lead example",
                      "owner": 1,
                      "source": "shop",
                      "email": [
                        {
                          "id": "",
                          "type": "main",
                          "value": "stark@gmail.com",
                          "main": true
                        }
                      ],
                      "phone": [
                        {
                          "id": "01gdnpddf5xgzxqvcn4x83mc2s",
                          "type": "WORK",
                          "value": "+380123456789",
                          "code": "+380"
                        }
                      ],
                      "messengers": [],
                      "created_by": 1,
                      "changed_by": 1,
                      "created_at": 1674950100,
                      "updated_at": 1674951000
                    },
                    {
                      "id": 13,
                      "title": "Another lead",
                      "owner": 2,
                      "source": "website",
                      "email": [],
                      "phone": [],
                      "messengers": [],
                      "created_by": 2,
                      "changed_by": 2,
                      "created_at": 1674960100,
                      "updated_at": 1674961000
                    }
                  ],
                  "meta": {
                    "currentPage": 1,
                    "from": 1,
                    "lastPage": 1,
                    "perPage": 20,
                    "to": 2,
                    "total": 2
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Access token is missing or invalid"
      }
    },
    "parameters": {
      "entity": {
        "name": "entity",
        "in": "path",
        "description": "Entity table name",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "leads",
            "deals",
            "contacts",
            "companies"
          ]
        },
        "example": "leads"
      },
      "page": {
        "name": "page",
        "in": "query",
        "description": "Current page",
        "required": false,
        "schema": {
          "type": "integer",
          "default": 1
        },
        "example": 1
      },
      "list": {
        "name": "list",
        "in": "query",
        "description": "How many items should be per page",
        "required": false,
        "schema": {
          "type": "integer",
          "default": 20
        },
        "example": 10
      }
    },
    "schemas": {
      "Meta": {
        "type": "object",
        "properties": {
          "currentPage": {
            "type": "integer",
            "example": 1
          },
          "from": {
            "type": "integer",
            "example": 1
          },
          "lastPage": {
            "type": "integer",
            "example": 1
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "example": null
                },
                "label": {
                  "type": "string",
                  "example": "Previous"
                },
                "active": {
                  "type": "boolean",
                  "example": false
                }
              }
            }
          },
          "path": {
            "type": "string",
            "example": "https://domain.uspacy.ua/crm/v1/entities/leads"
          },
          "perPage": {
            "type": "integer",
            "example": 20
          },
          "to": {
            "type": "integer",
            "example": 2
          },
          "total": {
            "type": "integer",
            "example": 2
          }
        }
      },
      "multipleEmail": {
        "type": "array",
        "items": {
          "properties": {
            "id": {
              "type": "string",
              "example": "01gdnpddf5xgzxqvcn4x83mc2s"
            },
            "type": {
              "type": "string",
              "example": "main"
            },
            "value": {
              "type": "string",
              "example": "stark@gmail.com"
            },
            "main": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "example": [
          {
            "id": "",
            "type": "main",
            "value": "stark@gmail.com",
            "main": true
          },
          {
            "id": "01gdnpddf5xgzxqvcn4x83mc2s",
            "type": "work",
            "value": "benner@gmail.com",
            "main": false
          }
        ]
      },
      "Phone": {
        "type": "array",
        "items": {
          "properties": {
            "id": {
              "type": "string",
              "example": "01gdnpddf5xgzxqvcn4x83mc2s"
            },
            "type": {
              "type": "string",
              "enum": [
                "WORK",
                "MOBILE",
                "HOME"
              ],
              "example": "WORK"
            },
            "value": {
              "type": "string",
              "example": "+380123456789"
            },
            "code": {
              "type": "string",
              "example": "+380"
            }
          }
        }
      },
      "SocialMedia": {
        "type": "array",
        "items": {
          "properties": {
            "id": {
              "type": "string",
              "example": "01gdnpddf5xgzxqvcn4x83bn2s"
            },
            "type": {
              "type": "string",
              "example": "facebook"
            },
            "link": {
              "type": "string",
              "example": "https://www.facebook.com"
            }
          }
        }
      },
      "CrmEntity": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Lead example"
          },
          "owner": {
            "type": "integer",
            "example": 1
          },
          "source": {
            "type": "string",
            "example": "shop"
          },
          "email": {
            "$ref": "#/components/schemas/multipleEmail"
          },
          "phone": {
            "$ref": "#/components/schemas/Phone"
          },
          "messengers": {
            "$ref": "#/components/schemas/SocialMedia"
          }
        }
      },
      "CrmEAdditionalFields": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 12
          },
          "created_by": {
            "type": "integer",
            "example": 1
          },
          "changed_by": {
            "type": "integer",
            "example": 1
          },
          "created_at": {
            "type": "integer",
            "example": 12156465
          },
          "updated_at": {
            "type": "integer",
            "example": 12156465
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 145,
      "2": 108,
      "3": 28,
      "4": 165,
      "5": 162,
      "6": 20,
      "7": 148,
      "8": 43,
      "9": 242,
      "10": 235,
      "11": 56
    }
  }
}
```