Atlassian Content - Attachments API

The Content - Attachments API from Atlassian — 4 operation(s) for content - attachments.

Documentation

📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-addon/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-webhooks/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-snippets/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-analytics/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-audit/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/connect-modules/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v2/intro/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-body/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-inline-tasks
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-labels/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-long-running-task/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-relation/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-settings/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-template/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-user/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-announcement-banner/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-openapi
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/
📖
Documentation
https://developer.atlassian.com/server/framework/atlassian-sdk/audit/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-components/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jira-settings/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/getting-started-with-connect/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/connect-api-migration/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/data-security-policy-developer-guide/
📖
Documentation
https://developer.atlassian.com/platform/forge/events-reference/jira/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jira-expressions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/forge/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-groups/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-group-and-user-picker/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-links/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-security-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-labels/
📖
Documentation
https://developer.atlassian.com/platform/marketplace/license-api-for-cloud-apps/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-license-metrics/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-notification-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-permission-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-categories/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-key-and-name-validation/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-resolutions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-roles/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screens/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-security-level/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-statuses/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-status-categories/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-ui-modifications--apps-/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-avatars/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/
📖
Documentation
https://developer.atlassian.com/server/jira/platform/webhooks/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/
📖
Documentation
https://developer.atlassian.com/cloud/admin/organization/rest/
📖
Documentation
https://developer.atlassian.com/cloud/admin/user-management/rest/
📖
Documentation
https://developer.atlassian.com/cloud/admin/user-provisioning/rest/

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-hook-events-paginated_hook_events-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-pull-requests-a_pullrequest_comment_task-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-repositories-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-snippets-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-teams-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-user-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-workspaces-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-audit-audit-record-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-async-content-body-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-body-async-content-body-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-states-async-id-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-group-group-array-with-links-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-inline-tasks-task-page-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-longtask-long-task-status-with-links-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-relation-relation-data-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-search-search-page-response-search-result-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-settings-look-and-feel-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-space-content-state-settings-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-template-blueprint-template-array-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-user-account-id-email-record-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-admin-domain-page-schema.json

Other Resources

🔗
GraphQL
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/graphql/atlassian-graphql.md
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-hook-events-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-pull-requests-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-repositories-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-snippets-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-teams-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-user-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-workspaces-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-audit-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-body-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-states-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-group-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-inline-tasks-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-longtask-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-relation-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-search-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-settings-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-space-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-template-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-user-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-admin-context.jsonld

OpenAPI Specification

atlassian-content-attachments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Atlassian Admin Account Content - Attachments API
  description: The Atlassian Admin API provides programmatic access to manage Atlassian organizations, users, domains, policies, and events. It enables administrators to automate organization management tasks, integrate with identity providers, and ensure appropriate access to Atlassian products.
  version: 1.0.0
  contact:
    name: Atlassian Developer
    url: https://developer.atlassian.com/cloud/admin/
  license:
    name: Atlassian Developer Terms
    url: https://developer.atlassian.com/platform/marketplace/atlassian-developer-terms/
  x-logo:
    url: https://wac-cdn.atlassian.com/assets/img/favicons/atlassian/favicon.png
servers:
- url: https://api.atlassian.com
  description: Atlassian Cloud API
