OpenAPI Specification
openapi: 3.0.1
info:
title: Elementum Access Token Attachments API
description: Manage access tokens using OAuth 2.0 standards
contact:
email: apiteam@elementum.io
version: 0.0.1
servers:
- url: /v1
tags:
- name: Attachments
description: Manage the attachments of a record
paths:
/{recordType}/{alias}/{id}/attachments:
get:
tags:
- Attachments
summary: Get the list of attachments
operationId: listRecordAttachments
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/AttachmentList'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
post:
tags:
- Attachments
summary: Add an attachment
operationId: createRecordAttachment
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
requestBody:
description: the attachment to be uploaded
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/File'
required: true
responses:
'202':
description: Accepted
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
/{recordType}/{alias}/{id}/attachments/url-links:
post:
tags:
- Attachments
summary: Add a link
operationId: createRecordLink
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
requestBody:
description: The link to be created
content:
application/json:
schema:
$ref: '#/components/schemas/AttachmentLink'
required: true
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/AttachmentLink'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
/{recordType}/{alias}/{id}/attachments/{attachmentId}:
get:
tags:
- Attachments
summary: Find an attachment by ID
operationId: getRecordAttachment
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
- $ref: '#/components/parameters/attachmentId'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/Attachment'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
delete:
tags:
- Attachments
summary: Delete a record attachment
operationId: deleteRecordAttachments
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
- $ref: '#/components/parameters/attachmentId'
responses:
'200':
description: Ok
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
/{recordType}/{alias}/{id}/attachments/{attachmentId}/content:
get:
tags:
- Attachments
summary: Download attachment content
operationId: downloadRecordAttachment
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
- $ref: '#/components/parameters/attachmentId'
responses:
'200':
description: Ok
content:
application/octet-stream: {}
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
'422':
$ref: '#/components/responses/422'
'429':
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
security:
- ClientCredentials: []
x-codegen-request-body-name: body
components:
parameters:
attachmentId:
name: attachmentId
in: path
description: The ID of the attachment
required: true
schema:
type: string
format: string
recordType:
name: recordType
in: path
description: '''apps'', ''elements'', ''tasks'', or ''transactions'''
required: true
schema:
type: string
format: string
recordId:
name: id
in: path
description: The record ID
required: true
schema:
type: string
format: string
alias:
name: alias
in: path
description: The app's namespace or its UUID
required: true
schema:
type: string
format: string
schemas:
AttachmentLink:
required:
- url
type: object
properties:
description:
type: string
url:
type: string
example:
description: a link to url.com
url: url.com
File:
type: object
properties:
file:
type: string
format: binary
AttachmentList:
type: array
items:
$ref: '#/components/schemas/Attachment'
Attachment:
type: object
properties:
contentUrl:
type: string
description: URL path to download the attachment content
viewState:
type: string
description: The visibility state of the attachment (e.g., PRIVATE, PUBLIC)
state:
type: string
description: The processing state of the attachment (e.g., VALID, PROCESSING, ERROR)
mediaType:
type: string
description: The MIME type of the attachment
id:
type: string
description: The attachment ID
name:
type: string
description: The attachment filename
createdAt:
type: string
description: When the attachment was created
format: date-time
description:
type: string
description: The attachment description
size:
type: integer
description: The file size in bytes
format: int32
example: '{contentUrl=/v1/apps/my-namespace/REC-001/attachments/abc-123/content, viewState=PRIVATE, state=VALID, mediaType=application/pdf, id=abc-123, name=invoice.pdf, createdAt=2026-02-03T10:30:00Z, description=Q4 Invoice, size=245678}'
responses:
'500':
description: Internal Server Error
'422':
description: Unprocessable Entity
'404':
description: Not Found
'400':
description: Bad Request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Too Many Requests
securitySchemes:
ClientCredentials:
type: oauth2
flows:
clientCredentials:
tokenUrl: /oauth/token
externalDocs:
description: Find out more about Elementum
url: https://www.elementum.com/