Data Models

The Rossum API SDK provides type-safe dataclass models for all API resources. These models are automatically populated from API responses and provide clear type hints for all fields.

Overview

All models are Python dataclasses with full type annotations. They represent the structure of data returned by the Rossum API and can also be used when sending data to the API.

Key features:

  • Type-safe with full type hints

  • Automatic deserialization from API responses

  • Possibility to use a custom deserializer

  • Support for nested objects

  • Optional fields with sensible defaults

  • Direct mapping to API documentation

Models

Annotation

class rossum_api.models.annotation.Annotation(url, status, schema, modifier, content, id=None, queue=None, creator=None, created_at=None, rir_poll_id=None, email=None, email_thread=None, has_email_thread_with_replies=False, has_email_thread_with_new_replies=False, suggested_edit=None, messages=None, time_spent=0, relations=<factory>, pages=<factory>, document=None, confirmed_at=None, modified_at=None, exported_at=None, arrived_at=None, assigned_at=None, purged_at=None, rejected_at=None, deleted_at=None, export_failed_at=None, organization=None, metadata=<factory>, automated=False, automation_blocker=None, related_emails=<factory>, automatically_rejected=None, prediction=None, assignees=<factory>, labels=<factory>, restricted_access=None, training_enabled=None, einvoice=None, purged_by=None, rejected_by=None, deleted_by=None, exported_by=None, confirmed_by=None, modified_by=None)[source]

Annotation contains all extracted and verified data related to a document.

Every document belongs to a Queue and is related to the Schema, that defines datapoint types and overall shape of the extracted data.

url

URL of the annotation object.

status

Current status of the annotation. See Annotation Lifecycle for possible values.

schema

URL of the schema object.

modifier

URL of the user object that last modified the annotation.

content

URL of the annotation content.

id

Annotation ID.

queue

URL of the queue object.

creator

URL of the user object that created the annotation.

created_at

Timestamp of when the annotation was created.

rir_poll_id

Internal extractor processing ID.

email

URL of the email object associated with the annotation.

email_thread

URL of the email thread object.

has_email_thread_with_replies

Boolean indicating if the annotation’s email thread has replies.

has_email_thread_with_new_replies

Boolean indicating if the annotation’s email thread has new replies.

suggested_edit

A suggested edit for the annotation.

messages

List of messages associated with the annotation.

time_spent

Total time spent on the annotation in seconds.

relations

List of relations.

pages

List of page URLs.

document

URL of the document object.

confirmed_at

Timestamp of when the annotation was confirmed.

modified_at

Timestamp of when the annotation was last modified.

exported_at

Timestamp of when the annotation was exported.

arrived_at

Timestamp when the annotation arrived.

assigned_at

Timestamp of when the annotation was assigned to a user.

purged_at

Timestamp of when the annotation was purged.

rejected_at

Timestamp of when the annotation was rejected.

deleted_at

Timestamp of when the annotation was deleted.

export_failed_at

Timestamp of when the annotation export failed.

organization

URL of the organization object.

metadata

Custom data attached to the annotation.

automated

Indicates if the annotation was processed automatically.

automation_blocker

URL of the automation blocker object.

related_emails

List of related email URLs.

automatically_rejected

Indicates if the annotation was automatically rejected.

prediction

Internal description of prediction source and version.

assignees

List of URLs referencing users assigned to this annotation.

labels

List of labels associated with this annotation.

restricted_access

Indicates if the annotation has restricted access.

training_enabled

Indicates if training is enabled for this annotation.

einvoice

Indicates if this is an e-invoice annotation.

purged_by

URL of the user object that purged the annotation.

rejected_by

URL of the user object that rejected the annotation.

deleted_by

URL of the user object that deleted the annotation.

exported_by

URL of the user object that exported the annotation.

confirmed_by

URL of the user object that confirmed the annotation.

modified_by

URL of the user object that last modified the annotation.

References

https://rossum.app/api/docs/openapi/api/annotation/

AutomationBlocker

class rossum_api.models.automation_blocker.AutomationBlocker(id, url, annotation, content=<factory>)[source]

Automation blocker stores reason why Annotation was not automated.

id

Automation blocker object ID.

url

Automation blocker object URL.

annotation

URL of related Annotation.

content

List of reasons why automation is blocked.

References

https://rossum.app/api/docs/openapi/api/automation-blocker/

