> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/update-the-visitor-attributes-json-schema-for-an-adaptive-content-site.md).

# Update the visitor attributes JSON schema for an adaptive content site

Replaces the JSON schema that defines expected visitor attributes for adaptive content. The schema controls which attributes (e.g., role, subscription tier) can be used in conditional expressions to show or hide content for specific visitors. After updating, existing conditional expressions are evaluated against the new schema.

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]},{"integration":[]},{"integration-installation":[]},{"oauth":["site:write"]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"},"integration":{"type":"http","scheme":"bearer"},"integration-installation":{"type":"http","scheme":"bearer"},"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://oauth.gitbook.com/authorize","tokenUrl":"https://oauth.gitbook.com/token","scopes":{"user:read":"Read your GitBook user profile.","organization:read":"Read organization settings and metadata.","organization:write":"Create and update organization settings.","organization:members:read":"Read organization members, invites and link invites.","organization:members:write":"Manage organization members, invites and link invites.","organization:ask":"Ask AI questions across an organization's content.","organization:search":"Search across an organization's content.","space:read":"Read spaces and their content.","space:write":"Create, update and delete spaces and their content, including imports.","space:permissions:read":"Read space permissions.","space:permissions:write":"Manage space permissions.","change-request:merge":"Merge change requests, publishing their changes to the space.","site:read":"Read sites and their settings.","site:write":"Create, update and delete sites, sections and their settings.","site:publish":"Publish and unpublish sites, controlling their public exposure.","site:permissions:read":"Read site permissions.","site:permissions:write":"Manage site permissions.","site:auth:read":"Read site authentication and security configuration.","site:auth:write":"Manage site authentication and security configuration.","site:insights:read":"Read site analytics and insights.","site:ask":"Ask AI questions across a site's content.","site:search":"Search across a site's content.","openapi:read":"Read OpenAPI specifications.","openapi:write":"Create, update and delete OpenAPI specifications."}}}}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"SiteAdaptiveJSONSchema":{"type":"object","description":"JSON schema describing the expected attributes of an Adaptive site schema.","properties":{"$schema":{"type":"string","enum":["http://json-schema.org/draft-07/schema#"]},"type":{"type":"string","enum":["object"]},"properties":{"type":"object","properties":{"unsigned":{"type":"object","description":"Unsigned claims of the site visitor.","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string","enum":["Unsigned claims of the site visitor."]},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"]}},"additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","properties","additionalProperties"],"additionalProperties":false},"SiteAdaptiveJSONSchemaClaimsProperties":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["array"]},"description":{"type":"string"},"items":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"}},"required":["type","description","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"],"additionalProperties":false}]},"SiteAdaptiveJSONSchemaPrimitives":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveDeterministicJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false}]},"SiteAdaptiveDeterministicJSONSchemaPrimitives":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"enum":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["type","enum","description"],"additionalProperties":false}]},"SiteAdaptiveSchema":{"type":"object","properties":{"object":{"type":"string","enum":["site-adaptive-schema"]},"jsonSchema":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchema"},"updatedAt":{"description":"When the adaptive schema was updated.","$ref":"#/components/schemas/Timestamp"}},"required":["object","jsonSchema","updatedAt"]},"Timestamp":{"type":"string","format":"date-time"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"required":["code","message"]}}}},"responses":{"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[400]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"UnexpectedError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/adaptive-schema":{"put":{"operationId":"updateSiteAdaptiveSchema","summary":"Update the visitor attributes JSON schema for an adaptive content site","description":"Replaces the JSON schema that defines expected visitor attributes for adaptive content. The schema controls which attributes (e.g., role, subscription tier) can be used in conditional expressions to show or hide content for specific visitors. After updating, existing conditional expressions are evaluated against the new schema.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonSchema":{"description":"The JSON schema to set on the site.","$ref":"#/components/schemas/SiteAdaptiveJSONSchema"}},"required":["jsonSchema"]}}}},"responses":{"200":{"description":"The site adaptive schema has been updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteAdaptiveSchema"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"default":{"$ref":"#/components/responses/UnexpectedError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/update-the-visitor-attributes-json-schema-for-an-adaptive-content-site.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
