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

# Update Terms Of Service

> Updates the Terms of Service for an organization.

`Unary` · [`Organizations`](/docs/api-reference/generated/organization/overview)

Updates the Terms of Service for an organization.

## Endpoint

```text theme={null}
POST /api/gitpod.v1.OrganizationService/UpdateTermsOfService
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.OrganizationService/UpdateTermsOfService" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "organizationId": "<organization-id>"
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.organization_pb2 as organization_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = organization_pb2.UpdateTermsOfServiceRequest(
      organization_id="<organization-id>",
  )
  response = ona.services.organization.update_terms_of_service(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { UpdateTermsOfServiceRequestSchema } from "@gitpod/sdk/gitpod/v1/organization_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(UpdateTermsOfServiceRequestSchema, {
      organizationId: "<organization-id>",
    });
    const response = await ona.services.organization.updateTermsOfService(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.UpdateTermsOfServiceRequest{
  		OrganizationId: "<organization-id>",
  	})
  	response, err := ona.Services.Organization.UpdateTermsOfService(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "organizationId": "<organization-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.UpdateTermsOfServiceRequest`

| Field            | Type    | Required | Description                                                                         |
| ---------------- | ------- | -------- | ----------------------------------------------------------------------------------- |
| `organizationId` | string  | Yes      | Constraints: `required=true, string.uuid=true`.                                     |
| `markdown`       | string  | No       | markdown publishes a new version when changed. Constraints: `string.max_len=32000`. |
| `enabled`        | boolean | No       |                                                                                     |

## Response

`gitpod.v1.UpdateTermsOfServiceResponse`

| Field            | Type                                               | Required | Description                   |
| ---------------- | -------------------------------------------------- | -------- | ----------------------------- |
| `termsOfService` | [TermsOfService](#type-gitpod-v1-terms-of-service) | Yes      | Constraints: `required=true`. |

## Related types

<a id="type-gitpod-v1-terms-of-service" />

<Accordion title="TermsOfService">
  `gitpod.v1.TermsOfService`

  | Field                   | Type                                                                    | Required | Description                                                                          |
  | ----------------------- | ----------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------ |
  | `organizationId`        | string                                                                  | Yes      | Constraints: `required=true, string.uuid=true`.                                      |
  | `enabled`               | boolean                                                                 | No       |                                                                                      |
  | `currentVersion`        | [TermsOfServiceVersion](#type-gitpod-v1-terms-of-service-version)       | No       | current\_version is the active Terms of Service version, if one has been published.  |
  | `currentUserAcceptance` | [TermsOfServiceAcceptance](#type-gitpod-v1-terms-of-service-acceptance) | No       | current\_user\_acceptance is the caller's acceptance of the current version, if any. |
</Accordion>

<a id="type-gitpod-v1-terms-of-service-acceptance" />

<Accordion title="TermsOfServiceAcceptance">
  `gitpod.v1.TermsOfServiceAcceptance`

  | Field        | Type               | Required | Description                                     |
  | ------------ | ------------------ | -------- | ----------------------------------------------- |
  | `versionId`  | string             | Yes      | Constraints: `required=true, string.uuid=true`. |
  | `version`    | integer            | No       | Constraints: `int32.gte=1`.                     |
  | `acceptedAt` | RFC 3339 timestamp | Yes      | Constraints: `required=true`.                   |
</Accordion>

<a id="type-gitpod-v1-terms-of-service-version" />

<Accordion title="TermsOfServiceVersion">
  `gitpod.v1.TermsOfServiceVersion`

  | Field             | Type               | Required | Description                                     |
  | ----------------- | ------------------ | -------- | ----------------------------------------------- |
  | `id`              | string             | Yes      | Constraints: `required=true, string.uuid=true`. |
  | `version`         | integer            | No       | Constraints: `int32.gte=1`.                     |
  | `markdown`        | string             | No       | Constraints: `string.max_len=32000`.            |
  | `createdAt`       | RFC 3339 timestamp | Yes      | Constraints: `required=true`.                   |
  | `createdByUserId` | string             | Yes      | Constraints: `required=true, string.uuid=true`. |
</Accordion>