AutomationBlockerContent

class rossum_api.models.automation_blocker.AutomationBlockerContent(level, type, schema_id=None, samples_truncated=False, samples=<factory>, details=<factory>)[source]

Description of a single reason why Annotation was not automated.

level

Whether automation blocker relates to specific datapoint or to the whole Annotation.

type

The type of automation blocker.

schema_id

The schema ID associated with this blocker. Only for datapoint level objects.

samples_truncated

Indicates if the samples list has been truncated.

samples

Whether number samples were truncated to 10, or contains all of them.

details

Only for level: annotation with type: error_message. Contains message_content with list of error messages.

References

https://rossum.app/api/docs/openapi/api/automation-blocker/

Connector

class rossum_api.models.connector.Connector(id, name, url, service_url, params, client_ssl_certificate, authorization_token, client_ssl_key=None, queues=<factory>, authorization_type='secret_key', asynchronous=True, metadata=<factory>)[source]

Connector is used to configure external or internal endpoint of such an extension service.

Connector is an extension of Rossum that allows to validate and modify data during validation and also export data to an external system.

id

ID of the connector.

name

Name of the connector.

url

URL of the connector.

service_url

URL of the connector endpoint.

params

Query params appended to the service_url.

client_ssl_certificate

Client SSL certificate used to authenticate requests. Must be PEM encoded.

authorization_token

Token sent to connector in Authorization header to ensure connector was contacted by Rossum.

client_ssl_key

Client SSL key (write only). Must be PEM encoded. Key may not be encrypted.

queues

List of Queue objects that use connector object.

authorization_type

Token sent to connector in Authorization header to ensure connector was contacted by Rossum.

asynchronous

Affects exporting: when True, confirm endpoint returns immediately and connector’s save endpoint is called asynchronously later on.

metadata

Client data.

References

https://rossum.app/api/docs/openapi/api/connector/

Document

class rossum_api.models.document.Document(id, url, s3_name, parent, email, mime_type, creator, created_at, arrived_at, original_file_name, content, metadata=<factory>, annotations=<factory>, attachment_status=None)[source]

Document contains information about one input file.

id

ID of the document.

url

URL of the document.

s3_name

Internal name of object name in S3.

parent

URL of the parent document (e.g. the zip file it was extracted from).

email

URL of the email object that document was imported by (only for documents imported by email).

mime_type

MIME type of the document, e.g. application/pdf.

creator

URL of User that created the annotation.

created_at

Timestamp of document upload or incoming email attachment extraction.

arrived_at

Deprecated. See created_at.

original_file_name

File name of the attachment or upload.

content

Link to the document’s raw content (e.g. PDF file). May be null if there is no file associated.

metadata

Client data.

annotations

List of URLs of Annotation objects related to the document. Usually there is only one annotation.

attachment_status

Reason, why the document got filtered out on Email ingestion. See attachment status

References

https://rossum.app/api/docs/openapi/api/document/

DocumentRelation

class rossum_api.models.document_relation.DocumentRelation(id, type, annotation, key, documents, url)[source]

Document relation introduces additional relations between annotations and documents.

Warning

Please note that Document Relation object and all endpoints associated with it are in beta version right now. The API may change in the future.

An Annotation can be related to one or more Document objects and it may belong to several such relations of different types at the same time. These are additional to the main relation between the Annotation and the Document from which it was created.

id

ID of the document relation.

type

Type of relationship. Possible values are 'export', 'einvoice'.

annotation

URL of related Annotation.

key

Key used to distinguish several relationships of the same type.

documents

List of URLs of related Documnets.

url

URL of the relation.

Notes

The combination of type, key and annotation attribute values must be unique.

References

https://rossum.app/api/docs/openapi/api/document-relation/

class rossum_api.models.email.Email(id, url, queue, inbox, parent, email_thread, children, documents, created_at=None, last_thread_email_created_at=None, subject=None, from_=<factory>, to=<factory>, cc=<factory>, bcc=<factory>, body_text_plain=None, body_text_html=None, metadata=<factory>, type=None, annotation_counts=<factory>, annotations=<factory>, related_annotations=<factory>, related_documents=<factory>, creator=None, filtered_out_document_count=None, labels=<factory>, content=None)[source]

Bases: object

Email represents emails sent to Rossum inboxes.

id

ID of the email.

url

URL of the email.

queue

