openapi: 3.2.0 info: title: CoreStack External Attachments API version: 1.0.0 termsOfService: http://corestack.io/ license: name: CoreStack Inc License url: http://corestack.io/licenses/LICENSE-2.0.html description: Manage Attachments servers: - url: / tags: - name: Attachments description: Manage Attachments paths: /v1/attachment/batch: post: responses: '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ModelError' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ModelError' '200': description: Fetched content: application/json: schema: type: array items: $ref: '#/components/schemas/Attachment' summary: Get Attachments description: Fetch a batch of Attachments operationId: batch security: - auth_token: [] tags: - Attachments requestBody: content: application/json: schema: $ref: '#/components/schemas/BatchRequest' required: true /v1/attachment/create: post: responses: '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ModelError' '200': description: Created content: application/json: schema: $ref: '#/components/schemas/Attachment' summary: Create new Attachment description: Create a new Attachment operationId: create security: - auth_token: [] tags: - Attachments requestBody: content: application/json: schema: $ref: '#/components/schemas/Attachment' required: true /v1/attachment/item/{attachment_id}: parameters: - name: attachment_id in: path required: true schema: type: string get: responses: '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ModelError' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ModelError' '200': description: Found content: application/json: schema: $ref: '#/components/schemas/Attachment' summary: Get an Attachment description: Get an Attachment operationId: get security: - auth_token: [] tags: - Attachments post: responses: '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ModelError' '200': description: Created content: application/json: schema: $ref: '#/components/schemas/Attachment' summary: Update an Attachment description: Update an Attachment operationId: update security: - auth_token: [] tags: - Attachments requestBody: content: application/json: schema: $ref: '#/components/schemas/Attachment' required: true /v1/attachment/item/{attachment_id}/stream: parameters: - name: attachment_id in: path required: true schema: type: string post: responses: '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ModelError' '200': description: Created content: application/json: schema: $ref: '#/components/schemas/Attachment' summary: Upload an Attachment description: Upload an Attachment operationId: upload security: - auth_token: [] tags: - Attachments requestBody: content: application/octet-stream: schema: $ref: '#/components/schemas/InputStream' required: true /v1/attachment/item/{attachment_id}/stream/{file_name}: parameters: - name: attachment_id in: path required: true schema: type: string - name: file_name in: path required: true schema: type: string get: responses: '500': description: Internal Server Error content: application/octet-stream: schema: $ref: '#/components/schemas/ModelError' '401': description: Unauthorized content: application/octet-stream: schema: $ref: '#/components/schemas/ModelError' '400': description: Bad Request content: application/octet-stream: schema: $ref: '#/components/schemas/ModelError' '404': description: Not Found content: application/octet-stream: schema: $ref: '#/components/schemas/ModelError' '200': description: Found content: application/octet-stream: schema: $ref: '#/components/schemas/InputStream' summary: Download an Attachment description: Download an Attachment operationId: download security: - auth_token: [] tags: - Attachments components: schemas: BatchRequest: properties: ids: type: array description: Identifiers to fetch items: type: string type: object Attachment: required: - file_name - name properties: id: type: string created_at: type: string format: date-time description: Date and Time of the attachment created_by: type: string description: Creator of the attachment updated_at: type: string format: date-time description: Last update of the attachment updated_by: type: string description: Updated By name: type: string description: Name of the attachment description: type: string description: Description of the attachment file_name: type: string description: Original file name of the attachment type: object InputStream: properties: bytes: type: object type: object ModelError: required: - message properties: message: type: string description: Error response message. type: object securitySchemes: auth_token: type: apiKey in: header name: X-Auth-Token