security:
- bearerAuth: []
- oauth2: []
tags:
- name: Content - Attachments
paths:
  /wiki/rest/api/content/{id}/child/attachment:
    get:
      tags:
      - Content - Attachments
      summary: Atlassian Get Attachments
      deprecated: true
      description: 'Deprecated, use [Confluence''s v2 API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).<br><br>Returns the attachments for a piece of content.<br><br>By default, the following objects are expanded: `metadata`.<br><br>**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:<br>Permission to view the content. If the content is a blog post, ''View'' permission<br>for the space is required.'
      operationId: atlassianGetattachments
      parameters:
      - name: id
        in: path
        description: The ID of the content to be queried for its attachments.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/contentExpand'
      - name: start
        in: query
        description: The starting index of the returned attachments.
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
      - name: limit
        in: query
        description: 'The maximum number of attachments to return per page.

          Note, this may be restricted by fixed system limits.'
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 25
      - name: filename
        in: query
        description: Filter the results to attachments that match the filename.
        schema:
          type: string
      - name: mediaType
        in: query
        description: Filter the results to attachments that match the media type.
        schema:
          type: string
      responses:
        '200':
          description: Returned if the requested attachments are returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentArray'
        '404':
          description: 'Returned if;


            - There is no parent content with the given ID.

            - The calling user does not have permission to view the parent content.'
          content: {}
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - read:confluence-content.summary
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - read:confluence-content.summary
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:content-details:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-atlassian-connect-scope: READ
    put:
      tags:
      - Content - Attachments
      summary: Atlassian Create Or Update Attachment
      description: 'Adds an attachment to a piece of content. If the attachment already exists<br>for the content, then the attachment is updated (i.e. a new version of the<br>attachment is created).<br><br>Note, you must set a `X-Atlassian-Token: nocheck` header on the request<br>for this method, otherwise it will be blocked. This protects against XSRF<br>attacks, which is necessary as this method accepts multipart/form-data.<br><br>The media type ''multipart/form-data'' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt).<br>Most client libraries have classes that make it easier to implement<br>multipart posts, like the [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)<br>Java class provided by Apache HTTP Components.<br><br>Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),<br>in the case where the form data is text,<br>the charset parameter for the "text/plain" Content-Type may be used to<br>indicate the character encoding used in that part. In the case of this<br>API endpoint, the `comment` body parameter should be sent with `type=text/plain`<br>and `charset=utf-8` values. This will force the charset to be UTF-8.<br><br>Example: This curl command attaches a file (''example.txt'') to a piece of<br>content (id=''123'') with a comment and `minorEdits`=true. If the ''example.txt''<br>file already exists, it will update it with a new version of the attachment.<br><br>``` bash<br>curl -D- \<br>  -u admin:admin \<br>  -X PUT \<br>  -H ''X-Atlassian-Token: nocheck'' \<br>  -F ''file=@"example.txt"'' \<br>  -F ''minorEdit="true"'' \<br>  -F ''comment="Example attachment comment"; type=text/plain; charset=utf-8'' \<br>  http://myhost/rest/api/content/123/child/attachment<br>```<br>**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:<br>Permission to update the content.'
      operationId: atlassianCreateorupdateattachments
      parameters:
      - name: id
        in: path
        description: The ID of the content to add the attachment to.
        required: true
        schema:
          type: string
      - name: status
        in: query
        description: 'The status of the content that the attachment is being added to.

          This should always be set to ''current''.'
        schema:
          type: string
          default: current
          enum:
          - current
          - draft
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - minorEdit
              properties:
                file:
                  type: string
                  description: 'The relative location and name of the attachment to be added to

                    the content.'
                  format: binary
                comment:
                  type: string
                  description: 'The comment for the attachment that is being added.

                    If you specify a comment, then every file must have a comment and

                    the comments must be in the same order as the files. Alternatively,

                    don''t specify any comments.'
                  format: binary
                minorEdit:
                  type: string
                  description: 'If `minorEdits` is set to ''true'', no notification email or activity stream

                    will be generated when the attachment is added to the content.'
                  format: binary
        required: true
      responses:
        '200':
          description: Returned if the attachments were added to the content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentArray'
        '403':
          description: 'Returned if;


            - Attachments are disabled.

            - The calling user does not have permission to add attachments to the

            content.'
          content: {}
        '404':
          description: 'Returned if;


            - The requested content is not found.

            - The user does not have permission to view it.

            - The attachment exceeds the maximum configured attachment size.'
          content: {}
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - write:confluence-file
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - write:confluence-file
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:content-details:confluence
        - write:attachment:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-atlassian-connect-scope: WRITE
    post:
      tags:
      - Content - Attachments
      summary: Atlassian Create Attachment
      description: 'Adds an attachment to a piece of content. This method only adds a new<br>attachment. If you want to update an existing attachment, use<br>[Create or update attachments](#api-content-id-child-attachment-put).<br><br>Note, you must set a `X-Atlassian-Token: nocheck` header on the request<br>for this method, otherwise it will be blocked. This protects against XSRF<br>attacks, which is necessary as this method accepts multipart/form-data.<br><br>The media type ''multipart/form-data'' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt).<br>Most client libraries have classes that make it easier to implement<br>multipart posts, like the [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)<br>Java class provided by Apache HTTP Components.<br><br>Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),<br>in the case where the form data is text,<br>the charset parameter for the "text/plain" Content-Type may be used to<br>indicate the character encoding used in that part. In the case of this<br>API endpoint, the `comment` body parameter should be sent with `type=text/plain`<br>and `charset=utf-8` values. This will force the charset to be UTF-8.<br><br>Example: This curl command attaches a file (''example.txt'') to a container<br>(id=''123'') with a comment and `minorEdits`=true.<br><br>``` bash<br>curl -D- \<br>  -u admin:admin \<br>  -X POST \<br>  -H ''X-Atlassian-Token: nocheck'' \<br>  -F ''file=@"example.txt"'' \<br>  -F ''minorEdit="true"'' \<br>  -F ''comment="Example attachment comment"; type=text/plain; charset=utf-8'' \<br>  http://myhost/rest/api/content/123/child/attachment<br>```<br>**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:<br>Permission to update the content.'
      operationId: atlassianCreateattachment
      parameters:
      - name: id
        in: path
        description: The ID of the content to add the attachment to.
        required: true
        schema:
          type: string
      - name: status
        in: query
        description: The status of the content that the attachment is being added to.
        schema:
          type: string
          default: current
          enum:
          - current
          - draft
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - minorEdit
              properties:
                file:
                  type: string
                  description: 'The relative location and name of the attachment to be added to

                    the content.'
                  format: binary
                comment:
                  type: string
                  description: 'The comment for the attachment that is being added.

                    If you specify a comment, then every file must have a comment and

                    the comments must be in the same order as the files. Alternatively,

                    don''t specify any comments.'
                  format: binary
                minorEdit:
                  type: string
                  description: 'If `minorEdits` is set to ''true'', no notification email or activity stream

                    will be generated when the attachment is added to the content.'
                  format: binary
        required: true
      responses:
        '200':
          description: Returned if the attachments were added to the content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentArray'
        '400':
          description: Returned if the content already has an attachment with the same filename.
          content: {}
        '403':
          description: 'Returned if;


            - Attachments are disabled in Confluence.

            - The calling user does not have permission to add attachments to the

            content.'
          content: {}
        '404':
          description: 'Returned if;


            - The requested content is not found.

            - The user does not have permission to view it

            - The attachment exceeds the maximum configured attachment size.'
          content: {}
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - write:confluence-file
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - write:confluence-file
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:content-details:confluence
        - write:attachment:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-atlassian-connect-scope: WRITE
  /wiki/rest/api/content/{id}/child/attachment/{attachmentId}:
    put:
      tags:
      - Content - Attachments
      summary: Atlassian Update Attachment Properties
      description: Updates the attachment properties, i.e. the non-binary data of an attachment<br>like the filename, media-type, comment, and parent container.<br><br>**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:<br>Permission to update the content.
      operationId: atlassianUpdateattachmentproperties
      parameters:
      - name: id
        in: path
        description: The ID of the content that the attachment is attached to.
        required: true
        schema:
          type: string
      - name: attachmentId
        in: path
        description: The ID of the attachment to update.
        required: true
        schema:
          type: string
      requestBody:
        description: The details of the attachment to be updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachmentPropertiesUpdateBody'
        required: true
      responses:
        '200':
          description: Returned if the attachment is updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Content'
        '400':
          description: 'Returned if;


            - The attachment id is invalid.

            - The attachment version number is invalid.'
          content: {}
        '403':
          description: 'Returned if;


            - The calling user is not permitted to update or move the attachment.

            - The attachment is being moved to an invalid content type.'
          content: {}
        '404':
          description: Returned if no attachment is found for the attachment ID.
          content: {}
        '409':
          description: 'Returned if the version of the supplied attachment does not match

            the version of the attachment stored in the database.'
          content: {}
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - write:confluence-file
        - write:confluence-props
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - write:confluence-file
        - write:confluence-props
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:content-details:confluence
        - write:attachment:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-codegen-request-body-name: body
      x-atlassian-connect-scope: WRITE
  /wiki/rest/api/content/{id}/child/attachment/{attachmentId}/data:
    post:
      tags:
      - Content - Attachments
      summary: Atlassian Update Attachment Data
      description: 'Updates the binary data of an attachment, given the attachment ID, and<br>optionally the comment and the minor edit field.<br><br>This method is essentially the same as [Create or update attachments](#api-content-id-child-attachment-put),<br>except that it matches the attachment ID rather than the name.<br><br>Note, you must set a `X-Atlassian-Token: nocheck` header on the request<br>for this method, otherwise it will be blocked. This protects against XSRF<br>attacks, which is necessary as this method accepts multipart/form-data.<br><br>The media type ''multipart/form-data'' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt).<br>Most client libraries have classes that make it easier to implement<br>multipart posts, like the [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)<br>Java class provided by Apache HTTP Components.<br><br>Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),<br>in the case where the form data is text,<br>the charset parameter for the "text/plain" Content-Type may be used to<br>indicate the character encoding used in that part. In the case of this<br>API endpoint, the `comment` body parameter should be sent with `type=text/plain`<br>and `charset=utf-8` values. This will force the charset to be UTF-8.<br><br>Example: This curl command updates an attachment (id=''att456'') that is attached<br>to a piece of content (id=''123'') with a comment and `minorEdits`=true.<br><br>``` bash<br>curl -D- \<br>  -u admin:admin \<br>  -X POST \<br>  -H ''X-Atlassian-Token: nocheck'' \<br>  -F ''file=@"example.txt"'' \<br>  -F ''minorEdit="true"'' \<br>  -F ''comment="Example attachment comment"; type=text/plain; charset=utf-8'' \<br>  http://myhost/rest/api/content/123/child/attachment/att456/data<br>```<br>**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:<br>Permission to update the content.'
      operationId: atlassianUpdateattachmentdata
      parameters:
      - name: id
        in: path
        description: The ID of the content that the attachment is attached to.
        required: true
        schema:
          type: string
      - name: attachmentId
        in: path
        description: The ID of the attachment to update.
        required: true
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - minorEdit
              properties:
                file:
                  type: string
                  description: 'The relative location and name of the attachment to be added to

                    the content.'
                  format: binary
                comment:
                  type: string
                  description: 'The comment for the attachment that is being added.

                    If you specify a comment, then every file must have a comment and

                    the comments must be in the same order as the files. Alternatively,

                    don''t specify any comments.'
                  format: binary
                minorEdit:
                  type: string
                  description: 'If `minorEdits` is set to ''true'', no notification email or activity stream

                    will be generated when the attachment is added to the content.'
                  format: binary
        required: true
      responses:
        '200':
          description: Returned if the attachment is updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Content'
        '400':
          description: Returned if the attachment id is invalid.
          content: {}
        '404':
          description: Returned if no attachment is found for the attachment ID.
          content: {}
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - write:confluence-file
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - write:confluence-file
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:content-details:confluence
        - write:attachment:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-atlassian-connect-scope: WRITE
  /wiki/rest/api/content/{id}/child/attachment/{attachmentId}/download:
    get:
      tags:
      - Content - Attachments
      summary: Atlassian Get Uri To Download Attachment
      description: Redirects the client to a URL that serves an attachment's binary data.
      operationId: atlassianDownloadattatchment
      parameters:
      - name: id
        in: path
        description: The ID of the content that the attachment is attached to.
        required: true
        schema:
          type: string
      - name: attachmentId
        in: path
        description: The ID of the attachment to download.
        required: true
        schema:
          type: string
      - name: version
        in: query
        description: The version of the attachment. If this parameter is absent, the redirect URI will download the latest version of the attachment.
        schema:
          type: integer
      responses:
        '302':
          description: Returned if download URL is found.
        '400':
          description: Returned if version number is greater than attachment's latest version number or an invalid value.
        '401':
          description: Returned if there are authentication issues in request.
        '404':
          description: 'Returned if;


            - No content is found with the specified content ID.

            - The specified content does not contain an attachment with the specified attachment ID.

            - The calling user does not have permission to view the attachment.'
      security:
      - basicAuth: []
      - oAuthDefinitions:
        - readonly:content.attachment:confluence
      x-atlassian-oauth2-scopes:
      - scheme: oAuthDefinitions
        state: Current
        scopes:
        - readonly:content.attachment:confluence
      - scheme: oAuthDefinitions
        state: Beta
        scopes:
        - read:attachment:confluence
      x-atlassian-data-security-policy:
      - app-access-rule-exempt: false
      x-atlassian-connect-scope: READ