URL of the associated Queue.

inbox

URL of the associated Inbox.

parent

URL of the parent email.

email_thread

URL of the associated email thread.

children

List of URLs of the children emails.

documents

List of URLs of Document objects attached to the email.

created_at

Timestamp of incoming email.

last_thread_email_created_at

(Deprecated) Timestamp of the most recent email in this email thread.

subject
from_

Information about sender containing keys email and name.

to

List that contains information about recipients.

cc

List that contains information about recipients of carbon copy.

bcc

List that contains information about recipients of blind carbon copy.

body_text_plain

Plain text email section (shortened to 4kB).

body_text_html

HTML email section (shortened to 4kB).

metadata

Client data.

type

Email type. Can be incoming or outgoing.

annotation_counts

Information about how many annotations were extracted from email attachments and in which state they currently are. This attribute is intended for INTERNAL use only and may be changed in the future.

annotations

List of URLs of Annotation objects that arrived via email

related_annotations

List of URLs of Annotation objects that are related to the email (e.g. rejected by that, added as attachment etc.).

related_documents

List of URLs of Document objects related to the email, (e.g. by forwarding email containing document as attachment etc.).

creator

User that have sent the email. None if email has been received via SMTP.

filtered_out_document_count

Number of documents automatically filtered out by Rossum smart inbox. This attribute is intended for INTERNAL use only and may be changed in the future.

labels

List of email labels.

content

URL of the emails content.

References

https://rossum.app/api/docs/openapi/api/email/

EmailTemplate

class rossum_api.models.email_template.EmailTemplate(id, name, url, queue, organization, subject, message, type, enabled, automate, triggers=<factory>, to=<factory>, cc=<factory>, bcc=<factory>)[source]

Email template represents templates one can choose from when sending an email from Rossum.

id

ID of the email template.

name

Name of the email template.

url

URL of the email template.

queue

URL of the associated Queue.

organization

URL of the associated Organization.

subject

Email subject.

message

Name of the email template.

type

Type of the email template.

enabled

(Deprecated). Use automate instead.

automate

True if user wants to send email automatically on the action, see type.

triggers

URLs of the linked triggers. Read more about triggers.

to

List that contains information about recipients.

cc

List that contains information about recipients of carbon copy.

bcc

List that contains information about recipients of blind carbon copy.

References

https://rossum.app/api/docs/openapi/api/email-template/

https://rossum.app/api/docs/openapi/guides/using-triggers/

Hook

class rossum_api.models.hook.Hook(id, name, url, active, config, test, guide, read_more_url, extension_image_url, type='webhook', metadata=<factory>, queues=<factory>, run_after=<factory>, events=<factory>, settings=<factory>, settings_schema=None, secrets=<factory>, extension_source='custom', sideload=<factory>, token_owner=None, token_lifetime_s=None, description=None)[source]

Hook is an extension of Rossum that is notified when specific event occurs.

Hook object is used to configure what endpoint or function is executed and when. For an overview of other extension options see Extensions.

Notes

Hooks are notified in parallel if run_after is not specified.

id

ID of the hook.

name

Name of the hook.

url

URL of the hook.

active

If set to True the hook is notified.

config

Configuration of the hook.

test

Input saved for hook testing purposes, see Test a hook.

guide

Description how to use the extension.

read_more_url

URL address leading to more info page.

extension_image_url

URL address of extension picture.

type

type of the hook.

metadata

Client data

queues

List of Queue objects that use hook object.

run_after

List of all hooks that has to be executed before running this hook.

events

List of events, when the hook should be notified. For the list of events see Webhook events.

settings

Specific settings that will be included in the payload when executing the hook. Field is validated with json schema stored in settings_schema field.

settings_schema

[BETA] JSON schema for settings field validation.

secrets

JSON schema for settings field validation. This is in BETA.

extension_source

Import source of the extension.

sideload

List of related objects that should be included in hook request. For the list of events see Webhook events.

token_owner

URL of a User. If present, an API access token is generated for this user and sent to the hook. Users with organization group admin cannot be set as token_owner. If None, token is not generated.

token_lifetime_s

Lifetime number of seconds for rossum_authorization_token (min=0, max=7200). This setting will ensure the token will be valid after hook response is returned. If None, default lifetime of 600 is used.

description

Hook description text.

References

https://rossum.app/api/docs/openapi/api/hook/

