# Answers HTTP API

Inputs, results, permissions and errors for the answers endpoints.

Use the server URL of your own deployment. Worker examples require a currently valid bearer token; provider callbacks use native signatures. `REPLACE_WITH_RETURNED_ID` values refer to IDs obtained through setup or prior operations. [Headless setup](https://beepgrid.com/docs/start/headless.md) supplies the credentials and entities.

<a id="get-api-v1-answers"></a>

## Find currently usable published informational answers

`GET /api/v1/answers`

Find currently usable published informational answers.

**Authorization:** Current authorized reader, or publisher with manage answer authority. Reuse requires audience membership and current source/publisher authority.


### Result and recovery

SharedAnswer array filtered by current source/publisher authority, audience and validity.

Expired, invalidated or unauthorized sources cannot be reused. An approval or task outcome cannot be published as a reusable informational answer.

Response media type: `application/json`. Array result.

[SharedAnswer](https://beepgrid.com/docs/reference/models/#sharedanswer)


### HTTP usage

Fill the shown IDs and operation fields for your own test workspace. Keep the same saved operation key for a retry.

```sh
curl --fail-with-body --silent --show-error -X GET "$BEEPGRID_URL/api/v1/answers" \
  -H "Authorization: Bearer $BEEPGRID_TOKEN"
```

<a id="post-api-v1-answers"></a>

## Publish an existing resolved question's answer for an explicit audience

`POST /api/v1/answers`

Publish an existing resolved question's answer for an explicit audience.

**Authorization:** Current authorized reader, or publisher with manage answer authority. Reuse requires audience membership and current source/publisher authority.


### Input

Content-Type: `application/json`.

[PublishAnswer](https://beepgrid.com/docs/reference/models/#publishanswer)

### Result and recovery

SharedAnswer with source provenance, context hash and validity.

Expired, invalidated or unauthorized sources cannot be reused. An approval or task outcome cannot be published as a reusable informational answer.

Response media type: `application/json`. [SharedAnswer](https://beepgrid.com/docs/reference/models/#sharedanswer)


### HTTP usage

Fill the shown IDs and operation fields for your own test workspace. Keep the same saved operation key for a retry.

```sh
curl --fail-with-body --silent --show-error -X POST "$BEEPGRID_URL/api/v1/answers" \
  -H "Authorization: Bearer $BEEPGRID_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"request_id":"REPLACE_WITH_RETURNED_ID","audience":["value"]}'
```

<a id="post-api-v1-answers-id-invalidate"></a>

## Invalidate a published informational answer

`POST /api/v1/answers/{id}/invalidate`

Invalidate a published informational answer.

**Authorization:** Current authorized reader, or publisher with manage answer authority. Reuse requires audience membership and current source/publisher authority.

| Parameter | Location | Usage |
| --- | --- | --- |
| `id` | path (required) | Stable identifier returned by the engine. Treat it as opaque. |


### Input

Content-Type: `application/json`.

`object`. See the operation-specific result contract.

### Result and recovery

`{invalidated: true}` after the authorized change commits. This acknowledgment does not contain an updated resource or prove business execution.

Expired, invalidated or unauthorized sources cannot be reused. An approval or task outcome cannot be published as a reusable informational answer.

Response media type: `application/json`. | Field | Type | Usage |
| --- | --- | --- |
| `invalidated` | `boolean` | True after the operation succeeds. |


### HTTP usage

Fill the shown IDs and operation fields for your own test workspace. Keep the same saved operation key for a retry.

```sh
curl --fail-with-body --silent --show-error -X POST "$BEEPGRID_URL/api/v1/answers/${id}/invalidate" \
  -H "Authorization: Bearer $BEEPGRID_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{}'
```
