> ## Documentation Index
> Fetch the complete documentation index at: https://help.narmi.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Create a signed request for uploading a file to S3
> Creates the payload for a signed request to upload a file directly to S3. Further documentation can be found via the AWS documentation: https://aws.amazon.com/blogs/compute/uploading-to-amazon-s3-directly-from-a-web-or-mobile-application/
All monetary values are represented in minor units, or the smallest unit of the currency with no decimal (e.g., cents). For example, $10.00 is represented as 1000.
How can we improve these docs? Share your feedback.
## OpenAPI
````json POST /v1/thread_files/policies/
{
"openapi": "3.0.3",
"info": {
"title": "Narmi Public API",
"version": "v1 (main)",
"description": "To read about Public API access and authentication, go to [API Overview](https://docs.narmi.com/docs/narmi-developer-docs/xl9dvbz84o11l-introduction).\n\n### Content types\n\nRequests and responses default to JSON. To use [TOON](https://toonformat.dev/) (Token-Oriented Object Notation), a compact, lossless encoding of JSON that uses fewer tokens in LLM contexts, send `Content-Type: application/toon` for request bodies and `Accept: application/toon` for responses.",
"termsOfService": "https://www.narmi.com/policies/developer-terms-conditions",
"contact": {
"name": "Narmi Support",
"email": "support@narmi.com"
}
},
"servers": [
{
"url": "https://api.sandbox.narmi.dev/",
"description": ""
}
],
"tags": [
{
"name": "accessibility"
},
{
"name": "account balances"
},
{
"name": "account opening"
},
{
"name": "accounts"
},
{
"name": "ach companies"
},
{
"name": "ach destinations"
},
{
"name": "ach import"
},
{
"name": "ach nacha passthrough"
},
{
"name": "ach payments"
},
{
"name": "ach transfers"
},
{
"name": "alerts"
},
{
"name": "automatic savings enrollment"
},
{
"name": "bill pay"
},
{
"name": "bulk payment templates"
},
{
"name": "bulk payments"
},
{
"name": "card linked offers"
},
{
"name": "cards"
},
{
"name": "data access management"
},
{
"name": "deposits"
},
{
"name": "documents"
},
{
"name": "enrollments"
},
{
"name": "express-checkout"
},
{
"name": "external transactions"
},
{
"name": "fedwire destinations"
},
{
"name": "fedwire templates"
},
{
"name": "file imports"
},
{
"name": "income source"
},
{
"name": "instant transfers"
},
{
"name": "institution"
},
{
"name": "international wires"
},
{
"name": "invoices"
},
{
"name": "loan autopay"
},
{
"name": "me"
},
{
"name": "merchants"
},
{
"name": "mfa"
},
{
"name": "payees"
},
{
"name": "payments"
},
{
"name": "ping"
},
{
"name": "receipts"
},
{
"name": "recipients"
},
{
"name": "reports"
},
{
"name": "same-day transfers"
},
{
"name": "scheduled transfers"
},
{
"name": "search"
},
{
"name": "subscriptions"
},
{
"name": "support"
},
{
"name": "surveys"
},
{
"name": "swift transactions"
},
{
"name": "swift wire templates"
},
{
"name": "teams"
},
{
"name": "threads"
},
{
"name": "transactions"
},
{
"name": "unverified ach reversals"
},
{
"name": "unverified ach transactions"
},
{
"name": "users"
},
{
"name": "whatismyip"
},
{
"name": "wire import"
},
{
"name": "wire recipients"
},
{
"name": "wires"
}
],
"x-stoplight": {
"id": "68n444msv6n7x"
},
"paths": {
"/v1/thread_files/policies/": {
"post": {
"operationId": "thread_files_policies_create",
"description": "Creates the payload for a signed request to upload a file directly to S3. Further documentation can be found via the AWS documentation: https://aws.amazon.com/blogs/compute/uploading-to-amazon-s3-directly-from-a-web-or-mobile-application/\n\nAll monetary values are represented in minor units, or the smallest unit of the currency with no decimal (e.g., cents). For example, $10.00 is represented as 1000.\n\n\n\nHow can we improve these docs? Share your feedback.",
"summary": "Create a signed request for uploading a file to S3",
"parameters": [
{
"in": "query",
"name": "format",
"schema": {
"type": "string",
"enum": [
"json",
"toon"
]
}
}
],
"tags": [
"threads"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyCreateDocRequest"
},
"examples": {
"CreateThreadUploadPolicy": {
"value": {
"type": "image/png",
"name": "file.png"
},
"summary": "Create thread upload policy"
},
"ThreadUploadPolicyInvalid": {
"value": {
"reason": "File destination does not exist or is invalid."
},
"summary": "Thread upload policy invalid"
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyCreateDocRequest"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyCreateDocRequest"
}
},
"application/toon": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyCreateDocRequest"
}
}
},
"required": true
},
"security": [
{
"oauth2": [
"write"
]
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyResponse"
},
"examples": {
"UploadPolicyCreated": {
"value": {
"policy": "eyJleHBpcmF0aW9uIjogIjIwMjQtMDYtMThUMTQ6MDA6MDkuMDAwWiIsICJjb25kaXRpb25zIjogW3siYnVja2V0IjogImJ1Y2tldCJ9LCB7ImFjbCI6ICJjkkl2YXRlIn0sIHsia2V5IjogIm9yaWdpsdFsL3N1cHBvcnQvNGQ1ZjQ1NjA2MjhjNDA2YWFiMTVhYjkwMmRhMTI3MDUvZmlsZS5wbmcifSwgeyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiAiMjAxIn0sIHsieC1hbXotY3JlZGVudGlhbCI6ICIvMjAyNDA2MTgvbG9jYWwvczMvYXdzNF9yZXF1ZXN0In0sIHsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwgeyJ4LWFtei1kYXRlIjogIjIwMjQwNjE4VDEzNTUwOTAwMFoifSwgeyJjb250ZW50LXR5cGUiOiAiaW1hZ2UvcG5nIn0sIHsiQ2FjaGUtQ29udHJvbCI6ICJtYXgtYWdlPTI1OTIwMDAifSwgeyJDb250ZW50LURpc3Bvc2l0aW9uIjogImF0dGFjaG1lbnQifSwgeyJ4LWFtei1zZXJ2ZXItc2lkZS1lbmNyeXB0aW9uIjogIkFFUzI1NiJ9LCBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMCwgMjAwMDAwMDBdXX0=",
"success_action_status": 201,
"x-amz-credential": "/20240618/local/s3/aws4_request",
"x-amz-date": "20240618T135509000Z",
"x-amz-signature": "a249243213026c97ac80f9b2e4b2ef06c7c491022a8cf8e46f0ddf95a746e6f7",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"form_action": "http://example.com/__s3_upload__",
"key": "original/support/4d5f8372828c406aab15ab902da12705/file.png",
"acl": "private",
"content-type": "image/png",
"Cache-Control": "max-age=2592000",
"Content-Disposition": "attachment",
"x-amz-server-side-encryption": "AES256"
},
"summary": "Upload policy created"
}
}
},
"application/toon": {
"schema": {
"$ref": "#/components/schemas/UploadPolicyResponse"
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadFileError"
},
"examples": {
"ThreadUploadPolicyInvalid": {
"value": {
"reason": "File destination does not exist or is invalid."
},
"summary": "Thread upload policy invalid"
}
}
},
"application/toon": {
"schema": {
"$ref": "#/components/schemas/UploadFileError"
}
}
},
"description": ""
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
},
"application/toon": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
},
"description": ""
}
},
"x-stoplight": {
"id": "zrdmgff6lcp7q"
}
}
}
},
"components": {
"schemas": {
"UploadPolicyCreateDocRequest": {
"type": "object",
"properties": {
"type": {
"type": "string",
"minLength": 1,
"description": "MIME content type for the target upload."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Target filename for the uploaded file."
}
},
"required": [
"name",
"type"
],
"x-stoplight": {
"id": "t7vkt10oeqfrk"
}
},
"UploadPolicyResponse": {
"type": "object",
"properties": {
"policy": {
"type": "string"
},
"success_action_status": {
"type": "integer"
},
"form_action": {
"type": "string"
},
"key": {
"type": "string"
},
"acl": {
"type": "string"
},
"signature": {
"type": "string",
"description": "This signature is used by the server to verify the authenticity of subsequent thread/message creation requests that include the uploaded file. It should not be included in the request to AWS S3."
},
"x-amz-credential": {
"type": "string"
},
"x-amz-date": {
"type": "string"
},
"x-amz-signature": {
"type": "string"
},
"x-amz-algorithm": {
"type": "string"
},
"content-type": {
"type": "string"
},
"Cache-Control": {
"type": "string"
},
"Content-Disposition": {
"type": "string"
},
"x-amz-server-side-encryption": {
"type": "string"
}
},
"required": [
"Cache-Control",
"Content-Disposition",
"acl",
"content-type",
"form_action",
"key",
"policy",
"signature",
"success_action_status",
"x-amz-algorithm",
"x-amz-credential",
"x-amz-date",
"x-amz-server-side-encryption",
"x-amz-signature"
],
"x-stoplight": {
"id": "qbinhcshvseje"
}
},
"UploadFileError": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"default": "File destination does not exist or is invalid."
}
},
"x-stoplight": {
"id": "tgjembz2s6zp9"
}
},
"InvalidRequestError": {
"type": "object",
"properties": {
"id": {
"type": "string",
"default": "invalid_request_error"
},
"message": {
"type": "object",
"additionalProperties": {},
"default": {
"field_name": "Error description."
},
"description": "An error response detailing the field and the nature of the error."
}
},
"x-stoplight": {
"id": "aelrw6rc7wiph"
}
}
},
"securitySchemes": {
"oauth2": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "/v2/oauth/authorize/",
"tokenUrl": "/v2/oauth/token/",
"refreshUrl": "/v2/oauth/token/",
"scopes": {
"introspection": "Permit introspection on a valid active bearer token.",
"openid": "OpenID Connect scope",
"offline_access": "Includes long-lived refresh token along with access token",
"claudeai": "Authorizes access to Claude AI services.",
"read": "View your banking data.",
"write": "Update your data",
"banking:accounts:read": "Can read account information.",
"banking:transactions:read": "Can read transaction information.",
"banking:scheduled_transfers:read": "Can read scheduled transfer information.",
"banking:scheduled_transfers:write": "Can create and update scheduled transfers.",
"banking:accounts:write": "Can update account information.",
"banking:transactions:write": "Can update transaction information.",
"banking:users:read": "Can read user profile information.",
"banking:users:write": "Can update user profile information.",
"banking:products:read": "Can read product information.",
"banking:documents:read": "Can read user statements and documents.",
"banking:documents:write": "Can create and download document archives.",
"banking:support_schedules:read": "Can read institution schedule and Federal Reserve holiday information.",
"banking:payees:read": "Can read bill pay payee information.",
"banking:payees:write": "Can create, update, and delete bill pay payees.",
"banking:payments:read": "Can read bill pay payment information.",
"banking:payments:write": "Can create and delete bill pay payments.",
"banking:deposits:read": "Can read deposit information.",
"banking:deposits:write": "Can create and update deposits.",
"banking:recipients:read": "Can read recipient information.",
"banking:recipients:write": "Can create and update recipients.",
"banking:subscriptions:read": "Can read webhook subscription information.",
"banking:subscriptions:write": "Can create and update webhook subscriptions.",
"banking:transfers:read": "Can read transfer information.",
"banking:transfers:write": "Can create transfers.",
"banking:wires:read": "Can read wire information.",
"banking:wires:write": "Can create wires.",
"profile": "Standard claim for extended user information",
"email": "User registered email address",
"write:preferences": "Read and write user preferences",
"read:profile": "Access extended information about the user including address"
}
}
}
}
}
}
}
````