Skip to content

Attach a file from the file system catalog.

POST
/api/workspace/attachments/from-catalog
curl --request POST \
--url https://example.com/api/workspace/attachments/from-catalog \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "FileId": "example", "Relations": [ { "Target": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "RelationKind": 0, "Source": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "PolicyCode": "example", "CorrelationId": "example" } ], "Origin": { "Source": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "PolicyCode": "example", "CorrelationId": "example" }, "OperationKey": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'
access_token
string

Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.

object
Owner

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
FileId
string
nullable
Relations
Array<object>
nullable

Request to relate content to a resource.

object
Target

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
RelationKind

Relation kind between content and a resource.

integer format: int32
Allowed values: 0
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
Origin

Technical origin metadata for content created through another resource context.

object
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
OperationKey
string format: uuid

Successful attachment result; shape depends on the resource owner.

Media typeapplication/json
Any of:
object
Data
required
Any of:
object
Id
required
string
FolderId
required
string
Owner
object
ModuleKey
required
string
ResourceKind
required
string
ContextResourceId
required
string
ResourceObjectId
required
string
Relations
required
Array<object>

Stored relation between one content item and a target resource.

object
Id
string
nullable
Target

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
RelationKind

Relation kind between content and a resource.

integer format: int32
Allowed values: 0
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
CreatedByUserId
string
nullable
CreatedAt
string format: date-time
DeletedAt
string format: date-time
nullable
Origin
Any of:

Stored technical origin metadata for content created through another resource context.

object
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
IsDeleted
required
boolean
EditDeadline
required
string format: date-time
RowVersion
required
string format: uuid
Descriptor
required
object
Id
required
string
FileName
required
string
Description
string
nullable
MimeType
required
string
StorageType
required
integer format: int32
Allowed values: 0 1 2 3 4 5
AvailabilityState
required
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
ImageWidth
integer format: int32
nullable
ImageHeight
integer format: int32
nullable
ContentGeneration
required
integer format: int64
InspectedChecksumSha256
string
nullable
InspectedContentGeneration
integer format: int64
nullable
SizeBytes
required
integer format: int64
ChecksumSha256
required
string
CreatedAt
required
string format: date-time
ModifiedAt
string format: date-time
nullable
CreatedByUserId
string
nullable
CreatedByUserName
string
nullable
ModifiedByUserId
string
nullable
ModifiedByUserName
string
nullable
Errors
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
required
boolean
Example
{
"Data": null,
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Bad Request

Media typeapplication/json
object
Data
required
Any of:
object
Id
required
string
FolderId
required
string
Owner
object
ModuleKey
required
string
ResourceKind
required
string
ContextResourceId
required
string
ResourceObjectId
required
string
Relations
required
Array<object>

Stored relation between one content item and a target resource.

object
Id
string
nullable
Target

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
RelationKind

Relation kind between content and a resource.

integer format: int32
Allowed values: 0
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
CreatedByUserId
string
nullable
CreatedAt
string format: date-time
DeletedAt
string format: date-time
nullable
Origin
Any of:

Stored technical origin metadata for content created through another resource context.

object
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
IsDeleted
required
boolean
EditDeadline
required
string format: date-time
RowVersion
required
string format: uuid
Descriptor
required
object
Id
required
string
FileName
required
string
Description
string
nullable
MimeType
required
string
StorageType
required
integer format: int32
Allowed values: 0 1 2 3 4 5
AvailabilityState
required
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
ImageWidth
integer format: int32
nullable
ImageHeight
integer format: int32
nullable
ContentGeneration
required
integer format: int64
InspectedChecksumSha256
string
nullable
InspectedContentGeneration
integer format: int64
nullable
SizeBytes
required
integer format: int64
ChecksumSha256
required
string
CreatedAt
required
string format: date-time
ModifiedAt
string format: date-time
nullable
CreatedByUserId
string
nullable
CreatedByUserName
string
nullable
ModifiedByUserId
string
nullable
ModifiedByUserName
string
nullable
Errors
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
required
boolean
Example
{
"Data": null,
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Forbidden; the controller returns no response body.

Not Found

Media typeapplication/json
object
Data
required
Any of:
object
Id
required
string
FolderId
required
string
Owner
object
ModuleKey
required
string
ResourceKind
required
string
ContextResourceId
required
string
ResourceObjectId
required
string
Relations
required
Array<object>

Stored relation between one content item and a target resource.

object
Id
string
nullable
Target

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
RelationKind

Relation kind between content and a resource.

integer format: int32
Allowed values: 0
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
CreatedByUserId
string
nullable
CreatedAt
string format: date-time
DeletedAt
string format: date-time
nullable
Origin
Any of:

Stored technical origin metadata for content created through another resource context.

object
Source

Stable identity of one Moltaro resource instance.

object
ModuleKey
string
nullable
ResourceKind
string
nullable
ContextResourceId
string
nullable
ResourceObjectId
string
nullable
PolicyCode
string
nullable
CorrelationId
string
nullable
IsDeleted
required
boolean
EditDeadline
required
string format: date-time
RowVersion
required
string format: uuid
Descriptor
required
object
Id
required
string
FileName
required
string
Description
string
nullable
MimeType
required
string
StorageType
required
integer format: int32
Allowed values: 0 1 2 3 4 5
AvailabilityState
required
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
ImageWidth
integer format: int32
nullable
ImageHeight
integer format: int32
nullable
ContentGeneration
required
integer format: int64
InspectedChecksumSha256
string
nullable
InspectedContentGeneration
integer format: int64
nullable
SizeBytes
required
integer format: int64
ChecksumSha256
required
string
CreatedAt
required
string format: date-time
ModifiedAt
string format: date-time
nullable
CreatedByUserId
string
nullable
CreatedByUserName
string
nullable
ModifiedByUserId
string
nullable
ModifiedByUserName
string
nullable
Errors
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
required
boolean
Example
{
"Data": null,
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

The operation was refused; inspect Errors. Data may be null.

Media typeapplication/json
object
Data
required
Any of:
One of: discriminator: Kind
object
Data
required
object
FileReferenceId
required
string
FileName
required
string
ContentType
required
string
Size
required
integer format: int64
RowVersion
required
string format: uuid
CanViewResult
required
boolean
Kind
required
string
Allowed values: AuthorizedAttachment
Errors
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
required
Array<object>
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
required
boolean
Example
{
"Data": null,
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}