# Get committed hours for an opportunity (https://terac.com/docs/developers/reference/getOpportunityCommitments)

`GET https://terac.com/api/external/v2/opportunities/{opportunityId}/commitments`

The hours each expert has committed to working on this opportunity, from the weekly plan they keep on Terac, as it stands now. One row per expert, keyed by their submission, with the committed blocks that overlap the window and the committed time inside it. Only blocks planned for this opportunity are returned. An expert with nothing committed in the window has no row. Compare with `GET /opportunities/{opportunityId}/hours` for the hours they tracked.

## Authorization

Requires a Bearer token via the `Authorization` header.

```
Authorization: Bearer <token>
```

## Path Parameters

- `opportunityId` (string) **(required)**: ID of the opportunity, as returned by `POST /opportunities` or `GET /opportunities`.

## Query Parameters

- `from` (string) **(required)**: Start of the window, inclusive: an ISO 8601 UTC timestamp such as `2026-11-30T00:00:00Z`, or a bare `2026-11-30` read as midnight UTC. A committed block is returned when any part of it falls in the window.
- `to` (string) **(required)**: End of the window, exclusive, in the same UTC form. At most 62 days after `from`.

## Responses

### 200: Committed blocks and committed time per expert, with the total for the window.

- `total_seconds` (integer) **(required)**: Every row's `committed_seconds` added together.
- `total_hours` (number) **(required)**: `total_seconds` converted once and rounded to two decimals.
- `data` (array) **(required)**
  - `submission_id` (string) **(required)**: The submission this expert holds on this opportunity.
  - `committed_seconds` (integer) **(required)**: Seconds of this expert's blocks that fall inside the window. A block crossing either edge counts only its part inside.
  - `committed_hours` (number) **(required)**: `committed_seconds` converted once and rounded to two decimals.
  - `blocks` (array) **(required)**: Every block of this opportunity's plan that overlaps the window, whole and in start order.
    - `starts_at` (string) **(required)**: When the committed block starts, as an ISO 8601 UTC timestamp.
    - `ends_at` (string) **(required)**: When the committed block ends, as an ISO 8601 UTC timestamp, exclusive.
### 400: Invalid input data

- `message` (string) **(required)**: The error message
- `code` (string) **(required)**: The error code
- `issues` (array): An array of issues that were responsible for the error
  - `message` (string) **(required)**
### 401: The API key is missing, invalid, disabled, expired or revoked, its owner no longer exists, or it is not linked to an organization. The body is nested under `error`.

- `error` (object) **(required)**
  - `code` (string) **(required)**: one of: `UNAUTHORIZED`: The error code.
  - `message` (string) **(required)**: What went wrong.
### 403: Either the account that owns the API key is banned or deleted (from the key check, nested under `error`), or the key's owner lacks the organization permission this operation needs (from the operation, with `code` and `message` at the top level).

- One of: API key error (403)
  - `error` (object) **(required)**
    - `code` (string) **(required)**: one of: `FORBIDDEN`: The error code.
    - `message` (string) **(required)**: What went wrong.
- One of: Insufficient access error (403)
  - `message` (string) **(required)**: The error message
  - `code` (string) **(required)**: The error code
  - `issues` (array): An array of issues that were responsible for the error
    - `message` (string) **(required)**
### 404: Not found

- `message` (string) **(required)**: The error message
- `code` (string) **(required)**: The error code
- `issues` (array): An array of issues that were responsible for the error
  - `message` (string) **(required)**
### 429: The API key is rate limited. A key accepts 100 requests, then refuses every request until more than 60 seconds pass with no accepted request; refused requests do not extend the wait. Wait the number of seconds in `Retry-After`, then retry. The body is nested under `error`.

- `error` (object) **(required)**
  - `code` (string) **(required)**: one of: `RATE_LIMITED`: The error code.
  - `message` (string) **(required)**: What went wrong.
### 500: Internal server error

- `message` (string) **(required)**: The error message
- `code` (string) **(required)**: The error code
- `issues` (array): An array of issues that were responsible for the error
  - `message` (string) **(required)**