---
title: "Validates a Composer version constraint"
method: POST
path: "/api/constraint"
tags: ["Packages"]
---

# Validates a Composer version constraint

`POST /api/constraint`

## Request body

- object
  - `constraint` string, required — The version constraint to validate.

## Response `200`

Validates a Composer version constraint

- ConstraintValidation
  - `valid` boolean
  - `error` string

## Other responses

- `400` — If no constraint is given.

## Changes

- **2025-03-06** `4dc3bf84edf7` — 2 info
  - the endpoint scheme security `CookieAuthentication` was added to the API
  - the endpoint scheme security `TokenAuthentication` was added to the API
- **2020-07-23** `42c41034504b` — 2 info
  - the endpoint scheme security `CookieAuthentication` was removed from the API
  - the endpoint scheme security `TokenAuthentication` was removed from the API

[Change history](https://skmtc.dev/contao/apis/contao-manager-api/changes/api/constraint/post.md)

---

[API](https://skmtc.dev/contao/apis/contao-manager-api.md) · [All operations](https://skmtc.dev/contao/apis/contao-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/contao/contao-manager-api/revisions/074d8046de13/schema)
