Elementum Related-items API

Manage the related items of a record

OpenAPI Specification

elementum-related-items-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Elementum Access Token Related-items API
  description: Manage access tokens using OAuth 2.0 standards
  contact:
    email: apiteam@elementum.io
  version: 0.0.1
servers:
- url: /v1
tags:
- name: Related-items
  description: Manage the related items of a record
paths:
  /{recordType}/{alias}/{id}/related-items:
    get:
      tags:
      - Related-items
      summary: Get the list of related items
      operationId: getRecordRelations
      parameters:
      - $ref: '#/components/parameters/recordType'
      - $ref: '#/components/parameters/alias'
      - $ref: '#/components/parameters/recordId'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelatedPagedList'
        '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:
      - Related-items
      summary: Add a related item
      operationId: createRecordRelatedItems
      parameters:
      - $ref: '#/components/parameters/recordType'
      - $ref: '#/components/parameters/alias'
      - $ref: '#/components/parameters/recordId'
      requestBody:
        description: the id and alias of the item to be related to this one
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelatedItemInput'
        required: true
      responses:
        '201':
          description: Created
        '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}/related-items/{itemId}:
    delete:
      tags:
      - Related-items
      summary: Remove a related item
      operationId: deleteRecordRelatedItems
      parameters:
      - $ref: '#/components/parameters/recordType'
      - $ref: '#/components/parameters/alias'
      - $ref: '#/components/parameters/recordId'
      - $ref: '#/components/parameters/itemId'
      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
components:
  schemas:
    RelatedListItem:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        alias:
          type: string
        cursor:
          type: string
    PagingState:
      type: object
      properties:
        has_previous_page:
          type: boolean
        start_cursor:
          type: string
        end_cursor:
          type: string
        has_next_page:
          type: boolean
    RelatedPagedList:
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/PagingState'
        total:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: '#/components/schemas/RelatedListItem'
      example: '{paging={has_previous_page=false, start_cursor=Ijf7eqZc0RlZmluaXRpb25zfDA=, end_cursor=cHJvY2Vzc0RlZmluaXRpb25zfDA=, has_next_page=false}, total=2, items=[{id=TSK-4, type=TASK, alias=tasks, cursor=Ijf7eqZc0RlZmluaXRpb25zfDA=}, {id=ITM-4, type=APP, alias=itmanagement, cursor=cHJvY2Vzc0RlZmluaXRpb25zfDA=}]}'
    RelatedItemInput:
      required:
      - id
      type: object
      properties:
        alias:
          type: string
        id:
          type: string
      example: '{alias=itmanagement, id=ITM-4}'
  parameters:
    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
    itemId:
      name: itemId
      in: path
      description: The ID of the related item
      required: true
      schema:
        type: string
        format: string
  responses:
    '422':
      description: Unprocessable Entity
    '404':
      description: Not Found
    '400':
      description: Bad Request
    '401':
      description: Unauthorized
    '403':
      description: Forbidden
    '500':
      description: Internal Server Error
    '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/