---
title: "Get processed sample (from features array)"
method: POST
path: "/api/{projectId}/dsp/{dspId}/run"
tags: ["DSP"]
---

# Get processed sample (from features array)

`POST /api/{projectId}/dsp/{dspId}/run`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/run`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/:projectId/dsp/:dspId/run/post.ts> (a function with typed inputs; its response is checked against the schema)

Takes in a features array and runs it through the DSP block. This data should have the same frequency as set in the input block in your impulse.

## Path parameters

- `projectId` integer, required
- `dspId` integer, required

## Request body

- DspRunRequestWithFeatures
  - `features` integer[], required: Array of features. If you have multiple axes the data should be interleaved (e.g. [ax0_val0, ax1_val0, ax2_val0, ax0_val1, ax1_val1, ax2_val1]).
  - `params` object, required: DSP parameters with values
  - `drawGraphs` boolean, required: Whether to generate graphs (will take longer)
  - `requestPerformance` boolean, required: Whether to request performance info (will take longer unless cached)

## Response `200`

OK

- DspRunResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `features` number[], required: Array of processed features. Laid out according to the names in 'labels'
  - `graphs` DspRunGraph[], required: Graphs to plot to give an insight in how the DSP process ran
    - `name` string, required: Name of the graph
    - `image` string: Base64 encoded image, only present if type is 'image'
    - `imageMimeType` string: Mime type of the Base64 encoded image, only present if type is 'image'
    - `X` object: Values on the x-axis per plot. Key is the name of the raw feature. Present if type is 'logarithmic' or 'linear'.
    - `y` number[]: Values of the y-axis. Present if type is 'logarithmic' or 'linear'.
    - `suggestedXMin` number: Suggested minimum value of x-axis
    - `suggestedXMax` number: Suggested maxium value of x-axis
    - `suggestedYMin` number: Suggested minimum value of y-axis
    - `suggestedYMax` number: Suggested maximum value of y-axis
    - `type` string, required: Type of graph (either `logarithmic`, `linear` or `image`)
    - `lineWidth` number: Width of the graph line (if type is `logarithmic` or `linear`). Default 3.
    - `smoothing` boolean: Whether to apply smoothing to the graph.
    - `axisLabels` object: Labels for the graph x and y axes.
      - `X` string, required
      - `y` string, required
    - `highlights` object: Indices of points to highlight, per axis.
  - `labels` string[]: Labels of the feature axes
  - `state_string` string: String representation of the DSP state returned
  - `performance` DspPerformance
    - `latency` integer, required
    - `ram` integer, required
    - `customDspString` string: If the project latencyDevice has custom DSP hardware, this value contains a device specific latency metric (eg. cycles)

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
