> 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/tenant-settings/tenant.md). Agents can also search and read this documentation through its [MCP server](https://docs.thewalletcrew.io/~gitbook/mcp).

# Tenant

## List tenants

> Global Administrator only. Not paged. A tenant whose configuration cannot be read is listed as \`onboarding\` / \`test\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}}},"schemas":{"TenantDirectoryEntry":{"required":["tenantId"],"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant id; the `tenantId` of every tenant-scoped route."},"status":{"description":"Lifecycle status.","$ref":"#/components/schemas/TenantDirectoryStatus"},"purpose":{"description":"Tenant purpose.","$ref":"#/components/schemas/TenantDirectoryPurpose"}},"additionalProperties":false,"description":"A tenant of the directory."},"TenantDirectoryStatus":{"enum":["onboarding","active","disabled"],"type":"string","description":"Tenant lifecycle status, set by `status` in its configuration."},"TenantDirectoryPurpose":{"enum":["demo","test","production"],"type":"string","description":"Tenant purpose, set by `purpose` in its configuration. Informational."},"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/tenants":{"get":{"tags":["Tenant"],"summary":"List tenants","description":"Global Administrator only. Not paged. A tenant whose configuration cannot be read is listed as `onboarding` / `test`.","responses":{"200":{"description":"One entry per tenant, with status and purpose.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A tenant of the directory.","$ref":"#/components/schemas/TenantDirectoryEntry"}}},"application/json":{"schema":{"type":"array","items":{"description":"A tenant of the directory.","$ref":"#/components/schemas/TenantDirectoryEntry"}}},"text/json":{"schema":{"type":"array","items":{"description":"A tenant of the directory.","$ref":"#/components/schemas/TenantDirectoryEntry"}}}}},"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 does not hold the required role.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Export tenant configuration

> Zip of the configuration files, current or as of a past date. Always includes \`.version\` (per-file versions, used on upload to detect concurrent changes). Named \`{yyyyMMdd-HHmmss}\[-partial]-{tenantId}.fctwc\`, \`-partial\` when files is set; a filter matching nothing yields an archive with only \`.version\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration: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":{"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/tenants/{tenantId}":{"get":{"tags":["Tenant"],"summary":"Export tenant configuration","description":"Zip of the configuration files, current or as of a past date. Always includes `.version` (per-file versions, used on upload to detect concurrent changes). Named `{yyyyMMdd-HHmmss}[-partial]-{tenantId}.fctwc`, `-partial` when files is set; a filter matching nothing yields an archive with only `.version`.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}},{"name":"files","in":"query","description":"File paths to include, exact and case-sensitive, or with `*` wildcard (`layouts/*`). Default: all.","schema":{"type":"array","items":{"type":"string"}}},{"name":"datetime","in":"query","description":"Export the configuration as it was at this time. Default: current.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Zip archive (`application/zip`)."},"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:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant had no configuration at datetime, or no file matches files.","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"}]}}}}}}}}}
```

## Replace tenant configuration

> Replaces the whole configuration with a zip's files: differing files are written, files absent from the archive are deleted. Unless force is set, validation runs first and a file changed on the server since the archive's \`.version\` fails it. The server keeps its own \`.version\`. Emits the tenant configuration updated event when anything changed.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration: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":{"TenantConfigurationVersionInformation":{"type":"object","properties":{"version":{"type":"string","description":"Opaque token for the configuration as a whole, computed from Neo.Configuration.Tenants.TenantConfigurationVersionInformation.Files. It changes whenever any\nfile is written, added or deleted, so two equal values mean the same configuration; empty when the\ntenant has no file.","readOnly":true},"files":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Every configuration file, keyed by its path relative to the configuration root (e.g.\n`server/passes/loyalty.yml`), with a write stamp: the file's last modification time in Unix\nseconds, moved forward by one when two writes land in the same second, so it always increases."},"appliedMigrations":{"type":"array","items":{"type":"string"},"description":"Names of the platform's configuration upgrades this configuration is up to date with. An upgrade not\nlisted here is still to be applied."}},"additionalProperties":false,"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written."},"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/tenants/{tenantId}":{"post":{"tags":["Tenant"],"summary":"Replace tenant configuration","description":"Replaces the whole configuration with a zip's files: differing files are written, files absent from the archive are deleted. Unless force is set, validation runs first and a file changed on the server since the archive's `.version` fails it. The server keeps its own `.version`. Emits the tenant configuration updated event when anything changed.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}},{"name":"force","in":"query","description":"`true` to save even if validation fails or files changed on the server. Default `false`.","schema":{"type":"boolean"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Zip archive (multipart field `file`) of every configuration file.","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"Version of the saved configuration, with each file's version.","content":{"text/plain":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"application/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"text/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}}}},"400":{"description":"File missing, empty or not a zip, or validation failed (errors under `file`).","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: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"}]}}}}}}}}}
```

## Create a tenant

> From a zip of its configuration files. The configuration is validated first unless force is set. \`\_\_MACOSX\` entries, \`.DS\_Store\` files and folder entries are ignored.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration: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":{"TenantConfigurationVersionInformation":{"type":"object","properties":{"version":{"type":"string","description":"Opaque token for the configuration as a whole, computed from Neo.Configuration.Tenants.TenantConfigurationVersionInformation.Files. It changes whenever any\nfile is written, added or deleted, so two equal values mean the same configuration; empty when the\ntenant has no file.","readOnly":true},"files":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Every configuration file, keyed by its path relative to the configuration root (e.g.\n`server/passes/loyalty.yml`), with a write stamp: the file's last modification time in Unix\nseconds, moved forward by one when two writes land in the same second, so it always increases."},"appliedMigrations":{"type":"array","items":{"type":"string"},"description":"Names of the platform's configuration upgrades this configuration is up to date with. An upgrade not\nlisted here is still to be applied."}},"additionalProperties":false,"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written."},"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/tenants/{tenantId}":{"put":{"tags":["Tenant"],"summary":"Create a tenant","description":"From a zip of its configuration files. The configuration is validated first unless force is set. `__MACOSX` entries, `.DS_Store` files and folder entries are ignored.","parameters":[{"name":"tenantId","in":"path","description":"Id of the new tenant.","required":true,"schema":{"type":"string"}},{"name":"force","in":"query","description":"`true` to save even if validation fails. Default `false`.","schema":{"type":"boolean"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Zip archive (multipart field `file`) of every configuration file.","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"Version of the saved configuration, with each file's version.","content":{"text/plain":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"application/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"text/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}}}},"400":{"description":"File missing, empty or not a zip, or validation failed (errors under `file`).","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:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"Tenant already exists.","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"}]}}}}}}}}}
```

## Delete a tenant

> Global Administrator only. Deletes the tenant configuration; passes are kept. A \`PUT\` on the same id creates the tenant again.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}}},"schemas":{"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/tenants/{tenantId}":{"delete":{"tags":["Tenant"],"summary":"Delete a tenant","description":"Global Administrator only. Deletes the tenant configuration; passes are kept. A `PUT` on the same id creates the tenant again.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Configuration deleted."},"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 does not hold the required role.","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"}]}}}}}}}}}
```

## Patch tenant configuration files

> Each zip entry replaces the server file at its path; an empty entry deletes it; absent files are kept. The result is saved as by \`POST\`, including validation unless force is set.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration: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":{"TenantConfigurationVersionInformation":{"type":"object","properties":{"version":{"type":"string","description":"Opaque token for the configuration as a whole, computed from Neo.Configuration.Tenants.TenantConfigurationVersionInformation.Files. It changes whenever any\nfile is written, added or deleted, so two equal values mean the same configuration; empty when the\ntenant has no file.","readOnly":true},"files":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Every configuration file, keyed by its path relative to the configuration root (e.g.\n`server/passes/loyalty.yml`), with a write stamp: the file's last modification time in Unix\nseconds, moved forward by one when two writes land in the same second, so it always increases."},"appliedMigrations":{"type":"array","items":{"type":"string"},"description":"Names of the platform's configuration upgrades this configuration is up to date with. An upgrade not\nlisted here is still to be applied."}},"additionalProperties":false,"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written."},"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/tenants/{tenantId}":{"patch":{"tags":["Tenant"],"summary":"Patch tenant configuration files","description":"Each zip entry replaces the server file at its path; an empty entry deletes it; absent files are kept. The result is saved as by `POST`, including validation unless force is set.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}},{"name":"force","in":"query","description":"`true` to save even if validation fails. Default `false`.","schema":{"type":"boolean"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Zip archive (multipart field `file`) of the files to change.","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"Version of the saved configuration, with each file's version.","content":{"text/plain":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"application/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}},"text/json":{"schema":{"description":"Identifies one state of a tenant's whole configuration: which files exist and when each was last written.","$ref":"#/components/schemas/TenantConfigurationVersionInformation"}}}},"400":{"description":"File missing, empty or not a zip, or the resulting configuration fails validation (errors under `file`).","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:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant has no 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"}]}}}}}}}}}
```

## Get tenant layout configuration

> The tenant's base configuration merged with the named layout (layout wins), plus the public settings front-end apps need (sign-in providers, locales, public documents, analytics).

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/tenants/{tenantId}/{layoutId}":{"get":{"tags":["Tenant"],"summary":"Get tenant layout configuration","description":"The tenant's base configuration merged with the named layout (layout wins), plus the public settings front-end apps need (sign-in providers, locales, public documents, analytics).","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}},{"name":"layoutId","in":"path","description":"Layout name, without extension.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Merged configuration, as JSON.","content":{"text/plain":{"schema":{}},"application/json":{"schema":{}},"text/json":{"schema":{}}}},"401":{"description":"The layout can only be opened through one of the tenant's redirect links.","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"}]}}}},"404":{"description":"Tenant or layout does not exist.","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"}]}}}}}}}},"components":{"schemas":{"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":{}}}}}
```

## List tenant configuration history

> Saved versions, newest first, with changed files and author (display name and email when the user still exists; API keys show as \`API Key - {key name}\`). With files, only versions changing a matching file are listed and \`total\` counts those.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration: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":{"TenantConfigurationHistoryPage":{"type":"object","properties":{"offset":{"type":"integer","description":"Number of matching versions skipped before this page, as requested.","format":"int32"},"limit":{"type":"integer","description":"Maximum number of versions the page holds, as requested.","format":"int32"},"total":{"type":"integer","description":"Number of versions matching the request across all pages: every saved version without a file filter,\nonly those that changed a matching file with one. 0 when the tenant has no history.","format":"int32"},"items":{"type":"array","items":{"description":"One saved version of the configuration: who saved it, when, and which files it changed.","$ref":"#/components/schemas/TenantConfigurationHistoryEntry"},"description":"The versions on this page, newest first. Fewer than Neo.Configuration.Tenants.TenantConfigurationHistoryPage.Limit on the last page."}},"additionalProperties":false,"description":"One page of the saved versions of a tenant's configuration, newest first."},"TenantConfigurationHistoryEntry":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the stored configuration version."},"date":{"type":"string","description":"When the version was saved.","format":"date-time"},"user":{"description":"Who saved the version. Null when the save recorded no user.","$ref":"#/components/schemas/TenantConfigurationHistoryUser"},"files":{"type":"array","items":{"type":"string"},"description":"Paths of the files this version added, changed or deleted compared with the version before it, sorted.\nEvery file of the version when no earlier version can be read; empty when this version's own details\ncannot be read."}},"additionalProperties":false,"description":"One saved version of the configuration: who saved it, when, and which files it changed."},"TenantConfigurationHistoryUser":{"type":"object","properties":{"userName":{"type":["null","string"],"description":"Identifier recorded with the version: the user id, or `apiKey:` followed by the API key name."},"name":{"type":["null","string"],"description":"Display name: the user's name, or `API Key - ` followed by the key name. Null when the user no\nlonger exists."},"email":{"type":["null","string"],"description":"The user's email. Null for an API key or a user that no longer exists."}},"additionalProperties":false,"description":"The user or API key behind a configuration version."},"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/tenants/{tenantId}/config/history":{"get":{"tags":["Tenant"],"summary":"List tenant configuration history","description":"Saved versions, newest first, with changed files and author (display name and email when the user still exists; API keys show as `API Key - {key name}`). With files, only versions changing a matching file are listed and `total` counts those.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}},{"name":"files","in":"query","description":"File paths to filter on, case-insensitive, exact or with `*` wildcard. Default: all.","schema":{"type":"array","items":{"type":"string"}}},{"name":"offset","in":"query","description":"Versions to skip, 0 or more (negative returns 400). Default 0.","schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","description":"Maximum versions, 1 or more (otherwise 400). Default 50.","schema":{"type":"integer","format":"int32","default":50}}],"responses":{"200":{"description":"One page of history; possibly empty.","content":{"text/plain":{"schema":{"description":"One page of the saved versions of a tenant's configuration, newest first.","$ref":"#/components/schemas/TenantConfigurationHistoryPage"}},"application/json":{"schema":{"description":"One page of the saved versions of a tenant's configuration, newest first.","$ref":"#/components/schemas/TenantConfigurationHistoryPage"}},"text/json":{"schema":{"description":"One page of the saved versions of a tenant's configuration, newest first.","$ref":"#/components/schemas/TenantConfigurationHistoryPage"}}}},"400":{"description":"offset is negative or limit is not positive.","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: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"}]}}}}}}}}}
```

## Test tenant configuration

> Runs every configuration check. On success returns \`tenantId\` and \`user\` (the caller's \`userName\`, \`roles\`, \`permissions\`; otherwise \`null\`). On failure an authenticated caller gets the errors under the empty key of \`errors\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Tenant"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":[]},{"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":{"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/tenants/{tenantId}/test":{"get":{"tags":["Tenant"],"summary":"Test tenant configuration","description":"Runs every configuration check. On success returns `tenantId` and `user` (the caller's `userName`, `roles`, `permissions`; otherwise `null`). On failure an authenticated caller gets the errors under the empty key of `errors`.","parameters":[{"name":"tenantId","in":"path","description":"Tenant id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Configuration valid."},"400":{"description":"Configuration invalid; errors listed for an authenticated caller.","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 credentials sent are invalid.","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"}]}}}}}}}}}
```


---

# 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/tenant-settings/tenant.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.
