Skip to content

attachments

create-property

Create content property for attachment

Creates a new content property for an attachment.

Permissions required: Permission to update the attachment.

POST /attachments/{attachment-id}/properties

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment to create a property for.
--bodystringNorequest body (JSON string, @file, or - for stdin)

Example:

bash
cf attachments create-property --attachment-id <attachment-id>

delete

Delete attachment

Delete an attachment by id.

Deleting an attachment moves the attachment to the trash, where it can be restored later. To permanently delete an attachment (or "purge" it), the endpoint must be called on a trashed attachment with the following param purge=true.

Permissions required: Permission to view the container of the attachment. Permission to delete attachments in the space. Permission to administer the space (if attempting to purge).

DELETE /attachments/{id}

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment to be deleted.
--purgestringNoIf attempting to purge the attachment.

Example:

bash
cf attachments delete --id <id>

delete-property-by-id

Delete content property for attachment by id

Deletes a content property for an attachment by its id.

Permissions required: Permission to attachment the page.

DELETE /attachments/{attachment-id}/properties/{property-id}

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment the property belongs to.
--property-idstringYesThe ID of the property to be deleted.

Example:

bash
cf attachments delete-property-by-id --attachment-id <attachment-id> --property-id <property-id>

get

Get attachments

Returns all attachments. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the container of the attachment.

GET /attachments

FlagTypeRequiredDescription
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--filenamestringNoFilters on the file-name of attachments. Only one may be specified.
--limitstringNoMaximum number of attachments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--mediaTypestringNoFilters on the mediaType of attachments. Only one may be specified.
--sortstringNoUsed to sort the result by a particular field.
--statusstringNoFilter the results to attachments based on their status. By default, current and archived are used.

Example:

bash
cf attachments get

get-by-id

Get attachment by id

Returns a specific attachment.

Permissions required: Permission to view the attachment's container.

GET /attachments/{id}

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment to be returned. If you don't know the attachment's ID, use Get attachments for page/blogpost/custom content.
--include-collaboratorsstringNoIncludes collaborators on the attachment.
--include-labelsstringNoIncludes labels associated with this attachment in the response.
The number of results will be limited to 50 and sorted in the default sort order.
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.
--include-operationsstringNoIncludes operations associated with this attachment in the response, as defined in the Operation object.
The number of results will be limited to 50 and sorted in the default sort order.
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.
--include-propertiesstringNoIncludes content properties associated with this attachment in the response.
The number of results will be limited to 50 and sorted in the default sort order.
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.
--include-versionstringNoIncludes the current version associated with this attachment in the response.
By default this is included and can be omitted by setting the value to false.
--include-versionsstringNoIncludes versions associated with this attachment in the response.
The number of results will be limited to 50 and sorted in the default sort order.
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.
--versionstringNoAllows you to retrieve a previously published version. Specify the previous version's number to retrieve its details.

Example:

bash
cf attachments get-by-id --id <id>

get-comments

Get attachment comments

Returns the comments of the specific attachment. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the attachment and its corresponding containers.

GET /attachments/{id}/footer-comments

FlagTypeRequiredDescription
--body-formatstringNoThe content format type to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the attachment for which comments should be returned.
--limitstringNoMaximum number of comments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.
--versionstringNoVersion number of the attachment to retrieve comments for. If no version provided, retrieves comments for the latest version.

Example:

bash
cf attachments get-comments --id <id>

get-content-properties

Get content properties for attachment

Retrieves all Content Properties tied to a specified attachment.

Permissions required: Permission to view the attachment.

GET /attachments/{attachment-id}/properties

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment for which content properties should be returned.
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--keystringNoFilters the response to return a specific content property with matching key (case sensitive).
--limitstringNoMaximum number of attachments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.

Example:

bash
cf attachments get-content-properties --attachment-id <attachment-id>

get-content-properties-by-id

Get content property for attachment by id

Retrieves a specific Content Property by ID that is attached to a specified attachment.

Permissions required: Permission to view the attachment.

GET /attachments/{attachment-id}/properties/{property-id}

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment for which content properties should be returned.
--property-idstringYesThe ID of the content property to be returned

Example:

bash
cf attachments get-content-properties-by-id --attachment-id <attachment-id> --property-id <property-id>

get-labels

Get labels for attachment

Returns the labels of specific attachment. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the parent content of the attachment and its corresponding space. Only labels that the user has permission to view will be returned.

GET /attachments/{id}/labels

FlagTypeRequiredDescription
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the attachment for which labels should be returned.
--limitstringNoMaximum number of labels per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--prefixstringNoFilter the results to labels based on their prefix.
--sortstringNoUsed to sort the result by a particular field.

Example:

bash
cf attachments get-labels --id <id>

get-operations

Get permitted operations for attachment

Returns the permitted operations on specific attachment.

Permissions required: Permission to view the parent content of the attachment and its corresponding space.

GET /attachments/{id}/operations

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment for which operations should be returned.

Example:

bash
cf attachments get-operations --id <id>

get-version-details

Get version details for attachment version

Retrieves version details for the specified attachment and version number.

Permissions required: Permission to view the attachment.

GET /attachments/{attachment-id}/versions/{version-number}

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment for which version details should be returned.
--version-numberstringYesThe version number of the attachment to be returned.

Example:

bash
cf attachments get-version-details --attachment-id <attachment-id> --version-number <version-number>

get-versions

Get attachment versions

Returns the versions of specific attachment.

Permissions required: Permission to view the attachment and its corresponding space.

GET /attachments/{id}/versions

FlagTypeRequiredDescription
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the attachment to be queried for its versions. If you don't know the attachment ID, use Get attachments and filter the results.
--limitstringNoMaximum number of versions per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.

Example:

bash
cf attachments get-versions --id <id>

list

List attachments on a page

FlagTypeRequiredDescription
--page-idstringNoPage ID to list attachments for (required)

Example:

bash
cf attachments list

update-property-by-id

Update content property for attachment by id

Update a content property for attachment by its id.

Permissions required: Permission to edit the attachment.

PUT /attachments/{attachment-id}/properties/{property-id}

FlagTypeRequiredDescription
--attachment-idstringYesThe ID of the attachment the property belongs to.
--bodystringNorequest body (JSON string, @file, or - for stdin)
--property-idstringYesThe ID of the property to be updated.

Example:

bash
cf attachments update-property-by-id --attachment-id <attachment-id> --property-id <property-id>

upload

Upload an attachment to a page (v1 API)

FlagTypeRequiredDescription
--filestringNoPath to file to upload (required)
--page-idstringNoPage ID to upload attachment to (required)

Example:

bash
cf attachments upload