https://rossum.app/api/docs/openapi/api/hook/#test-hook

https://rossum.app/api/docs/openapi/api/hook/

HookRunData

class rossum_api.models.hook.HookRunData(log_level, action, event, request_id, organization_id, hook_id, hook_type, queue_id=None, annotation_id=None, email_id=None, message='', request=None, response=None, start=None, end=None, settings=<factory>, status=None, status_code=None, timestamp='', uuid=None, output=None)[source]

Data class for hook execution logs.

HookRunData captures detailed execution logs and metadata for hook runs within the system. It provides structured logging for tracking hook lifecycle events, performance metrics, and debugging information.

log_level

The severity level of the log entry: “INFO” for successful execution, “ERROR” for failures, or “WARNING” for non-critical issues.

action

The action that triggered the hook (e.g., initialize, changed).

event

The event type that triggered the hook execution.

request_id

Unique identifier for the HTTP request that initiated this hook execution.

organization_id

The ID of the organization that owns the hook configuration.

hook_id

The unique identifier of the hook configuration being executed.

hook_type

The type/category of the hook (e.g., webhook, email, custom integration).

queue_id

Reference to the queue where the document/annotation is located.

annotation_id

Reference to the specific annotation that triggered or is associated with the hook execution.

email_id

Reference to an email record if the hook involves email processing.

message

Concatenation of messages from hook response, or exception/traceback on errors.

request

Serialized representation of the outgoing HTTP request body sent by the hook (typically JSON).

response

Serialized representation of the HTTP response received from the hook endpoint.

start

ISO 8601 timestamp indicating when the hook execution started.

end

ISO 8601 timestamp indicating when the hook execution completed.

settings

Dictionary containing hook-specific configuration settings and parameters used during execution.

status

Text description of the execution status (e.g., “success”, “failed”, “timeout”).

status_code

HTTP status code returned from the hook endpoint (e.g., 200, 404, 500). If None, no status code is available.

timestamp

ISO 8601 timestamp of when the hook was triggered.

uuid

Unique identifier for this specific hook execution instance, useful for idempotency and deduplication.

output

Captured log messages or exception/traceback from serverless functions. If None, no output is captured. Not available for webhooks.

Notes

The retention policy for the logs is set to 7 days.

References

https://rossum.app/api/docs/openapi/api/hook/

https://rossum.app/api/docs/openapi/api/hook/

Inbox

class rossum_api.models.inbox.Inbox(id, name, url, queues, email, email_prefix, bounce_email_to, bounce_unprocessable_attachments=False, bounce_postponed_annotations=False, bounce_deleted_annotations=False, bounce_email_with_no_attachments=True, metadata=<factory>, filters=<factory>, dmarc_check_action='accept')[source]

Inbox enables email ingestion to a related Queue.

We enforce email domain to match Rossum domain (e.g. .rossum.app). email_prefix may be used to construct unique email address.

id

ID of the inbox.

name

Name of the inbox.

url

URL of the inbox.

queues

Queue that receives documents from inbox. Queue has to be passed in list due to backward compatibility. It is possible to have only one queue per inbox.

email

Rossum email address (e.g. east-west-trading-co-a34f3a@<example>.rossum.app)

email_prefix

Rossum email address prefix (e.g. east-west-trading-co). Maximum length allowed is 57 chars.

bounce_email_to

(Deprecated) Email address to send notifications to (e.g. about failed import). Configuration moved to Email notifications settings.

bounce_unprocessable_attachments

(Deprecated) Whether return back unprocessable attachments (e.g. MS Word docx) or just silently ignore them. When true, minimum image size requirement does not apply. Configuration moved to Email notifications settings.

bounce_postponed_annotations

(Deprecated) Whether to send notification when annotation is postponed. Configuration moved to Email notifications settings.

bounce_deleted_annotations

(Deprecated) Whether to send notification when annotation is deleted. Configuration moved to Email notifications settings.

bounce_email_with_no_attachments

(Deprecated) Whether to send notification when no processable documents were found. Configuration moved to Email notifications settings.

metadata

Client data.

filters
dmarc_check_action

Decides what to do with incoming emails, that don’t pass the DMARC check.

References

https://rossum.app/api/docs/openapi/api/inbox/

https://rossum.app/api/docs/openapi/api/inbox/

Organization

