Skip to content
Console

Read file content

GET
/api/v1/files/{file_id}/content
curl --request GET \
--url 'https://api.inside.chat/api/v1/files/example/content?conversation_id=example&message_id=example&include_internal=false&offset=0&length=65536' \
--header 'Authorization: Bearer <token>'

Required scopes: file_read, conversation_read, message_content_read, contact_read_pii
Data access: message_content, pii
MCP tool: file_content
Note: include_internal adds internal_notes_read

Read up to 65536 file bytes for an exact permitted message as base64. Requires file/transcript grants and restrictions; internal notes need opt-in. Every range is reauthorized; pin the returned version for continuation. No storage URL, upload or automatic paging.

file_id
required
string
/^fil_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
website_id
string
/^web_[0-9]{1,20}_[1-9][0-9]{0,18}$/

Optional; if present must match the resource owner.

conversation_id
required
string
<= 100 characters /^con_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
message_id
required
string
<= 100 characters /^msg_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
include_internal

Explicitly include stored internal messages. Requires internal_notes_read and the internal_notes data flag in addition to all transcript grants. Default is public messages only.

boolean
offset

Canonical signed 64 decimal byte offset; a positive offset requires expected_version from the preceding range.

string
default: 0 <= 19 characters /^(?:0|[1-9][0-9]{0,18})$/
length
integer
default: 65536 >= 1 <= 65536
expected_version

Pin the file version for every continuation. A changed version is unavailable; explicitly restart at offset zero to choose a new version.

string
<= 71 characters /^sha256_[a-f0-9]{64}$/
Range
string
<= 45 characters /^bytes=(?:0|[1-9][0-9]{0,18})-(?:0|[1-9][0-9]{0,18})$/

One canonical closed bytes=start-end range of at most 65536 bytes, requiring binary Accept. Query offset/length must agree. Suffix, open and multiple ranges are unsupported. Positive start requires expected_version or If-Match.

If-Match
string
<= 73 characters /^"sha256_[a-f0-9]{64}"$/

One quoted opaque file version from ETag. Intersects expected_version when both are present. Weak, wildcard and multiple tags are unsupported. An authorized version mismatch returns 412 without content.

Authorized result. Projection depends on current scopes and data policy.

object
data
required
object
conversation_id
required
string
<= 100 characters /^con_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
message_id
required
string
<= 100 characters /^msg_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
visibility
required
string
Allowed values: public internal
file
required
object
id
required
string
<= 100 characters /^fil_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
name
required
Any of:
string
<= 512 characters
content_type
required
string
<= 100 characters /^[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*$/
size_bytes
required
string
<= 19 characters /^(?:0|[1-9][0-9]{0,18})$/
offset
required
string
<= 19 characters /^(?:0|[1-9][0-9]{0,18})$/
bytes_read
required
integer
<= 65536
content_base64
required
string
<= 87384 characters
next_offset
required
Any of:
string
<= 19 characters /^(?:0|[1-9][0-9]{0,18})$/
version
required
string
<= 71 characters /^sha256_[a-f0-9]{64}$/
sha256
required
string
<= 64 characters /^[a-f0-9]{64}$/
coverage
required
Allowed value: stored_attachment_content_range

Example

{
"data": {
"visibility": "public",
"coverage": "stored_attachment_content_range"
}
}
ETag
string

Binary only: quoted opaque version; pass its unquoted value as expected_version on continuation.

X-Gateway-File-Offset
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: selected decimal byte offset.

X-Gateway-File-Size
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: exact decimal total file size.

X-Gateway-Next-Offset
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: continue at this decimal offset; absent at EOF.

X-Gateway-Content-SHA256
string
/^[a-f0-9]{64}$/

Binary only: SHA256 of the selected bytes.

The verified requested bounded HTTP byte range; actual end is clipped at file EOF.

Media typeapplication/octet-stream
string format: binary
<= 65536 characters
ETag
string

Binary only: quoted opaque version; pass its unquoted value as expected_version on continuation.

X-Gateway-File-Offset
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: selected decimal byte offset.

X-Gateway-File-Size
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: exact decimal total file size.

X-Gateway-Next-Offset
string
/^(?:0|[1-9][0-9]{0,18})$/

Binary only: continue at this decimal offset; absent at EOF.

X-Gateway-Content-SHA256
string
/^[a-f0-9]{64}$/

Binary only: SHA256 of the selected bytes.

Content-Range
string
/^bytes [0-9]+-[0-9]+/[0-9]+$/

Invalid, duplicate or unsupported request parameters.

Missing, expired or revoked installation credential.

Resource not found or not permitted by current authority.

No acceptable JSON or binary representation. Errors always use problem JSON.

Explicit expected_version no longer matches the authorized file; no content.

The supplied If-Match file version no longer matches; no content.

The requested offset has no authorized bytes. An empty-file HTTP range includes Content-Range: bytes */0; no content or file headers.

The requested capability is not available for application installations.

Per-app quota exceeded.

Retry-After
integer
>= 1

Enrollment, native service or required authority is unavailable.