> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Legal Terms

> Record the customer's acceptance of the general terms and any pending contract terms.

# Accept Legal Terms

Records that the authenticated customer has accepted the current general terms and conditions, and optionally any pending contract-specific terms. The portal calls this endpoint when a customer clicks "Accept" on the legal terms modal that is shown when `MustAgreeToTerms` is `true` on the `/api/public/legal/status` response.

## Authentication

Requires a valid customer bearer token.

## Request Body

Send an empty body or a JSON object indicating the accepted terms. The portal typically posts with no body after the customer explicitly accepts on-screen.

```http theme={null}
POST /api/public/legal/accept
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json
```

## Response

Returns an `ActionConfirmation` envelope.

<ResponseField name="WasSuccessful" type="boolean">
  `true` when the acceptance was recorded. The terms modal should be dismissed and the customer should be granted access to the portal.
</ResponseField>

<ResponseField name="Value" type="string | null">
  Usually `null` on success.
</ResponseField>

<ResponseField name="Status" type="number">
  HTTP-style status code mirrored in the body. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string | null">
  Human-readable message. Usually `null` on success.
</ResponseField>

<ResponseField name="Errors" type="any">
  Validation errors. `null` on success.
</ResponseField>

## Example Response

```json theme={null}
{
  "WasSuccessful": true,
  "Value": null,
  "Status": 200,
  "Message": null,
  "Errors": null
}
```

## TypeScript Integration

```typescript theme={null}
import endpoints from '@/api/endpoints'
import { ActionConfirmation } from '@/types/ActionConfirmation'

const url = endpoints.system.accept_terms()
// => '/api/public/legal/accept'

const response = await httpClient.post<ActionConfirmation>(url)

if (response.data.WasSuccessful) {
  // Dismiss the legal terms modal and continue
}
```

## Usage in Portal

| Context                      | Source file                                   |
| ---------------------------- | --------------------------------------------- |
| Legal terms acceptance modal | `src/components/LegalTerms/` or app bootstrap |

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The bearer token is missing, expired, or invalid.
</ResponseField>

<ResponseField name="400 Bad Request" type="error">
  The request is malformed or there are no pending terms to accept.
</ResponseField>

## Related Endpoints

| Method | Endpoint                   | Description                                    |
| ------ | -------------------------- | ---------------------------------------------- |
| `GET`  | `/api/public/legal/status` | Check whether the customer must agree to terms |
