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

# SFTP

## List SFTP files

> Empty list, not an error, when the tenant has no SFTP inbox.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Sftp"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.sftp: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":{"SftpFileResponse":{"required":["blobPath","fileName","lastModified","sizeInBytes","status"],"type":"object","properties":{"fileName":{"type":"string","description":"File name as dropped by the customer."},"status":{"type":"string","description":"One of `pending`, `processed`, `error`."},"sizeInBytes":{"type":"integer","description":"File size in bytes.","format":"int64"},"lastModified":{"type":"string","description":"When last written, in UTC.","format":"date-time"},"blobPath":{"type":"string","description":"File run identifier for the import-log and download endpoints. Unique even when a file name is imported several times."}},"additionalProperties":false,"description":"A file in the tenant's SFTP inbox."},"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/sftp/files":{"get":{"tags":["Sftp"],"summary":"List SFTP files","description":"Empty list, not an error, when the tenant has no SFTP inbox.","parameters":[{"name":"status","in":"query","description":"Optional filter: `pending`, `processed` or `error`.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File list returned.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A file in the tenant's SFTP inbox.","$ref":"#/components/schemas/SftpFileResponse"}}},"application/json":{"schema":{"type":"array","items":{"description":"A file in the tenant's SFTP inbox.","$ref":"#/components/schemas/SftpFileResponse"}}},"text/json":{"schema":{"type":"array","items":{"description":"A file in the tenant's SFTP inbox.","$ref":"#/components/schemas/SftpFileResponse"}}}}},"400":{"description":"Invalid status filter.","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.sftp: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"}]}}}}}}}}}
```

## Download SFTP file

> Streams the file exactly as dropped, as an attachment; gzip-compressed when the caller sends \`Accept-Encoding: gzip\` (transport compression only).\
> Requires \`tenant.sftp:download\`; \`tenant.sftp:read\` never gives access to the file's customer data.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Sftp"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.sftp:download"]},{"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/{tenantId}/admin/sftp/files/content":{"get":{"tags":["Sftp"],"summary":"Download SFTP file","description":"Streams the file exactly as dropped, as an attachment; gzip-compressed when the caller sends `Accept-Encoding: gzip` (transport compression only).\nRequires `tenant.sftp:download`; `tenant.sftp:read` never gives access to the file's customer data.","parameters":[{"name":"blobPath","in":"query","description":"File run identifier, as returned in `blobPath` by the files list.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File content returned as an attachment.","content":{"text/plain":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}},"text/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"`blobPath` is missing.","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.sftp:download` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No file with this `blobPath` in the inbox. A pending file gets a new `blobPath` once imported: list the files again, or the tenant 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"}]}}}}}}}}}
```

## Get SFTP import log

> Whether the import ran cleanly, aggregate row counts, and a per-pass breakdown with failure reasons.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Sftp"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.sftp: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":{"SftpImportLogResponse":{"required":["ignoredColumns","passOutcomes","refusals","status"],"type":"object","properties":{"status":{"type":"string","description":"File status: `pending`, `processed` or `error`."},"runState":{"type":["null","string"],"description":"How the import run ended: `completed`, `failed`, `interrupted` (its end never reached telemetry) or `notRecordedYet` (imported minutes ago, end not in telemetry yet). Null when\nno run is recorded: the file is pending, never finished uploading, or was imported before runs were recorded."},"failureReason":{"type":["null","string"],"description":"Why a failed run stopped: `invalidFile`, `canceled` or `unexpected`."},"rowCount":{"type":["null","integer"],"description":"Rows read from the file.","format":"int32"},"appliedCount":{"type":["null","integer"],"description":"Rows that queued an update of at least one pass.","format":"int32"},"noMatchCount":{"type":["null","integer"],"description":"Rows matching no pass (a data-quality signal, not a technical failure).","format":"int32"},"refusedCount":{"type":["null","integer"],"description":"Rows refused before anything was queued; `refusals` says why.","format":"int32"},"failedCount":{"type":["null","integer"],"description":"Rows that hit a technical error.","format":"int32"},"passCount":{"type":["null","integer"],"description":"Pass updates queued; one row can identify several passes.","format":"int32"},"refusals":{"type":"array","items":{"description":"One reason rows of an imported file were refused.","$ref":"#/components/schemas/SftpRefusalResponse"},"description":"The most frequent reasons rows were refused, at most ten."},"ignoredColumns":{"type":"array","items":{"type":"string"},"description":"Columns of the file that are not recognised, a misspelled one for instance; their values were ignored."},"passOutcomes":{"type":"array","items":{"description":"Outcome of one pass update queued by an imported file.","$ref":"#/components/schemas/SftpPassOutcomeResponse"},"description":"One entry per pass update that has run; empty until they run."}},"additionalProperties":false,"description":"What happened when one SFTP file was imported."},"SftpRefusalResponse":{"required":["reason","rowCount"],"type":"object","properties":{"reason":{"type":"string","description":"Why, e.g. `Unknown theme 'summer-2025'`."},"rowCount":{"type":"integer","description":"How many rows were refused for it.","format":"int32"}},"additionalProperties":false,"description":"One reason rows of an imported file were refused."},"SftpPassOutcomeResponse":{"required":["outcome","passId"],"type":"object","properties":{"passId":{"type":"string","description":"The pass."},"outcome":{"type":"string","description":"`updated`, `skipped` (another update, or an earlier attempt of this one, reached the pass first), `notFound`, `canceled` or `failed`."},"errorMessage":{"type":["null","string"],"description":"Why the update failed; null unless `outcome` is `failed`."}},"additionalProperties":false,"description":"Outcome of one pass update queued by an imported file."},"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/sftp/files/log":{"get":{"tags":["Sftp"],"summary":"Get SFTP import log","description":"Whether the import ran cleanly, aggregate row counts, and a per-pass breakdown with failure reasons.","parameters":[{"name":"blobPath","in":"query","description":"File run identifier, as returned in `blobPath` by the files list.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Import log returned.","content":{"text/plain":{"schema":{"description":"What happened when one SFTP file was imported.","$ref":"#/components/schemas/SftpImportLogResponse"}},"application/json":{"schema":{"description":"What happened when one SFTP file was imported.","$ref":"#/components/schemas/SftpImportLogResponse"}},"text/json":{"schema":{"description":"What happened when one SFTP file was imported.","$ref":"#/components/schemas/SftpImportLogResponse"}}}},"400":{"description":"`blobPath` is missing.","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.sftp:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No file with this `blobPath` in the inbox, or the tenant 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"}]}}}}}}}}}
```