class rossum_api.models.organization.Organization(id, name, url, workspaces, users, organization_group, is_trial, created_at, trial_expires_at=None, expires_at=None, oidc_provider=None, ui_settings=<factory>, metadata=<factory>)[source]

Organization is a basic unit that contains all objects that are required to fully use Rossum platform.

Warning

Please note that Organization is an internal API and can be changed without notice.

id

ID of the organization.

name

Name of the organization.

url

URL of the organization.

workspaces

List of Workspace objects in the organization.

users

List of User in the organization.

organization_group

URL to organization group the organization belongs to.

is_trial

Property indicates whether this license is a trial license.

created_at

Timestamp for when the organization was created.

trial_expires_at

Timestamp for when the trial period ended (ISO 8601).

expires_at

Timestamp for when the organization is to be expired.

oidc_provider

(Deprecated) OpenID Connect provider name.

ui_settings

Organization-wide frontend UI settings (e.g. locales). Rossum internal.

metadata

Client data.

References

https://rossum.app/api/docs/openapi/api/organization/

Queue

class rossum_api.models.queue.Queue(id, name, url, workspace, connector, schema, inbox, counts, session_timeout='01:00:00', webhooks=<factory>, hooks=<factory>, users=<factory>, rir_url=None, rir_params=None, automation_enabled=False, automation_level='never', default_score_threshold=0.8, locale='en_GB', metadata=<factory>, settings=<factory>, dedicated_engine=None, generic_engine=None, use_confirmed_state=False, document_lifetime=None, delete_after=None, status=None, engine=None, training_enabled=True)[source]

Queue represents a document processing queue in Rossum.

A queue defines the document processing workflow and connects documents to their extraction schema, processing inbox, and user groups.

id

Id of the queue.

name

Name of the queue (max. 255 characters).

url

URL of the queue.

workspace

Workspace in which the queue should be placed (it can be set to null, but bear in mind that it will make the queue invisible in the Rossum UI and it may cause some unexpected consequences).

connector

Connector associated with the queue.

schema

Schema which will be applied to annotations in this queue.

inbox

Inbox for import to this queue.

counts

Count of annotations per status.

session_timeout

Time before annotation will be returned from reviewing status to to_review (timeout is evaluated every 10 minutes). Defaults to 1 hour.

webhooks

(Deprecated) Webhooks associated with the queue (serves as an alias for hooks attribute).

hooks

Hooks associated with the queue.

users

Users associated with this queue.

rir_url

(Deprecated) Use generic_engine or dedicated_engine to set AI Core Engine.

rir_params

URL parameters to be passed to the AI Core Engine.

automation_enabled

Toggle for switching automation on/off.

automation_level

Set level of automation.

default_score_threshold

Threshold used to automatically validate field content based on AI confidence scores.

locale

Typical originating region of documents processed in this queue specified in the locale format. If auto option is chosen, the locale will be detected automatically if the organization group has access to Aurora engine. Otherwise, default option (en_GB) will be used.

metadata

Client data.

settings

Queue UI settings.

dedicated_engine

Dedicated engine used for processing documents uploaded to this queue. If dedicated_engine is set generic_engine must be null.

generic_engine

Generic engine used for processing documents uploaded to this queue. If generic_engine is set dedicated_engine must be null. If both engines are null, a default generic one gets set.

use_confirmed_state

Affects exporting: when true, confirm endpoint transitions annotation to confirmed status instead to exporting.

document_lifetime

Data retention period – annotations will be automatically purged this time after their creation. The format of the value is ‘[DD] [HH:[MM:]]ss[.uuuuuu]’, e.g. 90 days retention can be set as ‘90 00:00:00’. Please keep in mind that purging documents in Rossum can limit its learning capabilities.

delete_after

For internal use only (When a queue is marked for its deletion it will be done after this date).

status

Current status of the queue.

engine

Engine associated with the queue.

training_enabled

Indicates if training is enabled for this queue.

References

https://rossum.app/api/docs/openapi/api/queue/

Relation

class rossum_api.models.relation.Relation(id, type, key, parent, annotations, url)[source]

Relation introduces common relations between annotations.

An Annotation can be related to one or more other annotations and it may belong to several relations at the same time.

id

ID of the relation.

type

Type of relationship. Possible values are 'edit', 'attachment', 'duplicate'.

key

Key used to distinguish several instances of the same type.

parent

URL of the parent Annotation in case of 1-M relationship.

