> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.prolific.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.prolific.com/_mcp/server.

# Get the cost breakdown of a workspace

GET https://api.prolific.com/api/v1/workspaces/{workspace_id}/cost/

Returns the spend for a workspace over a reporting period. The response includes an aggregated `current_study_cost` and a
paginated list of per-study cost rows.

Results can be filtered and sorted via query parameters; pass `limit` and `offset` to
page through the study rows.

### Enabling the feature
This endpoint is only available to select workspaces and will need enabling before it can be used.

Reference: https://docs.prolific.com/api-reference/workspaces/get-workspace-cost

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Prolific API for Data Collectors
  version: 1.0.0
paths:
  /api/v1/workspaces/{workspace_id}/cost/:
    get:
      operationId: get-workspace-cost
      summary: Get the cost breakdown of a workspace
      description: >-
        Returns the spend for a workspace over a reporting period. The response
        includes an aggregated `current_study_cost` and a

        paginated list of per-study cost rows.


        Results can be filtered and sorted via query parameters; pass `limit`
        and `offset` to

        page through the study rows.


        ### Enabling the feature

        This endpoint is only available to select workspaces and will need
        enabling before it can be used.
      tags:
        - subpackage_workspaces
      parameters:
        - name: workspace_id
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
        - name: reporting_period_start
          in: query
          description: >-
            Start of the reporting period (ISO 8601). Payments that settled at
            or after this timestamp are included.
          required: true
          schema:
            type: string
            format: date-time
        - name: reporting_period_end
          in: query
          description: >-
            End of the reporting period (ISO 8601). Payments that settled at or
            before this timestamp are included. Must be on or after
            `reporting_period_start`.
          required: true
          schema:
            type: string
            format: date-time
        - name: project_name
          in: query
          description: >-
            Filter studies whose project name matches (case-insensitive
            substring). Pass a comma-separated list to match any of several
            names.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: status
          in: query
          description: >-
            Filter studies by status. Pass a comma-separated list to match any
            of several statuses.
          required: false
          schema:
            type: array
            items:
              $ref: >-
                #/components/schemas/ApiV1WorkspacesWorkspaceIdCostGetParametersStatusSchemaItems
        - name: published_by_email
          in: query
          description: >-
            Filter studies by the email of the researcher who published them.
            Pass a comma-separated list to match any of several emails.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: ordering
          in: query
          description: Sort order for the study rows.
          required: false
          schema:
            $ref: >-
              #/components/schemas/ApiV1WorkspacesWorkspaceIdCostGetParametersOrdering
        - name: limit
          in: query
          description: >-
            Maximum number of study rows to return (max 100). `0` returns all
            matching rows.
          required: false
          schema:
            type: integer
            default: 0
        - name: offset
          in: query
          description: Number of study rows to skip before returning results.
          required: false
          schema:
            type: integer
            default: 0
        - name: Authorization
          in: header
          description: >-
            The Prolific API uses API token to authenticate requests. You can
            create an API token directly from your settings.


            Your API token does not have an expiry date and carries full
            permission, so be sure to keep them secure.


            If your token is leaked, delete it and create a new one directly in
            the app.


            In your requests add `Authorization` header with the value `Token
            <your token>`.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceCost'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
servers:
  - url: https://api.prolific.com
    description: Production
