---
title: "Set target constraints"
method: POST
path: "/api/{projectId}/target-constraints"
tags: ["Projects"]
---

# Set target constraints

`POST /api/{projectId}/target-constraints`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/target-constraints`
- 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/target-constraints/post.ts> (a function with typed inputs; its response is checked against the schema)

Set target constraints for a project. Use the constraints object to capture hardware attributes of your target device, along with an application budget to allow guidance on performance and resource usage

## Path parameters

- `projectId` integer, required

## Request body

- TargetConstraints
  - `selectedTargetBasedOn` 'user-configured' | 'default' | 'default-accepted' | 'recent-project' | 'connected-device': A type explaining how the target was chosen. If updating this manually, use the 'user-configured' type
  - `targetDevices` TargetConstraintsDevice[], required: The potential targets for the project, where each entry captures hardware attributes that allow target guidance throughout the Studio workflow. The first target in the list is considered as the selected target for the project.
    - `processors` TargetProcessor[]: Target processors
      - `part` string: The exact part number, if available
      - `format` string: Processor type, serving as a broad descriptor for the intended use-case
      - `architecture` string: Processor family, informing about the processor's instruction set and core design
      - `specificArchitecture` string: Processor architecture, informing about the specific processor, if known
      - `accelerator` string: Target accelerator, if any
      - `fpu` boolean: Does the target processor have a floating point unit
      - `clockRateMhz` ResourceRange: Describes range of expected availability for an arbitrary resource
        - `minimum` number
        - `maximum` number
      - `memory` TargetMemory: RAM and ROM specifications of target
        - `ram` MemorySpec: Describes performance characteristics of a particular memory type
          - `fastBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
            - `minimum` number
            - `maximum` number
          - `slowBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
            - `minimum` number
            - `maximum` number
        - `rom` MemorySpec: Describes performance characteristics of a particular memory type
          - `fastBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
            - `minimum` number
            - `maximum` number
          - `slowBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
            - `minimum` number
            - `maximum` number
    - `board` string: The exact dev board part number, if available
    - `name` string: Display name in Studio
    - `latencyDevice` string: MCU identifier, if available
  - `applicationBudgets` ApplicationBudget[], required: A list of application budgets to be configured based on target device. An application budget enables guidance on performance and resource usage. The first application budget in the list is considered as the selected budget for the project.
    - `latencyPerInferenceMs` ResourceRange: Describes range of expected availability for an arbitrary resource
      - `minimum` number
      - `maximum` number
    - `energyPerInferenceJoules` ResourceRange: Describes range of expected availability for an arbitrary resource
      - `minimum` number
      - `maximum` number
    - `memoryOverhead` TargetMemory: RAM and ROM specifications of target
      - `ram` MemorySpec: Describes performance characteristics of a particular memory type
        - `fastBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
          - `minimum` number
          - `maximum` number
        - `slowBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
          - `minimum` number
          - `maximum` number
      - `rom` MemorySpec: Describes performance characteristics of a particular memory type
        - `fastBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
          - `minimum` number
          - `maximum` number
        - `slowBytes` ResourceRange: Describes range of expected availability for an arbitrary resource
          - `minimum` number
          - `maximum` number

## Response `200`

OK

- GenericApiResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)

---

[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)