annotations

List of URLs of related Annotation objects.

url

URL of the relation.

References

https://rossum.app/api/docs/openapi/api/relation/

RelationType

class rossum_api.models.relation.RelationType(value)[source]

Type of relationship between annotations.

EDIT

Created after editing annotation in user interface (rotation or split of the document). The original annotation is set to parent attribute and newly created annotations are set to annotations attribute.

ATTACHMENT

Represents the state that one or more documents are attachments to another document. key is null in this case. Feature must be enabled.

DUPLICATE

Created after importing the same document that already exists in Rossum for current organization. If duplicate relation already exists then corresponding annotation is added to existing relation. key is set to MD5 hash of document content.

Rule

class rossum_api.models.rule.Rule(id, name, enabled, organization, schema=None, trigger_condition='True', url=None, created_by=None, created_at=None, modified_by=None, modified_at=None, rule_template=None, synchronized_from_template=False, actions=<factory>)[source]

Rule object represents arbitrary business rules added to schema objects.

Rules allow you to define custom business logic that is evaluated when specific conditions are met. Each rule consists of a trigger condition (TxScript formula) and a list of actions to execute when the condition evaluates to True.

Warning

Rules are currently in beta version and the API may change. Talk with a Rossum representative about enabling this feature.

Notes

The trigger condition is a TxScript formula which controls the execution of actions. There are two evaluation modes:

  • Simple mode: when the condition does not reference any datapoint, or only references header fields. Example: len(field.document_id) < 10.

  • Line-item mode: when the condition references a line item datapoint (a column of a multivalue table). Example: field.item_amount > 100.0.

In line item mode, the condition is evaluated once for each row of the table.

id

Rule object ID.

url

Rule object URL.

name

Name of the rule.

enabled

If False the rule is disabled (default: True).

organization

URL of the Organization the rule belongs to.

schema

URL of the Schema the rule belongs to.

trigger_condition

A condition for triggering the rule’s actions. This is a formula evaluated by Rossum TxScript. Note that trigger condition must evaluate strictly to "True", truthy values are not enough to trigger the execution of actions. Wrap your condition with bool(your_condition) if necessary.

created_by

URL of the User who created the rule.

created_at

Timestamp of the rule creation.

modified_by

URL of the User who was the last to modify the rule.

modified_at

Timestamp of the latest modification.

rule_template

URL of the rule template the rule was created from.

synchronized_from_template

Signals whether the rule is automatically updated from the linked template.

actions

List of RuleAction objects. See Rule actions.

References

https://rossum.app/api/docs/openapi/api/rule/

RuleAction

class rossum_api.models.rule.RuleAction(id, type, payload, event, enabled=True)[source]

Rule action object defines actions to be executed when trigger condition is met.

id

Rule action ID. Needs to be unique within the Rule’s actions.

enabled

If False the action is disabled (default: True).

type

Type of action. See Rule actions for the list of possible actions.

payload

Action payload. Structure depends on the action type. See Rule actions for details.

event

Actions are configured to be executed on a specific event. See Trigger events.

References

https://rossum.app/api/docs/openapi/api/rule/

Schema

class rossum_api.models.schema.Schema(id, name=None, queues=<factory>, url=None, content=<factory>, metadata=<factory>, modified_by=None, modified_at=None)[source]

Schema specifies the set of datapoints that are extracted from the document.

For more information see Document Schema.

id

ID of the schema.

name

Name of the schema.

queues

List of Queue objects that use schema object.

url

URL of the schema.

content

List of sections (top-level schema objects, see Document Schema for description of schema).

metadata

Client data.

References

https://rossum.app/api/docs/openapi/api/schema/

https://rossum.app/api/docs/openapi/api/schema/

Section

class rossum_api.models.schema.Section(id, children=<factory>, category='section', label=None, icon=None)[source]

Top-level container grouping related datapoints, multivalues, and tuples.

id

Unique identifier for the section.

children

List of datapoints, multivalues, and tuples belonging to this section.

category

Category of the object, always “section”.

label

Display label for the section.

icon

Icon identifier for the section.

References

https://rossum.app/api/docs/openapi/api/schema/

Datapoint

class rossum_api.models.schema.Datapoint(id, type=None, label=None, description=None, category='datapoint', disable_prediction=False, hidden=False, can_export=True, can_collapse=False, rir_field_names=None, default_value=None, constraints=<factory>, score_threshold=None, options=None, ui_configuration=None, width=None, stretch=False, width_chars=None, formula=None, prompt=None, context=None)[source]

