Skip to main content

Overview

Some APIs require you to upload an input payload (JSON, ZIP, CSV, etc.).
Instead of sending large bodies directly to Sandbox APIs, you upload the payload to a secure pre-signed AWS S3 URL using a PUT request.
The system then processes your payload asynchronously as a job.

When a PUT Upload Is Required

You will see this workflow whenever the API endpoint mentions steps like:
  1. Submit Job → returns id (job ID) + url (signed S3 upload URL)
  2. PUT Upload → upload your file or JSON payload to the S3 url
  3. Poll Job → retrieve the processed output
If an API reference page contains a PUT Request section, it uses this flow.

How PUT Requests Work

1

Submit the Job

You first call the API endpoint that initializes the job.
The response includes:
id
string
required
Job id
url
string
required
Pre-signed S3 put URL
status
string
required
Current state of the job
created_at
string
Timestamp of when the job was created
updated_at
string
Timestamp of when the job was last updated
curl --request POST \
  --url 'https://api.sandbox.co.in/it/calculator/crypto/tax-pnl?report=tradewise' \
  --header 'Authorization: <authorization>' \
  --header 'x-accept-type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-api-version: 1.0.0'
2

PUT the Input Payload

Once you receive the pre-signed S3 URL, upload your payload (JSON, ZIP, CSV, etc.) directly to that URL using an HTTP PUT request.The url returned in Step 1 is an AWS S3 pre-signed URL, not a Sandbox API endpoint.
Do NOT modify the URL
Do NOT send your Sandbox API key in the PUT Request
Requirements
  • Method: PUT
  • Headers: only Content-Type (and occasionally checksums if required)
  • Body: Your input payload.
cURL Example
curl -X PUT \
  -H "Content-Type: application/json" \
  --data '@payload.json' \
  "https://in-co-sandbox-it-calculator-pnl-crypto-dev.s3.ap-south-1.amazonaws.com/84f3844d...&x-id=PutObject"
3

Poll the Job Status

After successfully uploading your payload to the pre-signed S3 URL, the job begins processing on Sandbox servers.
Use the same endpoint from Step 1, but switch to a GET request with the job_id returned earlier.
Jobs usually finish within a few seconds, but large payloads or complex calculations may take longer.
Implement retry logic with exponential backoff.

Polling With Job ID

Use the same route as Step 1, only changing the method to GET and adding job_id.
curl --request GET \
	--url https://api.sandbox.co.in/it/calculator/crypto/tax-pnl \
  	--header 'Authorization: <authorization>' \
  	--header 'x-api-key: <x-api-key>' \
  	--header 'x-api-version: 1.0.0'

Job Status States

A job can be in one of the following states:
StatusDescription
createdJob created, awaiting processing
in_progressSandbox is reading your payload and computing results
successOutput is ready to consume
errorProcessing failed; inspect the returned error message