components:
  schemas:
    LabelArray:
      required:
      - results
      - size
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Label'
        start:
          type: integer
          format: int32
        limit:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        _links:
          $ref: '#/components/schemas/GenericLinks'
    Space:
      required:
      - _expandable
      - _links
      - key
      - name
      - status
      - type
      nullable: true
      type: object
      properties:
        id:
          type: integer
          format: int64
        key:
          type: string
        name:
          type: string
        icon:
          $ref: '#/components/schemas/Icon'
        description:
          type: object
          properties:
            plain:
              $ref: '#/components/schemas/SpaceDescription'
            view:
              $ref: '#/components/schemas/SpaceDescription'
            _expandable:
              type: object
              properties:
                view:
                  type: string
                plain:
                  type: string
        homepage:
          $ref: '#/components/schemas/Content'
        type:
          type: string
        metadata:
          type: object
          properties:
            labels:
              $ref: '#/components/schemas/LabelArray'
            _expandable:
              type: object
        operations:
          type: array
          items:
            $ref: '#/components/schemas/OperationCheckResult'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/SpacePermission'
        status:
          type: string
        settings:
          $ref: '#/components/schemas/SpaceSettings'
        theme:
          $ref: '#/components/schemas/Theme'
        lookAndFeel:
          $ref: '#/components/schemas/LookAndFeel'
        history:
          required:
          - createdDate
          type: object
          properties:
            createdDate:
              type: string
              format: date-time
            createdBy:
              $ref: '#/components/schemas/User'
        _expandable:
          type: object
          properties:
            settings:
              type: string
            metadata:
              type: string
            operations:
              type: string
            lookAndFeel:
              type: string
            permissions:
              type: string
            icon:
              type: string
            description:
              type: string
            theme:
              type: string
            history:
              type: string
            homepage:
              type: string
            identifiers:
              type: string
        _links:
          $ref: '#/components/schemas/GenericLinks'
    HorizontalHeaderLookAndFeel:
      required:
      - backgroundColor
      - primaryNavigation
      type: object
      properties:
        backgroundColor:
          type: string
        button:
          $ref: '#/components/schemas/ButtonLookAndFeel'
        primaryNavigation:
          $ref: '#/components/schemas/TopNavigationLookAndFeel'
        secondaryNavigation:
          $ref: '#/components/schemas/NavigationLookAndFeel'
        search:
          $ref: '#/components/schemas/SearchFieldLookAndFeel'
    GenericLinks:
      type: object
      additionalProperties:
        oneOf:
        - type: object
          additionalProperties: true
        - type: string
    ButtonLookAndFeel:
      required:
      - backgroundColor
      - color
      type: object
      nullable: true
      properties:
        backgroundColor:
          type: string
        color:
          type: string
    UsersUserKeys:
      required:
      - userAccountIds
      nullable: true
      type: object
      additionalProperties: true
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
        userKeys:
          type: array
          items:
            type: string
        _links:
          $ref: '#/components/schemas/GenericLinks'
    AttachmentPropertiesUpdateBody:
      required:
      - id
      - type
      - version
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        type:
          type: string
          description: Set this to "attachment"
        status:
          type: string
        title:
          type: string
        container:
          $ref: '#/components/schemas/Container'
        metadata:
          type: object
          properties:
            mediaType:
              type: string
        extensions:
          type: object
        version:
          $ref: '#/components/schemas/Version'
    ContainerLookAndFeel:
      required:
      - background
      - backgroundColor
      - backgroundImage
      - backgroundSize
      - borderRadius
      - padding
      type: object
      nullable: true
      properties:
        background:
          type: string
        backgroundAttachment:
          type: string
          nullable: true
        backgroundBlendMode:
          type: string
          nullable: true
        backgroundClip:
          type: string
          nullable: true
        backgroundColor:
          type: string
          nullable: true
        backgroundImage:
          type: string
          nullable: true
        backgroundOrigin:
          type: string
          nullable: true
        backgroundPosition:
          type: string
          nullable: true
        backgroundRepeat:
          type: string
          nullable: true
        backgroundSize:
          type: string
          nullable: true
        padding:
          type: string
        borderRadius:
          type: string
    ContentChildType:
      type: object
      properties:
        attachment:
          required:
          - _links
          - value
          type: object
          properties:
            value:
              type: boolean
            _links:
              $ref: '#/components/schemas/GenericLinks'
        comment:
          required:
          - _links
          - value
          type: object
          properties:
            value:
              type: boolean
            _links:
              $ref: '#/components/schemas/GenericLinks'
        page:
          required:
          - _links
          - value
          type: object
          properties:
            value:
              type: boolean
            _links:
              $ref: '#/components/schemas/GenericLinks'
        _expandable:
          type: object
          properties:
            all:
              type: string
            attachment:
              type: string
            comment:
              type: string
            page:
              type: string
            whiteboard:
              type: string
      additionalProperties: true
      description: 'Shows whether a piece of content has attachments, comments, or child pages/whiteboards.

        Note, this doesn''t actually contain the child objects.'
    SearchFieldLookAndFeel:
      required:
      - backgroundColor
      - color
      type: object
      nullable: true
      properties:
        backgroundColor:
          type: string
        color:
          type: string
    MenusLookAndFeel:
      required:
      - color
      - hoverOrFocus
      type: object
      properties:
        hoverOrFocus:
          required:
          - backgroundColor
          type: object
          properties:
            backgroundColor:
              type: string
        color:
          type: string
    ContentHistory:
      required:
      - latest
      type: object
      nullable: true
      properties:
        latest:
          type: boolean
        createdBy:
          $ref: '#/components/schemas/User'
        ownedBy:
          $ref: '#/components/schemas/User'
        lastOwnedBy:
          $ref: '#/components/schemas/User'
        createdDate:
          type: string
          format: date-time
        lastUpdated:
          $ref: '#/components/schemas/Version'
        previousVersion:
          $ref: '#/components/schemas/Version'
        contributors:
          type: object
          properties:
            publishers:
              $ref: '#/components/schemas/UsersUserKeys'
        nextVersion:
          $ref: '#/components/schemas/Version'
        _expandable:
          type: object
          properties:
            lastUpdated:
              type: string
            previousVersion:
              type: string
            contributors:
              type: string
            nextVersion:
              type: string
            ownedBy:
              type: string
            lastOwnedBy:
              type: string
        _links:
          $ref: '#/components/schemas/GenericLinks'
    EmbeddedContent:
      type: object
      additionalProperties: true
      properties:
        entityId:
          type: integer
          format: int64
        entityType:
          type: string
        entity:
          $ref: '#/components/schemas/Embeddable'
    WebResourceDependencies:
      type: object
      properties:
        _expandable:
          type: object
          additionalProperties: true
          properties:
            uris:
              oneOf:
              - type: string
              - type: object
                additionalProperties: true
        keys:
          type: array
          items:
            type: string
        contexts:
          type: array
          items:
            type: string
        uris:
          type: object
          properties:
            all:
              oneOf:
              - type: array
                items:
                  type: string
              - type: string
            css:
              oneOf:
              - type: array
                items:
                  type: string
              - type: string
            js:
              oneOf:
              - type: array
                items:
                  type: string
              - type: str

# --- truncated at 32 KB (67 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/openapi/atlassian-content-attachments-api-openapi.yml