A datapoint represents a single value, typically a field of a document or global document information.

id

Unique identifier for the datapoint.

type

Data type of the object

label

Display label for the datapoint.

description

Description of the datapoint.

category

Category of the object, always “datapoint”.

disable_prediction

If True, AI predictions are disabled for this field.

hidden

If True, the field is hidden in the UI.

can_export

If False, datapoint is not exported through export endpoint.

can_collapse

If True, tabular (multivalue-tuple) datapoint may be collapsed in the UI.

rir_field_names

List of references used to initialize object value from AI engine predictions.

default_value

Default value used when AI engine does not return any data or rir_field_names are not specified.

constraints

Map of various constraints for the field.

score_threshold

Threshold (0-1) used to automatically validate field content based on AI confidence scores. If not set, queue.default_score_threshold is used.

options

List of available options for enum type fields.

ui_configuration

Settings affecting behavior of the field in the application.

width

Width of the column in characters. Only supported for table datapoints.

stretch

If True, column will expand proportionally when total width doesn’t fill screen. Only supported for table datapoints.

width_chars

Deprecated. Use width and stretch instead.

formula

Formula definition, required only for fields of type formula. rir_field_names should be empty.

prompt

Prompt definition, required only for fields of type reasoning.

context

Context information for the field.

References

https://rossum.app/api/docs/openapi/api/schema/

Multivalue

class rossum_api.models.schema.Multivalue(id, children, category='multivalue', label=None, rir_field_names=None, min_occurrences=None, max_occurrences=None, grid=None, show_grid_by_default=False, hidden=False)[source]

Multivalue is list of datapoints or tuples of the same type.

Represents a container for data with multiple occurrences (such as line items) and can contain only objects with the same id.

id

Unique identifier for the multivalue.

children

Object specifying type of children. Can contain only objects with categories tuple or datapoint.

category

Category of the object, always “multivalue”.

label

Display label for the multivalue.

rir_field_names

List of names used to initialize content from AI engine predictions. If specified, the value of the first field from the array is used, otherwise default name line_items is used. Can be set only for multivalue containing objects with category tuple.

min_occurrences

Minimum number of occurrences of nested objects. If violated, fields should be manually reviewed.

max_occurrences

Maximum number of occurrences of nested objects. Additional rows above this limit are removed by extraction process.

grid

Configure magic-grid feature properties.

show_grid_by_default

If True, the magic-grid is opened instead of footer upon entering the multivalue. Applied only in UI.

References

https://rossum.app/api/docs/openapi/api/schema/

Tuple

class rossum_api.models.schema.Tuple(id, children, category='tuple', label=None, disable_prediction=False, hidden=False, rir_field_names=None)[source]

Container representing one line of tabular data.

A tuple must be nested within a multivalue object, but unlike multivalue, it may consist of objects with different ids.

id

Unique identifier for the tuple.

children

Array specifying objects that belong to a given tuple.

category

Category of the object, always “tuple”.

label

Display label for the tuple.

disable_prediction

If True, AI predictions are disabled for this tuple.

hidden

If True, the tuple is hidden in the UI.

rir_field_names

List of names used to initialize content from AI engine predictions. If specified, the value of the first extracted field is used, otherwise no AI engine initialization is done.

References

https://rossum.app/api/docs/openapi/api/schema/

Task

class rossum_api.models.task.Task(id, url, type, status, expires_at, content=None, detail=None, code=None, result_url=None)[source]

Tasks are used as status monitors of asynchronous operations.

Tasks with succeeded status can redirect to the object created as a result of them. If no_redirect=true is passed as a query parameter, endpoint won’t redirect to an object created, but will return information about the task itself instead.

Warning

Please note that task object and all endpoints associated with it are in beta version right now. The API may change in the future.

id

ID of task object.

url

URL of task object.

type

Currently supported options for task types are documents_download, upload_created, and email_imported.

status

One of running, succeeded or failed.

expires_at

Timestamp of a guaranteed availability of the task object. Expired tasks are being deleted periodically.

content

Detailed information related to tasks (see tasks content detail).

detail

Detailed message on the status of the task. For failed tasks, error id is included in the message and can be used in communication with Rossum support for further investigation.

