> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/api-reference/internal/access-and-security/security.md). Agents can also search and read this documentation through its [MCP server](https://docs.thewalletcrew.io/~gitbook/mcp).

# Security

## Generate customer tokens

> Requires \`tenant.authenticationToken:write\`. Tokens are accepted like those from \`customer/authenticate\` and act as that holder until they expire. Example body: \`\[\[{"type": "email", "value": "<jane@example.com>"}]]\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Security"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.authenticationToken:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"WebClaim":{"type":"object","properties":{"type":{"type":"string","description":"Claim name, e.g. `email` or a customer directory field."},"value":{"type":"string","description":"Claim value, as text."},"valueType":{"type":["null","string"],"description":"Claim value-type URI (e.g. `http://www.w3.org/2001/XMLSchema#integer`); null for string."}},"additionalProperties":false,"description":"Claim to put in a generated token."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/tokens/generate":{"post":{"tags":["Security"],"summary":"Generate customer tokens","description":"Requires `tenant.authenticationToken:write`. Tokens are accepted like those from `customer/authenticate` and act as that holder until they expire. Example body: `[[{\"type\": \"email\", \"value\": \"jane@example.com\"}]]`.","parameters":[{"name":"validityDuration","in":"query","description":"Query `validityDuration`: positive duration `d.hh:mm:ss` (e.g. `30.00:00:00`). Default 10 years.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Claim sets; one token per set, in order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"array","items":{"description":"Claim to put in a generated token.","$ref":"#/components/schemas/WebClaim"}}}},"text/json":{"schema":{"type":"array","items":{"type":"array","items":{"description":"Claim to put in a generated token.","$ref":"#/components/schemas/WebClaim"}}}},"application/*+json":{"schema":{"type":"array","items":{"type":"array","items":{"description":"Claim to put in a generated token.","$ref":"#/components/schemas/WebClaim"}}}}}},"responses":{"200":{"description":"Tokens, in claim set order.","content":{"text/plain":{"schema":{"type":"array","items":{"type":"string"}}},"application/json":{"schema":{"type":"array","items":{"type":"string"}}},"text/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"`validityDuration` is not a positive duration, or a claim type is reserved by the platform.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.authenticationToken:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Get check-in policy

> Returns \`full\` when no policy is configured.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Security"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.enrolment:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CheckinPolicyDefinition":{"required":["mode"],"type":"object","properties":{"mode":{"description":"Policy in force; `full` when none is configured.","$ref":"#/components/schemas/CheckinPolicyMode"}},"additionalProperties":false,"description":"Check-in policy in force."},"CheckinPolicyMode":{"enum":["noIdentification","none","partial","full"],"type":"string","description":"Identification required from a customer collecting a pass through an enrolment form."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/security/checkinPolicy":{"get":{"tags":["Security"],"summary":"Get check-in policy","description":"Returns `full` when no policy is configured.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Check-in policy returned.","content":{"text/plain":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}},"application/json":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}},"text/json":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.configuration.enrolment:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Update check-in policy

> Applies to every enrolment form of the tenant from the next registration. Example: \`{ "mode": "partial" }\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Security"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.enrolment:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"UpdateCheckinPolicyRequest":{"required":["mode"],"type":"object","properties":{"mode":{"description":"Policy to apply from now on, to every enrolment form of the tenant.","$ref":"#/components/schemas/CheckinPolicyMode"}},"additionalProperties":false,"description":"Request body to configure the check-in policy."},"CheckinPolicyMode":{"enum":["noIdentification","none","partial","full"],"type":"string","description":"Identification required from a customer collecting a pass through an enrolment form."},"CheckinPolicyDefinition":{"required":["mode"],"type":"object","properties":{"mode":{"description":"Policy in force; `full` when none is configured.","$ref":"#/components/schemas/CheckinPolicyMode"}},"additionalProperties":false,"description":"Check-in policy in force."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/security/checkinPolicy":{"put":{"tags":["Security"],"summary":"Update check-in policy","description":"Applies to every enrolment form of the tenant from the next registration. Example: `{ \"mode\": \"partial\" }`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The policy to apply.","content":{"application/json":{"schema":{"description":"Request body to configure the check-in policy.","$ref":"#/components/schemas/UpdateCheckinPolicyRequest"}},"text/json":{"schema":{"description":"Request body to configure the check-in policy.","$ref":"#/components/schemas/UpdateCheckinPolicyRequest"}},"application/*+json":{"schema":{"description":"Request body to configure the check-in policy.","$ref":"#/components/schemas/UpdateCheckinPolicyRequest"}}},"required":true},"responses":{"200":{"description":"Check-in policy updated.","content":{"text/plain":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}},"application/json":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}},"text/json":{"schema":{"description":"Check-in policy in force.","$ref":"#/components/schemas/CheckinPolicyDefinition"}}}},"400":{"description":"The mode is missing or unsupported.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.configuration.enrolment:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Get general secrets

> Returns \`secret1\` and \`secret2\`. Requires \`tenant.generalSecret:write\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Security"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.generalSecret:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"GeneralSecretsDefinition":{"type":"object","properties":{"secret1":{"type":["null","string"],"description":"Primary secret. Null when empty."},"secret2":{"type":["null","string"],"description":"Secondary secret, kept while the primary is rotated. Null when empty."}},"additionalProperties":false,"description":"General secrets of the tenant."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/security/secrets":{"get":{"tags":["Security"],"summary":"Get general secrets","description":"Returns `secret1` and `secret2`. Requires `tenant.generalSecret:write`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"General secrets returned.","content":{"text/plain":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}},"application/json":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}},"text/json":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.generalSecret:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant has no readable security configuration.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Update general secrets

> Replaces both secrets on every call, so send back the current value of the one you keep. Rotating a secret invalidates what was signed with it. To rotate without a cut-over, move the current \`secret1\` to \`secret2\` and set a new \`secret1\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Security"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.generalSecret:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"UpdateGeneralSecretsRequest":{"required":["secret1","secret2"],"type":"object","properties":{"secret1":{"minLength":1,"type":"string","description":"New primary secret; required, not empty."},"secret2":{"minLength":1,"type":"string","description":"New secondary secret; required, not empty."}},"additionalProperties":false,"description":"Request body to configure the general secrets. Both values are replaced."},"GeneralSecretsDefinition":{"type":"object","properties":{"secret1":{"type":["null","string"],"description":"Primary secret. Null when empty."},"secret2":{"type":["null","string"],"description":"Secondary secret, kept while the primary is rotated. Null when empty."}},"additionalProperties":false,"description":"General secrets of the tenant."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/security/secrets":{"put":{"tags":["Security"],"summary":"Update general secrets","description":"Replaces both secrets on every call, so send back the current value of the one you keep. Rotating a secret invalidates what was signed with it. To rotate without a cut-over, move the current `secret1` to `secret2` and set a new `secret1`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Both secrets.","content":{"application/json":{"schema":{"description":"Request body to configure the general secrets. Both values are replaced.","$ref":"#/components/schemas/UpdateGeneralSecretsRequest"}},"text/json":{"schema":{"description":"Request body to configure the general secrets. Both values are replaced.","$ref":"#/components/schemas/UpdateGeneralSecretsRequest"}},"application/*+json":{"schema":{"description":"Request body to configure the general secrets. Both values are replaced.","$ref":"#/components/schemas/UpdateGeneralSecretsRequest"}}},"required":true},"responses":{"200":{"description":"General secrets updated.","content":{"text/plain":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}},"application/json":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}},"text/json":{"schema":{"description":"General secrets of the tenant.","$ref":"#/components/schemas/GeneralSecretsDefinition"}}}},"400":{"description":"A secret is missing or empty.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.generalSecret:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant has no security configuration, or it cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/api-reference/internal/access-and-security/security.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
