> ## 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.

# Get Terms Of Service

> Gets the Terms of Service for an organization.

`Unary` · [`Organizations`](https://ona.com/docs/api-reference/generated/organization/overview)

Gets the Terms of Service for an organization.

## Endpoint

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

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

## Request example

```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/GetTermsOfService" \
  --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.GetTermsOfServiceRequest(
    organization_id="<organization-id>",
)
response = ona.services.organization.get_terms_of_service(request)
print(response)
```

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

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetTermsOfServiceRequestSchema, {
    organizationId: "<organization-id>",
  });
  const response = await ona.services.organization.getTermsOfService(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.GetTermsOfServiceRequest{
		OrganizationId: "<organization-id>",
	})
	response, err := ona.Services.Organization.GetTermsOfService(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

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

## Request

`gitpod.v1.GetTermsOfServiceRequest`

| Field | Type | Required | Description |
| - | - | - | - |
| `organizationId` | string | Yes | Constraints: `required=true, string.uuid=true`. |

## Response

`gitpod.v1.GetTermsOfServiceResponse`

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

## Related types

> [accordion] 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] 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] 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`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.