vivenu perks API
The perks API from vivenu — 2 operation(s) for perks.
The perks API from vivenu — 2 operation(s) for perks.
openapi: 3.0.3
info:
title: vivenu access-lists perks API
description: vivenu API Documentation
version: 1.0.0
contact:
name: vivenu GmbH
url: https://vivenu.com
servers:
- url: https://vivenu.com
description: Production API
- url: https://vivenu.dev
description: Staging API
tags:
- name: perks
paths:
/api/perks:
get:
security:
- jwt: []
- apikey: []
parameters:
- name: top
schema:
default: 25
description: A limit on the number of objects to be returned. Can range between 1 and 1000.
type: integer
minimum: 1
maximum: 1000
description: A limit on the number of objects to be returned. Can range between 1 and 1000.
in: query
required: true
style: form
explode: true
- name: skip
schema:
default: 0
description: The number of objects to skip for the requested result
type: integer
minimum: 0
maximum: 9007199254740991
description: The number of objects to skip for the requested result
in: query
required: true
style: form
explode: true
- name: name
schema:
description: Filter by perk name
type: string
description: Filter by perk name
in: query
required: false
style: form
explode: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
docs:
type: array
items:
$ref: '#/components/schemas/PerkResource'
total:
type: number
required:
- docs
- total
additionalProperties: false
'400':
description: Bad Request
'401':
description: Unauthorized
tags:
- perks
description: List all Perks
operationId: perks/list
post:
security:
- jwt: []
- apikey: []
parameters: []
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/PerkResource'
'400':
description: Bad Request
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
minLength: 1
description: The name of the perk
description:
description: A description of the perk
type: string
images:
description: URLs of perk images
type: array
items:
type: string
required:
- name
additionalProperties: false
tags:
- perks
description: Create a Perk
operationId: perks-create/create
/api/perks/{id}:
get:
security:
- jwt: []
- apikey: []
parameters:
- name: id
schema:
type: string
pattern: ^[a-z]+_.*$
in: path
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PerkResource'
'400':
description: Bad Request
'401':
description: Unauthorized
'404':
description: Not Found
tags:
- perks
description: Get a Perk by ID
operationId: perks/get
put:
security:
- jwt: []
- apikey: []
parameters:
- name: id
schema:
type: string
pattern: ^[a-z]+_.*$
in: path
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PerkResource'
'400':
description: Bad Request
'401':
description: Unauthorized
'404':
description: Not Found
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
minLength: 1
description: The name of the perk
description:
description: A description of the perk
type: string
images:
description: URLs of perk images
type: array
items:
type: string
additionalProperties: false
tags:
- perks
description: Update a Perk
operationId: perks/update
delete:
security:
- jwt: []
- apikey: []
parameters:
- name: id
schema:
type: string
pattern: ^[a-z]+_.*$
in: path
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PerkResource'
'400':
description: Bad Request
'401':
description: Unauthorized
'404':
description: Not Found
tags:
- perks
description: Delete a Perk
operationId: perks/delete
components:
schemas:
PerkResource:
type: object
properties:
_id:
type: string
description: The ID of the perk
name:
type: string
minLength: 1
description: The name of the perk
description:
description: A description of the perk
type: string
images:
description: URLs of perk images
type: array
items:
type: string
sellerId:
type: string
description: The ID of the seller owning this perk
createdAt:
description: When the perk was created
type: string
format: date-time
updatedAt:
description: When the perk was last updated
type: string
format: date-time
required:
- _id
- name
- sellerId
- createdAt
- updatedAt
additionalProperties: false
securitySchemes:
jwt:
type: http
scheme: bearer
bearerFormat: JWT
apikey:
type: apiKey
scheme: bearer
in: header
name: Authorization
customer-jwt:
type: http
scheme: bearer
bearerFormat: JWT
orgApiKey:
type: apiKey
scheme: bearer
in: header
name: Authorization