# "Insights" Endpoints - POST Export projects data trends

**URL:** <https://community.toggl.com/t/insights-endpoints-post-export-projects-data-trends/415>\
**Category:** Reports API\
**Tags:** data, export, api, post, insights\
**Created:** [December 2, 2024, 6:14pm UTC](https://community.toggl.com/t/insights-endpoints-post-export-projects-data-trends/415 "2024-12-02T18:14:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Support](https://yyz2.discourse-cdn.com/flex012/user_avatar/community.toggl.com/support/32/1577_2.png) [@Support](https://community.toggl.com/u/Support)\
**Post date:** [December 2, 2024, 6:14pm UTC](https://community.toggl.com/t/insights-endpoints-post-export-projects-data-trends/415/1 "2024-12-02T18:14:38Z")

</div>

```auto
https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}

```

Downloads projects data trends in the specified format: csv or xlsx.

- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust

```auto
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> { let client = Client::new().basic_auth("<email>", "<password>"); let json = client.request(Method::POST, "https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}".to_string()).json(&serde_json::json!(\{"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string"\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}

```

### Parameters[​](https://engineering.toggl.com/docs/reports/insights/#parameters-3)

#### Path[​](https://engineering.toggl.com/docs/reports/insights/#path-2)

| name | type | required | description |
| --- | --- | --- | --- |
| workspace\_id | integer | true | Workspace ID |
| extension | string | true | csv,xlsx |

#### Body[​](https://engineering.toggl.com/docs/reports/insights/#body-3)

| Name | Type | Description |
| --- | --- | --- |
| billable | boolean | Whether the project is set as billable, optional, premium feature. |
| end\_date | string | End date, example time.DateOnly. Should be greater than Start date. |
| previous\_period\_start | string | Previous start date, example time.DateOnly. |
| project\_ids | Array of integer | Project IDs, optional. |
| rounding | integer | Rounding, optional, duration rounding settings, premium feature. |
| rounding\_minutes | integer | RoundingMinutes, optional, duration rounding minutes settings, premium feature. |
| start\_date | string | Start date, example time.DateOnly. Should be less than End date. |

### Response[​](https://engineering.toggl.com/docs/reports/insights/#response-3)

#### 200[​](https://engineering.toggl.com/docs/reports/insights/#200-3)

Returns data projects data trends

| Name | Type | Description |
| --- | --- | --- |
| items | Array of object | - |

##### items[​](https://engineering.toggl.com/docs/reports/insights/#items-1)

| Name | Type | Description |
| --- | --- | --- |
| current\_period\_seconds | Array of integer | - |
| previous\_period\_seconds | Array of integer | - |
| project\_id | integer | - |
| start | string | - |
| user\_ids | Array of integer | - |

#### 400[​](https://engineering.toggl.com/docs/reports/insights/#400-3)

Possible error messages:

- At least one parameter must be set
- Invalid workspace id
- wrong format date
- start should come after end

#### 403[​](https://engineering.toggl.com/docs/reports/insights/#403-3)

Possible error messages:

- Workspace not found/accessible"
- user has no required access to asked workspace

#### 500[​](https://engineering.toggl.com/docs/reports/insights/#500-3)

Internal Server Error
