Skip to content

Zoho: Upload an Attachment

Zoho attachments.uploadAttachment: arguments, response, policy and SDK examples.

← Attachments operations · Get started

Operation zoho.uploadattachment

Provider route: POST /crm/v8/{moduleApiName}/{recordId}/Attachments. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["attachments"]["uploadAttachment"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.attachments.uploadAttachment(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_zoho import ZohoIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.attachments.upload_attachment(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.recordIdstringRequired within parentMaximum length: 64
path.moduleApiNamestringRequired within parentMaximum length: 64
bodyJSONRequired within parentSchema used by uploadAttachment.
body (anyOf 1)objectAlternativeUpload attachment by file
Additional keys: not allowed
body (anyOf 1).fileobjectRequired within parentThe file to upload as an attachment
Additional keys: not allowed
body (anyOf 1).file.filenamestringRequired within parentMinimum length: 1
body (anyOf 1).file.content_typestringRequired within parentMinimum length: 1
body (anyOf 1).file.content_base64stringRequired within parent
body (anyOf 2)objectAlternativeUpload attachment by URL
Additional keys: not allowed
body (anyOf 2).attachmentUrlstringRequired within parentThe URL of the attachment to be linked
Maximum length: 3000
body (anyOf 2).titlestring or nullOptionalOptional title for the attachment
Maximum length: 255
Minimum length: 1

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Upload an Attachment — response body

Referenced models: Upload an Attachment — response body

Upload an Attachment — response body
FieldTypePresenceDescription and constraints
$objectRootSuccessful attachment operation response
Additional keys: not allowed
dataarrayRequired within parentArray of upload results
Maximum items: 100
data[]objectEach itemUpload status details
Additional keys: not allowed
data[].codestringRequired within parentRepresents the response code
Known values: SUCCESS
data[].detailsModelRequired within parentExpand Upload an Attachment — response body — data item details
data[].messagestringRequired within parentRepresents the success message
Known values: attachment uploaded successfully
data[].statusstringRequired within parentRepresents the operation status
Known values: success

Referenced models: Upload an Attachment — response body — data item details

Upload an Attachment — response body — data item details
FieldTypePresenceDescription and constraints
$objectRootDetails of the uploaded attachment
Additional keys: not allowed
Created_ByobjectRequired within parentRepresents the user who created the attachment
Additional keys: not allowed
Created_By.idstringRequired within parentUser ID. Use the [Users API](users.yaml#$.paths./users/bulk.get) to retrieve user IDs.

Maximum length: 50
Pattern: ^[0-9]+$
Created_By.namestringRequired within parentRepresents the user display name
Maximum length: 250
Created_TimestringRequired within parentRepresents the creation timestamp
Format: date-time
Modified_ByobjectRequired within parentRepresents the user who last modified the attachment
Additional keys: not allowed
Modified_By.idstringRequired within parentRepresents the user ID
Maximum length: 50
Pattern: ^[0-9]+$
Modified_By.namestringRequired within parentRepresents the user display name
Maximum length: 250
Modified_TimestringRequired within parentRepresents the last modification timestamp
Format: date-time
idstringRequired within parentRepresents the attachment identifier
Maximum length: 50
Pattern: ^[0-9]+$

SDK function policy ID: zoho.uploadattachment. Catalog operation: uploadAttachment. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.