OpenAPI Specification
openapi: 3.0.1
info:
title: Elementum Access Token Watchers API
description: Manage access tokens using OAuth 2.0 standards
contact:
email: apiteam@elementum.io
version: 0.0.1
servers:
- url: /v1
tags:
- name: Watchers
description: Manage the watchers of a record
paths:
/{recordType}/{alias}/{id}/watchers:
get:
tags:
- Watchers
summary: Get the list of watchers
operationId: listRecordWatchers
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
- $ref: '#/components/parameters/first'
- $ref: '#/components/parameters/after'
- $ref: '#/components/parameters/last'
- $ref: '#/components/parameters/before'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/WatcherPagedList'
'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:
- Watchers
summary: Add a watcher
operationId: createRecordWatchers
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
requestBody:
description: The watcher to be added
content:
application/json:
schema:
$ref: '#/components/schemas/WatcherListInput'
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
delete:
tags:
- Watchers
summary: Delete a watcher
operationId: deleteRecordWatchers
parameters:
- $ref: '#/components/parameters/recordType'
- $ref: '#/components/parameters/alias'
- $ref: '#/components/parameters/recordId'
requestBody:
description: The watcher to be removed
content:
application/json:
schema:
$ref: '#/components/schemas/WatcherListInput'
required: true
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:
parameters:
last:
name: last
in: query
description: The number of elements to retrieve before the 'before' cursor location
required: false
schema:
maximum: 1000
minimum: 1
type: integer
format: int32
first:
name: first
in: query
description: The number of elements to retrieve after the 'after' cursor location
required: false
schema:
maximum: 1000
minimum: 1
type: integer
format: int32
default: 100
alias:
name: alias
in: path
description: The app's namespace or its UUID
required: true
schema:
type: string
format: string
after:
name: after
in: query
description: The starting cursor to begin searching, defaults to the beginning of the list
required: false
schema:
type: 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
before:
name: before
in: query
description: The starting cursor to begin searching, defaults to the end of the list
required: false
schema:
type: string
schemas:
PagingState:
type: object
properties:
has_previous_page:
type: boolean
start_cursor:
type: string
end_cursor:
type: string
has_next_page:
type: boolean
WatcherPagedList:
type: object
properties:
paging:
$ref: '#/components/schemas/PagingState'
total:
type: integer
format: int32
items:
type: array
items:
$ref: '#/components/schemas/Watcher'
example: '{paging={has_previous_page=false, start_cursor=Ijf7eqZc0RlZmluaXRpb25zfDA=, end_cursor=cHJvY2Vzc0RlZmluaXRpb25zfDA=, has_next_page=false}, total=2, items=[{target={firstName=Jane, id=550e8400-e29b-41d4-a716-446655440001, lastName=Doe, email=jane@example.com, type=User}, id=550e8400-e29b-41d4-a716-446655440000}, {target={name=Engineering, id=550e8400-e29b-41d4-a716-446655440003, type=Group}, id=550e8400-e29b-41d4-a716-446655440002}]}'
Watcher:
type: object
properties:
target:
$ref: '#/components/schemas/WatcherTarget'
id:
type: string
description: The watcher ID
format: uuid
WatcherTarget:
type: object
properties:
lastName:
type: string
description: The user's last name (User targets only)
firstName:
type: string
description: The user's first name (User targets only)
id:
type: string
description: The target ID
format: uuid
type:
type: string
description: The watcher target type (User or Group)
email:
type: string
description: The user's email (User targets only)
name:
type: string
description: The group name (Group targets only)
WatcherListInput:
type: object
properties:
users:
type: array
items:
type: string
format: email
example: '{users=[user1@email.com, user2@email.com]}'
responses:
'401':
description: Unauthorized
'422':
description: Unprocessable Entity
'429':
description: Too Many Requests
'403':
description: Forbidden
'500':
description: Internal Server Error
'404':
description: Not Found
'400':
description: Bad Request
securitySchemes:
ClientCredentials:
type: oauth2
flows:
clientCredentials:
tokenUrl: /oauth/token
externalDocs:
description: Find out more about Elementum
url: https://www.elementum.com/