get_citation_presigned_url¶
- ArtificialIntelligenceApi.get_citation_presigned_url(role_id, modality, citation_page_image_request, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get presigned URL for a citation page image
Returns a 1-hour S3 presigned URL for a PDF/DOCX page image used in citation previews. Requires modality=text. FileName must be a catalog path (domain/dataset/…/filename) or a project path (projects/files/{project_id}/{filename} or {project_id}/{filename}). PageNumber is 1-based. The caller must have access to the catalog dataset/file or project, and the page image must already exist.
- Parameters:
role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)
modality (str) – Citation content type. Only text is supported (PDF/DOCX page images). Any other value is rejected. (required)
citation_page_image_request (CitationPageImageRequest) – FileName and PageNumber are required. PageNumber must be an integer greater than or equal to 1. (required)
content_type (str) – Request body media type.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: POST /ai/knowledgebases/citations
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
header |
|
|
header |
|
|
query |
|
Request¶
FileName and PageNumber are required. PageNumber must be an integer greater than or equal to 1.
Catalog dataset file
{
"FileName": "sales_domain/sales_dataset/upload_date=2026-08-01/quarterly_report.pdf",
"PageNumber": 1
}
Project file
{
"FileName": "projects/files/123e4567-e89b-12d3-a456-426614174000/brief.pdf",
"PageNumber": 2
}
Success (HTTP 200)¶
Presigned URL for the page image, valid for ExpirationTime seconds (3600).
Request / response example
{
"PresignedUrl": "https://example-bucket.s3.amazonaws.com/kbsyncjob-source-pages/sales_domain/sales_dataset/quarterly_report/1.png?X-Amz-Expires=3600",
"ExpirationTime": 3600
}
Errors¶
Documented error codes: IPV-1001, IPV-1036, IPV-1078, IPV-1030, IPV-1002, AUTH-1012, AUTH-1001, AUTH-1011, GE-1085.
HTTP 400
Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1001 (missing FileName, PageNumber, or modality), IPV-1036 (PageNumber not positive), IPV-1078 (invalid PageNumber), IPV-1030 (invalid FileName format), IPV-1002 (page image not found), AUTH-1012 (no access to catalog dataset/file or project), AUTH-1001 (missing role_id), AUTH-1011 (caller not authorized).
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller not authorized
{
"Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}
Missing FileName
{
"Message": "IPV-1001 - Missing mandatory parameter(s) 'FileName'"
}
No access to source file
{
"Message": "AUTH-1012 - User does not have access to project: my-project"
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1085 (unexpected backend failure).
Unexpected backend failure
{
"Message": "GE-1085 - An unexpected error occurred"
}