Views

1. List Views

Returns a list of all views.

  • URL: /lighthouse/orgs/{org_id}/businesses/{business_id}/workspaces/{workspace_id}/views

  • Method: GET

  • Description: Retrieves a non-paginated list of views.

Query Params

Name
Type
Required
Description

Example Request

curl -X GET https://api.piercloud.io/lighthouse/orgs/{org_id}/businesses/{business_id}/workspaces/{workspace_id}/views \
     -H "Authorization: Bearer  "

Successful Response (200 OK)

{
  "code": "success",
  "data": {
    "views": [
      {
        "id": 1,
        "name": "View name",
        "description": null,
        "created_at": "2025-01-01T00:00:00.911Z"
      }
    ],
    "total": 1
  }
}

Error Response (400 Bad Request)

Error Response (401 Unauthorized)

Error Response (403 Forbidden)


2. Access View Information

Returns information about a specific view.

  • URL: /lighthouse/orgs/{org_id}/businesses/{business_id}/views/{id}

  • Method: GET

  • Description: Returns information about a single view.

Query Params

Name
Type
Required
Description

Example Request

Successful Response (200 OK)

Error Response (400 Bad Request)

Error Response (401 Unauthorized)

Error Response (403 Forbidden)

Error Response (404 Not Found)


3. Get View Data

  • URL: /lighthouse/orgs/{org_id}/businesses/{business_id}/views/{id}/data

  • Method: GET

  • Description: Returns the access token and other information based on the provided credentials.

Query Params

Name
Type
Required
Description

start_date

date

No

Start date of the period (YYYY-MM-DD). Default: Beginning of the current month

end_date

date

No

End date of the period (YYYY-MM-DD). Default: End of the current month

date_type

string

No

Enter "month" if you want to filter by competence (monthly basis), or "date" if you want to filter by a specific date.

filters

JSON

No

Enter the filters you want to add to the view, following the JSON format according to the example below.

Example of JSON filters

Column
Type
Required
Description

name

string

Yes

Name of the column you want to filter

data_type

string

Yes

Enter the column type. Possible values: "string", "number", and "date".

role

string

Yes

Enter the rule type. Possible value: "filter".

filters.expression

string

Yes

Enter the filter expression. Possible values: "IS", "CONTAINS".

filters.value

Array<string>

Yes

Enter the values you want to filter by.

filters.negative_expression

Boolean

No

Specify if you want to apply a negation expression.

Example Request

Successful Response (200 OK)

Error Response (400 Bad Request)

Error Response (401 Unauthorized)

Error Response (403 Forbidden)

Error Response (404 Not Found)

Last updated