diff --git a/content/en/entities/TermsOfService.md b/content/en/entities/TermsOfService.md new file mode 100644 index 0000000..0f96552 --- /dev/null +++ b/content/en/entities/TermsOfService.md @@ -0,0 +1,62 @@ +--- +title: TermsOfService +description: Represents the terms of service of the instance. +menu: + docs: + parent: entities +aliases: [ + "/entities/termsofservice", + "/entities/TermsOfService", + "/api/entities/termsofservice", + "/api/entities/TermsOfService", +] +--- + +## Example + +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` + +## Attributes + +### `effective_date` {#effective_date} + +**Description:** The date these terms of service are coming or have come in effect.\ +**Type:** String ([Date](/api/datetime-format#date))\ +**Version history:**\ +4.4.0 - added + +### `effective` {#effective} + +**Description:** Whether these terms of service are currently in effect.\ +**Type:** Boolean\ +**Version history:**\ +4.4.0 - added + +### `content` {#content} + +**Description:** The rendered HTML content of the terms of service.\ +**Type:** String (HTML)\ +**Version history:**\ +4.4.0 - added + +### `succeeded_by` {#succeeded_by} + +**Description:** If there are newer terms of service, their effective date.\ +**Type:** {{}} String ([Date](/api/datetime-format#date))\ +**Version history:**\ +4.4.0 - added + +## See also + +{{< page-relref ref="methods/instance#terms_of_service" caption="GET /api/v1/instance/terms_of_service" >}} + +{{< page-relref ref="methods/instance#terms_of_service_date" caption="GET /api/v1/instance/terms_of_service/:date" >}} + +{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/terms_of_service_serializer.rb" caption="app/serializers/rest/terms_of_service_serializer.rb" >}} diff --git a/content/en/methods/instance.md b/content/en/methods/instance.md index c144af9..edb2a20 100644 --- a/content/en/methods/instance.md +++ b/content/en/methods/instance.md @@ -549,7 +549,7 @@ GET /api/v1/instance/terms_of_service HTTP/1.1 Obtain the contents of this server's terms of service, if configured. -**Returns:** [PrivacyPolicy]({{< relref "entities/PrivacyPolicy" >}})\ +**Returns:** [TermsOfService]({{< relref "entities/TermsOfService" >}})\ **OAuth:** Public\ **Version history:**\ 4.4.0 - added @@ -558,7 +558,59 @@ Obtain the contents of this server's terms of service, if configured. ##### 200: OK +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` +##### 404: Not Found + +No terms of service have been configured for this instance. + +```json +{ + "error": "Record not found" +} +``` + +--- + +## View a specific version of the terms of service {#terms_of_service_date} + +```http +GET /api/v1/instance/terms_of_service/:date HTTP/1.1 +``` + +Obtain the contents of this server's terms of service, for a specified date, if configured. + +**Returns:** [TermsOfService]({{< relref "entities/TermsOfService" >}})\ +**OAuth:** Public\ +**Version history:**\ +4.4.0 - added + +#### Request + +##### Path parameters + +:date +: {{}} String. The effective date of the terms of service. + +#### Response + +##### 200: OK + +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` ##### 404: Not Found