## Get SFTP status

> A tenant with no SFTP inbox returns \`sftpEnabled: false\`, never a 404.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Sftp"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.sftp: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":{"SftpStatusResponse":{"required":["sftpEnabled"],"type":"object","properties":{"sftpEnabled":{"type":"boolean","description":"`false` when the tenant has no SFTP inbox (the normal case); every other field is then null."},"pendingCount":{"type":["null","integer"],"description":"Files dropped, not yet imported.","format":"int32"},"processedCount":{"type":["null","integer"],"description":"Files imported without a technical failure.","format":"int32"},"errorCount":{"type":["null","integer"],"description":"Files whose import failed.","format":"int32"},"lastActivity":{"type":["null","string"],"description":"Most recent write to any file; null when the inbox is empty.","format":"date-time"}},"additionalProperties":false,"description":"SFTP activity summary."},"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/sftp/status":{"get":{"tags":["Sftp"],"summary":"Get SFTP status","description":"A tenant with no SFTP inbox returns `sftpEnabled: false`, never a 404.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status returned.","content":{"text/plain":{"schema":{"description":"SFTP activity summary.","$ref":"#/components/schemas/SftpStatusResponse"}},"application/json":{"schema":{"description":"SFTP activity summary.","$ref":"#/components/schemas/SftpStatusResponse"}},"text/json":{"schema":{"description":"SFTP activity summary.","$ref":"#/components/schemas/SftpStatusResponse"}}}},"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.sftp: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"}]}}}}}}}}}
```


---

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