components:
  schemas:
    ApiV1WorkspacesWorkspaceIdCostGetParametersStatusSchemaItems:
      type: string
      enum:
        - ACTIVE
        - PAUSED
        - COMPLETED
        - AWAITING REVIEW
        - UNKNOWN
      title: ApiV1WorkspacesWorkspaceIdCostGetParametersStatusSchemaItems
    ApiV1WorkspacesWorkspaceIdCostGetParametersOrdering:
      type: string
      enum:
        - workspace_name
        - '-workspace_name'
        - published_at
        - '-published_at'
        - total_spend
        - '-total_spend'
      title: ApiV1WorkspacesWorkspaceIdCostGetParametersOrdering
    MonetaryAmount:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
      required:
        - amount
        - currency
      description: >-
        A monetary amount in a given currency. `amount` is in the sub-currency
        unit (e.g. pence, cents).
      title: MonetaryAmount
    CostBreakdown:
      type: object
      properties:
        participant_cost:
          $ref: '#/components/schemas/MonetaryAmount'
        fee_cost:
          $ref: '#/components/schemas/MonetaryAmount'
        tax_cost:
          $ref: '#/components/schemas/MonetaryAmount'
      description: Breakdown of a cost into its participant, fee and tax components.
      title: CostBreakdown
    NamedReference:
      type: object
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
      required:
        - id
        - name
      title: NamedReference
    PublishedByReference:
      type: object
      properties:
        id:
          type: string
        email:
          type:
            - string
            - 'null'
      required:
        - id
        - email
      title: PublishedByReference
    StudyCostRow:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
        workspace:
          $ref: '#/components/schemas/NamedReference'
        project:
          $ref: '#/components/schemas/NamedReference'
        published_by:
          $ref: '#/components/schemas/PublishedByReference'
        published_at:
          type:
            - string
            - 'null'
          format: date-time
        total_places:
          type: integer
        places_taken:
          type: integer
        current_cost:
          $ref: '#/components/schemas/CostBreakdown'
        bonus_cost:
          $ref: '#/components/schemas/CostBreakdown'
        adjustment_cost:
          $ref: '#/components/schemas/CostBreakdown'
      description: >-
        A single study's contribution to a workspace or organisation cost
        breakdown.
      title: StudyCostRow
    CostMeta:
      type: object
      properties:
        count:
          type: integer
          description: >-
            Total number of study rows that match the supplied filters (before
            pagination).
      title: CostMeta
    WorkspaceCost:
      type: object
      properties:
        current_study_cost:
          $ref: '#/components/schemas/CostBreakdown'
        results:
          type: array
          items:
            $ref: '#/components/schemas/StudyCostRow'
        meta:
          $ref: '#/components/schemas/CostMeta'
      description: Cost breakdown for a workspace over the requested reporting period.
      title: WorkspaceCost
    ErrorDetailDetail2:
      type: object
      properties:
        any_field:
          type: array
          items:
            type: string
          description: >-
            Name of the field with a validation error and as a value an array
            with the error descriptions
      description: All fields with validation errors
      title: ErrorDetailDetail2
    ErrorDetailDetail:
      oneOf:
        - type: string
        - type: array
          items:
            type: string
        - $ref: '#/components/schemas/ErrorDetailDetail2'
      description: Error detail
      title: ErrorDetailDetail
    ErrorDetail:
      type: object
      properties:
        status:
          type: integer
          description: Status code as in the http standards
        error_code:
          type: integer
          description: Internal error code
        title:
          type: string
          description: Error title
        detail:
          $ref: '#/components/schemas/ErrorDetailDetail'
          description: Error detail
        additional_information:
          type: string
          description: Optional extra information
        traceback:
          type: string
          description: Optional debug information
        interactive:
          type: boolean
      required:
        - status
        - error_code
        - title
        - detail
      title: ErrorDetail
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      title: Error
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        The Prolific API uses API token to authenticate requests. You can create
        an API token directly from your settings.


        Your API token does not have an expiry date and carries full permission,
        so be sure to keep them secure.


        If your token is leaked, delete it and create a new one directly in the
        app.


        In your requests add `Authorization` header with the value `Token <your
        token>`.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "current_study_cost": {
    "participant_cost": {
      "amount": 125000,
      "currency": "USD"
    },
    "fee_cost": {
      "amount": 15000,
      "currency": "USD"
    },
    "tax_cost": {
      "amount": 10000,
      "currency": "USD"
    }
  },
  "results": [
    {
      "id": "study_9f8b7c6d5e4a3b2c1d0e",
      "name": "Consumer Behavior Survey Q2",
      "status": "COMPLETED",
      "workspace": {
        "id": "workspace_123abc456def",
        "name": "Marketing Research Team"
      },
      "project": {
        "id": "project_789xyz123uvw",
        "name": "Q2 Consumer Insights"
      },
      "published_by": {
        "id": "user_456def789abc",
        "email": "jane.doe@researchco.com"
      },
      "published_at": "2024-01-15T09:30:00Z",
      "total_places": 500,
      "places_taken": 480,
      "current_cost": {
        "participant_cost": {
          "amount": 96000,
          "currency": "USD"
        },
        "fee_cost": {
          "amount": 12000,
          "currency": "USD"
        },
        "tax_cost": {
          "amount": 8000,
          "currency": "USD"
        }
      },
      "bonus_cost": {
        "participant_cost": {
          "amount": 2000,
          "currency": "USD"
        },
        "fee_cost": {
          "amount": 1500,
          "currency": "USD"
        },
        "tax_cost": {
          "amount": 1000,
          "currency": "USD"
        }
      },
      "adjustment_cost": {
        "participant_cost": {
          "amount": 1000,
          "currency": "USD"
        },
        "fee_cost": {
          "amount": 500,
          "currency": "USD"
        },
        "tax_cost": {
          "amount": 1000,
          "currency": "USD"
        }
      }
    }
  ],
  "meta": {
    "count": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.prolific.com/api/v1/workspaces/workspace_id/cost/"

querystring = {"reporting_period_start":"reporting_period_start","reporting_period_end":"reporting_period_end"}

payload = {}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end';
const options = {
  method: 'GET',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/workspaces/workspace_id/cost/?reporting_period_start=reporting_period_start&reporting_period_end=reporting_period_end")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```