code

Error code.

result_url

Succeeded status resulting redirect URL.

References

https://rossum.app/api/docs/openapi/api/task/

Upload

class rossum_api.models.upload.Upload(id, url, queue, organization, creator, created_at, documents, additional_documents=<factory>, annotations=<factory>, email=None)[source]

Represent an upload.

id

ID of upload object.

url

URL of upload object.

queue

URL of the target Queue of the upload.

organization

URL of related Organization.

creator

URL of the User who created the upload.

created_at

Time of the creation of the upload.

documents

URLs of the uploaded Document.

additional_documents

URLs of additional Document created in upload.created event hooks.

annotations

URLs of all created Annotation.

email

URL of the Email that created the upload object.

References

https://rossum.app/api/docs/openapi/api/upload/

User

class rossum_api.models.user.User(id, url, first_name, last_name, email, date_joined, username, organization, last_login=None, is_active=True, email_verified=False, password=None, groups=<factory>, queues=<factory>, ui_settings=<factory>, metadata=<factory>, oidc_id=None, auth_type='password', deleted=False)[source]

User represents individual user of Rossum.

Every user is assigned to an organization and can have access to multiple queues and user groups for document processing workflows.

id

Id of the user.

url

URL of the user.

first_name

First name of the user.

last_name

Last name of the user.

email

Email of the user.

date_joined

Date of user join.

username

Username of a user.

organization

Related organization.

last_login

Date of last login.

is_active

Whether user is enabled or disabled.

email_verified

Whether the user’s email is verified.

password

Password (not shown on API).

groups

List of user role (permission groups).

queues

List of queues user is assigned to.

ui_settings

User-related frontend UI settings (e.g. locales). Rossum internal.

metadata

Client data.

oidc_id

OIDC provider id used to match Rossum user (displayed only to admin user).

auth_type

Authorization method, can be sso or password. This field can be edited only by admin.

deleted

Whether a user is deleted.

References

https://rossum.app/api/docs/openapi/api/user/

Workspace

class rossum_api.models.workspace.Workspace(id, name, url, autopilot, organization, queues=<factory>, metadata=<factory>)[source]

Workspace is a container of :class:`~rossum_api.models.queue.Queue.

id

ID of the workspace.

name

Name of the workspace.

url

URL of the workspace.

autopilot

(Deprecated) Whether to automatically confirm datapoints (hide eyes) from previously seen annotations

organization

URL of the related :class:`~rossum_api.models.organization.Organization.

queues

List of :class:`~rossum_api.models.queue.Queue that belong to the workspace.

metadata

Client data.

Notes

Please note that autopilot configuration has been moved to :class:`~rossum_api.models.queue.Queue. Option autopilot remains read-only on Workspace and represents autopilot configuration set to :class:`~rossum_api.models.queue.Queue within a workspace.

References

https://rossum.app/api/docs/openapi/api/workspace/

Model Usage Examples

Creating Model Instances

Models can be created manually or are automatically deserialized from API responses:

from rossum_api.models.workspace import Workspace

# Automatically deserialized from API
workspace = await client.retrieve_workspace(123)
print(workspace.name, workspace.id)

# Manual creation (for testing)
workspace = Workspace(
    id=123,
    name="My Workspace",
    url="https://elis.rossum.ai/api/v1/workspaces/123",
    organization="https://elis.rossum.ai/api/v1/organizations/1",
    autopilot=False,
)

Accessing Nested Objects

Some models contain references to other models:

# Annotation can have a nested Document object
annotation = await client.retrieve_annotation(456)

# If document is expanded in the API response
if isinstance(annotation.document, Document):
    print(f"Document: {annotation.document.original_file_name}")
# Otherwise it's just a URL string
else:
    print(f"Document URL: {annotation.document}")

Working with Enums

Models use Python enums for fields with fixed values:

from rossum_api.models.document_relation import DocumentRelationType

# Check relation type
if relation.type == DocumentRelationType.EXPORT:
    print("This is an export relation")

Type Hints

All models have full type hints for IDE autocomplete and type checking:

def process_annotation(annotation: Annotation) -> None:
    # IDE will provide autocomplete for annotation fields
    print(annotation.status)
    print(annotation.content)

    # Type checker will catch errors
    # annotation.nonexistent_field  # Error: Annotation has no attribute 'nonexistent_field'

See Also