Attachments
albert.resources.attachments
AttachmentCategory
The kind of file an attachment represents.
OTHER, SDS, LABEL, and SCRIPT are the original, fully supported
categories. All other categories are currently in beta and are only intended
for use with
upload_and_attach_document_to_inventory_item.
Beta Feature!
Categories other than OTHER, SDS, LABEL, and SCRIPT are in beta.
Please do not use them in production or without explicit guidance from Albert. You might otherwise have a bad experience.
This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Attributes:
| Name | Type | Description |
|---|---|---|
OTHER |
A general-purpose file with no specialized handling. |
|
SDS |
A Safety Data Sheet document, typically carrying hazard metadata. |
|
LABEL |
A product or container label. |
|
SCRIPT |
An executable or automation script. |
|
ALLERGEN |
An allergen statement document. |
|
ANIMAL_DERIVED |
An animal-derived materials declaration. |
|
BMR |
A batch manufacturing record. |
|
BROCHURE |
A product or marketing brochure. |
|
CHANGE_NOTIFICATION |
A change notification document. |
|
COA |
A certificate of analysis. |
|
EPD |
An environmental product declaration. |
|
FOOD_CONTACT |
A food contact compliance letter. |
|
MFR |
A master formula record. |
|
NDA |
An NDA or confidentiality agreement. |
|
PATENT |
A patent document. |
|
PCF |
A product carbon footprint document. |
|
RELIGIOUS_ORGANIC_CERT |
A Halal, Kosher, or organic certification. |
|
RSL |
An RSL compliance letter. |
|
SUPPLIER_QUESTIONNAIRE |
A supplier questionnaire document. |
|
TDS |
A technical data sheet. |
RELIGIOUS_ORGANIC_CERT
A Halal, Kosher, or organic certification.
SUPPLIER_QUESTIONNAIRE
A supplier questionnaire document.
AttachmentMetadata
Bases: BaseAlbertModel
Optional safety and classification metadata for an attachment.
Populated primarily for SDS attachments (see
upload_and_attach_sds_to_inventory_item).
Show JSON schema:
{
"$defs": {
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"HazardStatement": {
"description": "A GHS hazard statement from the platform reference list.\n\nReturned by\n[`get_statements`][albert.collections.hazards.HazardsCollection.get_statements].",
"properties": {
"id": {
"description": "The Albert ID of the hazard statement.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The text of the hazard statement.",
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the hazard statement, when set.",
"title": "Category"
}
},
"required": [
"id"
],
"title": "HazardStatement",
"type": "object"
},
"HazardSymbol": {
"description": "A GHS hazard pictogram symbol from the platform reference list.\n\nReturned by\n[`get_symbols`][albert.collections.hazards.HazardsCollection.get_symbols].",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
},
"status": {
"anyOf": [
{
"$ref": "#/$defs/HazardSymbolStatus"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the symbol is active, inactive, manually added, or selected by a model."
}
},
"required": [
"id"
],
"title": "HazardSymbol",
"type": "object"
},
"HazardSymbolStatus": {
"description": "The status of a [`HazardSymbol`][albert.resources.hazards.HazardSymbol].\n\nAttributes\n----------\nACTIVE : str\n The hazard symbol is fully operational and visible in normal operations.\nINACTIVE : str\n The hazard symbol is hidden from normal operations and disabled from use.\nADDED_MANUALLY : str\n The hazard symbol was manually chosen.\nFROM_MODEL : str\n The hazard symbol was selected by a model.",
"enum": [
"active",
"inactive",
"Added Manually",
"From Model"
],
"title": "HazardSymbolStatus",
"type": "string"
}
},
"description": "Optional safety and classification metadata for an attachment.\n\nPopulated primarily for SDS attachments (see\n[`upload_and_attach_sds_to_inventory_item`][albert.collections.attachments.AttachmentCollection.upload_and_attach_sds_to_inventory_item]).",
"properties": {
"Symbols": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/HazardSymbol"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard pictograms/symbols associated with the material.",
"title": "Symbols"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The UN number identifying the hazardous substance.",
"title": "Unnumber"
},
"storageClass": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage class code for the material.",
"title": "Storageclass"
},
"storageClassName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The human-readable storage class name. Read-only.",
"title": "Storageclassname"
},
"hazardStatement": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/HazardStatement"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard statements (e.g. H-phrases) for the material.",
"title": "Hazardstatement"
},
"jurisdiction": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The resolved jurisdiction name. Read-only.",
"title": "Jurisdiction"
},
"language": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The resolved language name. Read-only.",
"title": "Language"
},
"jurisdictionCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The jurisdiction code for the document (e.g. ``\"US\"``).",
"title": "Jurisdictioncode"
},
"languageCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The language code for the document (e.g. ``\"EN\"``).",
"title": "Languagecode"
},
"wgk": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The German water hazard class (Wassergef\u00e4hrdungsklasse) classification.",
"title": "Wgk"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A free-text description of the attachment.",
"title": "Description"
},
"extensions": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/EntityLinkWithName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Links to related extension entities.",
"title": "Extensions"
}
},
"title": "AttachmentMetadata",
"type": "object"
}
Fields:
-
symbols(list[HazardSymbol] | None) -
un_number(str | None) -
storage_class(str | None) -
storage_class_name(str | None) -
hazard_statement(list[HazardStatement] | None) -
jurisdiction(str | None) -
language(str | None) -
jurisdiction_code(str | None) -
language_code(str | None) -
wgk(str | None) -
description(str | None) -
extensions(list[EntityLinkWithName] | None)
symbols
symbols: list[HazardSymbol] | None = None
Hazard pictograms/symbols associated with the material.
storage_class_name
storage_class_name: str | None = None
The human-readable storage class name. Read-only.
hazard_statement
hazard_statement: list[HazardStatement] | None = None
Hazard statements (e.g. H-phrases) for the material.
jurisdiction_code
jurisdiction_code: str | None = None
The jurisdiction code for the document (e.g. "US").
Attachment
Bases: BaseResource
A record linking an uploaded file to a parent entity in Albert.
Attachments associate a stored file with a parent entity such as a Note,
Task, Project, or Inventory Item. The file itself is uploaded through the
FileCollection; the attachment's key
must match the stored name.
Attachments are managed through the
AttachmentCollection.
Example
Show JSON schema:
{
"$defs": {
"AttachmentCategory": {
"description": "The kind of file an attachment represents.\n\n``OTHER``, ``SDS``, ``LABEL``, and ``SCRIPT`` are the original, fully supported\ncategories. All other categories are currently in beta and are only intended\nfor use with\n[`upload_and_attach_document_to_inventory_item`][albert.collections.attachments.AttachmentCollection.upload_and_attach_document_to_inventory_item].\n\n!!! warning \"Beta Feature!\"\n Categories other than ``OTHER``, ``SDS``, ``LABEL``, and ``SCRIPT`` are in beta.\n Please do not use them in production or without explicit guidance from Albert. You might otherwise have a bad experience.\n This feature currently falls outside of the Albert support contract, but we'd love your feedback!",
"enum": [
"Other",
"SDS",
"Label",
"Script",
"Allergen",
"AnimalDerived",
"BMR",
"Brochure",
"ChangeNotification",
"CoA",
"EPD",
"FoodContact",
"MFR",
"NDA",
"Patent",
"PCF",
"ReligiousOrganicCert",
"RSL",
"SupplierQuestionnaire",
"TDS"
],
"title": "AttachmentCategory",
"type": "string"
},
"AttachmentMetadata": {
"description": "Optional safety and classification metadata for an attachment.\n\nPopulated primarily for SDS attachments (see\n[`upload_and_attach_sds_to_inventory_item`][albert.collections.attachments.AttachmentCollection.upload_and_attach_sds_to_inventory_item]).",
"properties": {
"Symbols": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/HazardSymbol"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard pictograms/symbols associated with the material.",
"title": "Symbols"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The UN number identifying the hazardous substance.",
"title": "Unnumber"
},
"storageClass": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage class code for the material.",
"title": "Storageclass"
},
"storageClassName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The human-readable storage class name. Read-only.",
"title": "Storageclassname"
},
"hazardStatement": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/HazardStatement"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard statements (e.g. H-phrases) for the material.",
"title": "Hazardstatement"
},
"jurisdiction": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The resolved jurisdiction name. Read-only.",
"title": "Jurisdiction"
},
"language": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The resolved language name. Read-only.",
"title": "Language"
},
"jurisdictionCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The jurisdiction code for the document (e.g. ``\"US\"``).",
"title": "Jurisdictioncode"
},
"languageCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The language code for the document (e.g. ``\"EN\"``).",
"title": "Languagecode"
},
"wgk": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The German water hazard class (Wassergef\u00e4hrdungsklasse) classification.",
"title": "Wgk"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A free-text description of the attachment.",
"title": "Description"
},
"extensions": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/EntityLinkWithName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Links to related extension entities.",
"title": "Extensions"
}
},
"title": "AttachmentMetadata",
"type": "object"
},
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"HazardStatement": {
"description": "A GHS hazard statement from the platform reference list.\n\nReturned by\n[`get_statements`][albert.collections.hazards.HazardsCollection.get_statements].",
"properties": {
"id": {
"description": "The Albert ID of the hazard statement.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The text of the hazard statement.",
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the hazard statement, when set.",
"title": "Category"
}
},
"required": [
"id"
],
"title": "HazardStatement",
"type": "object"
},
"HazardSymbol": {
"description": "A GHS hazard pictogram symbol from the platform reference list.\n\nReturned by\n[`get_symbols`][albert.collections.hazards.HazardsCollection.get_symbols].",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
},
"status": {
"anyOf": [
{
"$ref": "#/$defs/HazardSymbolStatus"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the symbol is active, inactive, manually added, or selected by a model."
}
},
"required": [
"id"
],
"title": "HazardSymbol",
"type": "object"
},
"HazardSymbolStatus": {
"description": "The status of a [`HazardSymbol`][albert.resources.hazards.HazardSymbol].\n\nAttributes\n----------\nACTIVE : str\n The hazard symbol is fully operational and visible in normal operations.\nINACTIVE : str\n The hazard symbol is hidden from normal operations and disabled from use.\nADDED_MANUALLY : str\n The hazard symbol was manually chosen.\nFROM_MODEL : str\n The hazard symbol was selected by a model.",
"enum": [
"active",
"inactive",
"Added Manually",
"From Model"
],
"title": "HazardSymbolStatus",
"type": "string"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "A record linking an uploaded file to a parent entity in Albert.\n\nAttachments associate a stored file with a parent entity such as a Note,\nTask, Project, or Inventory Item. The file itself is uploaded through the\n[`FileCollection`][albert.collections.files.FileCollection]; the attachment's ``key``\nmust match the stored [`name`][albert.resources.files.FileInfo.name].\nAttachments are managed through the\n[`AttachmentCollection`][albert.collections.attachments.AttachmentCollection].\n\n!!! example\n ```python\n from albert.resources.attachments import Attachment\n attachment = Attachment(\n parent_id=\"INVA9999999\",\n name=\"datasheet.pdf\",\n key=\"INVA9999999/documents/datasheet.pdf\",\n )\n ```",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the attachment (format ``ATT...``). Assigned by Albert when the attachment is created.",
"title": "Albertid"
},
"parentId": {
"description": "The ID of the entity the file is attached to. Must include the full entity prefix (e.g. ``\"INVA9999999\"``).",
"title": "Parentid",
"type": "string"
},
"name": {
"description": "The display name of the attached file.",
"title": "Name",
"type": "string"
},
"key": {
"description": "The storage key of the underlying file; matches the uploaded file's name.",
"title": "Key",
"type": "string"
},
"nameSpace": {
"default": "result",
"description": "The storage namespace of the file. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/AttachmentCategory"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The kind of file (e.g. SDS, Label). See [`AttachmentCategory`][albert.resources.attachments.AttachmentCategory].",
"title": "Category"
},
"revisionDate": {
"anyOf": [
{
"format": "date",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The revision date of the document, when applicable (e.g. for SDS files).",
"title": "Revisiondate"
},
"fileSize": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The size of the file in bytes. Read-only.",
"title": "Filesize"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file. Read-only.",
"title": "Mimetype"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary signed download URL. Read-only.",
"title": "Signedurl"
},
"signedURLV2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary signed download URL (v2). Read-only.",
"title": "Signedurlv2"
},
"Metadata": {
"anyOf": [
{
"$ref": "#/$defs/AttachmentMetadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional safety and classification metadata. See [`AttachmentMetadata`][albert.resources.attachments.AttachmentMetadata]."
}
},
"required": [
"parentId",
"name",
"key"
],
"title": "Attachment",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(AttachmentId | None) -
parent_id(str) -
name(str) -
key(str) -
namespace(str) -
category(AttachmentCategory | str | None) -
revision_date(date | None) -
file_size(int | None) -
mime_type(str | None) -
signed_url(str | None) -
signed_url_v2(str | None) -
metadata(AttachmentMetadata | None)
id
id: AttachmentId | None = None
The Albert ID of the attachment (format ATT...). Assigned by Albert when the attachment is created.
parent_id
parent_id: str
The ID of the entity the file is attached to. Must include the full entity prefix (e.g. "INVA9999999").
category
category: AttachmentCategory | str | None = None
The kind of file (e.g. SDS, Label). See AttachmentCategory.
revision_date
revision_date: date | None = None
The revision date of the document, when applicable (e.g. for SDS files).
metadata
metadata: AttachmentMetadata | None = None
Optional safety and classification metadata. See AttachmentMetadata.