{ "openapi": "3.0.1", "info": { "title": "Platform API", "version": "1.0.0", "description": "# Introduction\nThis portal provides documentation for all API calls in this platform. \n" }, "paths": { "": { "operationId": "get", "get": { "summary": "List ", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "version": "1.0.0" } } } } } } }, "tags": [] } }, "/openapi.json": { "operationId": "get-openapi.json", "get": { "summary": "List ", "responses": {}, "tags": [] } }, "/1/auth/register": { "operationId": "post-1-auth-register", "post": { "summary": "Create Auth", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email" }, "name": { "type": "string" }, "password": { "type": "string", "minLength": 6 } }, "additionalProperties": false, "patterns": [], "required": [ "email", "name", "password" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Y2U0M2UzNjJjMDY1NTdlMmVmMmI2Y2EiLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjIwMDYsImV4cCI6MTU2MTA1NDAwNn0.sHfAnjTYVlY-z43MoaBYoG4FFN1v-Nf3A7InzO5QLlE" } } } } } } }, "400": { "description": "A user with that email already exists" } }, "tags": [ "Auth" ] } }, "/1/auth/login": { "operationId": "post-1-auth-login", "post": { "summary": "Create Auth", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "email", "password" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Y2U0M2UzNTJjMDY1NTdlMmVmMmI2YzkiLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjIwMDYsImV4cCI6MTU2MTA1NDAwNn0.drJLLFzprumLSGr1Szh-7XBng1IL4_4v-gxbywywUaM" } } } } } } }, "401": { "description": "email password combination does not match" } }, "tags": [ "Auth" ] } }, "/1/auth/accept-invite": { "operationId": "post-1-auth-accept-invite", "post": { "summary": "Create Auth", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string", "minLength": 6 } }, "additionalProperties": false, "patterns": [], "required": [ "name", "password" ] } } } }, "responses": { "500": { "description": "Invite could not be found" } }, "tags": [ "Auth" ] } }, "/1/auth/request-password": { "operationId": "post-1-auth-request-password", "post": { "summary": "Create Auth", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email" } }, "additionalProperties": false, "patterns": [], "required": [ "email" ] } } } }, "responses": { "204": { "description": "success" } }, "tags": [ "Auth" ] } }, "/1/auth/set-password": { "operationId": "post-1-auth-set-password", "post": { "summary": "Create Auth", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string" }, "password": { "type": "string", "minLength": 6 } }, "additionalProperties": false, "patterns": [], "required": [ "token", "password" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Y2U0M2UzNjJjMDY1NTdlMmVmMmI2Y2MiLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjIwMDcsImV4cCI6MTU2MTA1NDAwN30.xPe8XEUQgWX-pLxgskYDjsP6pbHVGT3kLZc7aTXvev8" } } } } } } }, "500": { "description": "user does not exists" } }, "tags": [ "Auth" ] } }, "/1/users/me": { "operationId": "patch-1-users-me", "get": { "summary": "List Users", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e35fcc36b7e2fceb108", "roles": [], "email": "email1@platform.com", "name": "test user", "createdAt": "2019-05-21T18:06:45.787Z", "updatedAt": "2019-05-21T18:06:45.787Z" } } } } } } } }, "tags": [ "Users" ] }, "patch": { "summary": "Update User", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "timeZone": { "type": "string" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e35fcc36b7e2fceb109", "roles": [], "email": "email2@platform.com", "name": "other name", "createdAt": "2019-05-21T18:06:45.883Z", "updatedAt": "2019-05-21T18:06:45.927Z" } } } } } } } }, "tags": [ "Users" ] } }, "/1/users/search": { "operationId": "post-1-users-search", "post": { "summary": "Search User", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "skip": { "default": 0, "type": "number" }, "sort": { "default": { "field": "createdAt", "order": "desc" }, "type": "object", "properties": { "field": { "type": "string" }, "order": { "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "field", "order" ] }, "limit": { "default": 50, "type": "number" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": [ { "id": "5ce43e35fcc36b7e2fceb10c", "roles": [ "user" ], "email": "email5@platform.com", "name": "Two", "createdAt": "2019-05-21T18:06:45.944Z", "updatedAt": "2019-05-21T18:06:45.944Z" }, { "id": "5ce43e35fcc36b7e2fceb10b", "roles": [ "user" ], "email": "email4@platform.com", "name": "One", "createdAt": "2019-05-21T18:06:45.942Z", "updatedAt": "2019-05-21T18:06:45.942Z" }, { "id": "5ce43e35fcc36b7e2fceb10a", "roles": [ "admin" ], "email": "email3@platform.com", "name": "test user", "createdAt": "2019-05-21T18:06:45.939Z", "updatedAt": "2019-05-21T18:06:45.939Z" }, { "id": "5ce43e35fcc36b7e2fceb109", "roles": [], "email": "email2@platform.com", "name": "other name", "createdAt": "2019-05-21T18:06:45.883Z", "updatedAt": "2019-05-21T18:06:45.927Z" }, { "id": "5ce43e35fcc36b7e2fceb108", "roles": [], "email": "email1@platform.com", "name": "test user", "createdAt": "2019-05-21T18:06:45.787Z", "updatedAt": "2019-05-21T18:06:45.787Z" } ], "meta": { "total": 5, "skip": 0, "limit": 50 } } } } } } } }, "tags": [ "Users" ] } }, "/1/users": { "operationId": "post-1-users", "post": { "summary": "Create User", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "password": { "type": "string", "minLength": 6 } }, "additionalProperties": false, "patterns": [], "required": [ "email", "name", "password" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e35fcc36b7e2fceb10f", "roles": [], "email": "hello@dominiek.com", "name": "Hello", "createdAt": "2019-05-21T18:06:45.994Z", "updatedAt": "2019-05-21T18:06:45.994Z" } } } } } } }, "400": { "description": "A user with that email already exists" } }, "tags": [ "Users" ] } }, "/1/users/:user": { "parameters": [ { "name": "user", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "get-1-users-:user", "delete": { "summary": "Delete User", "responses": { "204": { "description": "success" } }, "tags": [ "Users" ] }, "patch": { "summary": "Update User", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e36fcc36b7e2fceb116", "roles": [ "user" ], "email": "email14@platform.com", "name": "new name", "createdAt": "2019-05-21T18:06:46.338Z", "updatedAt": "2019-05-21T18:06:46.338Z" } } } } } } } }, "tags": [ "Users" ] }, "get": { "summary": "Get User", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e36fcc36b7e2fceb11a", "roles": [ "user" ], "email": "email18@platform.com", "name": "One", "createdAt": "2019-05-21T18:06:46.363Z", "updatedAt": "2019-05-21T18:06:46.363Z" } } } } } } } }, "tags": [ "Users" ] } }, "/1/products/search": { "operationId": "post-1-products-search", "post": { "summary": "Search Product", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "skip": { "default": 0, "type": "number" }, "sort": { "default": { "field": "createdAt", "order": "desc" }, "type": "object", "properties": { "field": { "type": "string" }, "order": { "enum": [ "asc", "desc" ], "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "field", "order" ] }, "shopId": { "type": "string" }, "limit": { "default": 50, "type": "number" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": [ { "id": "5ce43e358337667e31c50be3", "sellingPoints": [], "name": "test 2", "description": "Some description", "shopId": "5ce43e358337667e31c50be2", "createdAt": "2019-05-21T18:06:45.813Z", "updatedAt": "2019-05-21T18:06:45.813Z" }, { "id": "5ce43e358337667e31c50be1", "sellingPoints": [], "name": "test 1", "description": "Some description", "shopId": "5ce43e358337667e31c50be0", "createdAt": "2019-05-21T18:06:45.809Z", "updatedAt": "2019-05-21T18:06:45.809Z" } ], "meta": { "total": 2, "skip": 0, "limit": 50 } } } } } } } }, "tags": [ "Products" ] } }, "/1/products": { "operationId": "post-1-products", "post": { "summary": "Create Product", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "shopId": { "type": "string" }, "description": { "type": "string" }, "expiresAt": { "type": "string" }, "priceUsd": { "type": "number", "minimum": 0.1, "maximum": 1000000 }, "isFeatured": { "type": "boolean" }, "sellingPoints": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false, "patterns": [], "required": [ "name", "shopId" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e358337667e31c50be6", "sellingPoints": [], "name": "some other product", "shopId": "5ce43e358337667e31c50be5", "createdAt": "2019-05-21T18:06:45.940Z", "updatedAt": "2019-05-21T18:06:45.940Z" } } } } } } } }, "tags": [ "Products" ] } }, "/1/products/:product": { "parameters": [ { "name": "product", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "get-1-products-:product", "delete": { "summary": "Delete Product", "responses": { "204": { "description": "success" } }, "tags": [ "Products" ] }, "patch": { "summary": "Update Product", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "shopId": { "type": "string" }, "description": { "type": "string" }, "expiresAt": { "type": "string" }, "priceUsd": { "type": "number", "minimum": 0.1, "maximum": 1000000 }, "isFeatured": { "type": "boolean" }, "sellingPoints": { "type": "array", "items": { "type": "string" } }, "id": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e358337667e31c50bec", "sellingPoints": [], "name": "new name", "description": "Some description", "shopId": "5ce43e358337667e31c50beb", "createdAt": "2019-05-21T18:06:45.971Z", "updatedAt": "2019-05-21T18:06:45.981Z" } } } } } } } }, "tags": [ "Products" ] }, "get": { "summary": "Get Product", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e358337667e31c50bef", "sellingPoints": [], "name": "test 1", "description": "Some description", "shopId": "5ce43e358337667e31c50bee", "createdAt": "2019-05-21T18:06:45.991Z", "updatedAt": "2019-05-21T18:06:45.991Z" } } } } } } } }, "tags": [ "Products" ] } }, "/1/shops/search": { "operationId": "post-1-shops-search", "post": { "summary": "Search Shop", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "skip": { "default": 0, "type": "number" }, "sort": { "default": { "field": "createdAt", "order": "desc" }, "type": "object", "properties": { "field": { "type": "string" }, "order": { "enum": [ "asc", "desc" ], "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "field", "order" ] }, "limit": { "default": 50, "type": "number" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": [ { "id": "5ce43e353f21e97e322e452a", "images": [], "name": "test 2", "description": "Some description", "createdAt": "2019-05-21T18:06:45.848Z", "updatedAt": "2019-05-21T18:06:45.848Z" }, { "id": "5ce43e353f21e97e322e4529", "images": [], "name": "test 1", "description": "Some description", "createdAt": "2019-05-21T18:06:45.844Z", "updatedAt": "2019-05-21T18:06:45.844Z" } ], "meta": { "total": 2, "skip": 0, "limit": 50 } } } } } } } }, "tags": [ "Shops" ] } }, "/1/shops": { "operationId": "post-1-shops", "post": { "summary": "Create Shop", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "country": { "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "name" ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e353f21e97e322e452d", "images": [ { "id": "5ce43e353f21e97e322e452c", "filename": "logo.png", "rawUrl": "logo.png", "hash": "test", "storageType": "local", "mimeType": "image/png", "ownerId": "none", "createdAt": "2019-05-21T18:06:45.967Z", "updatedAt": "2019-05-21T18:06:45.967Z" } ], "name": "shop name", "createdAt": "2019-05-21T18:06:45.980Z", "updatedAt": "2019-05-21T18:06:45.980Z" } } } } } } } }, "tags": [ "Shops" ] } }, "/1/shops/:shop": { "parameters": [ { "name": "shop", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "get-1-shops-:shop", "delete": { "summary": "Delete Shop", "responses": { "204": { "description": "success" } }, "tags": [ "Shops" ] }, "patch": { "summary": "Update Shop", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "country": { "type": "string" }, "id": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e363f21e97e322e4531", "images": [], "name": "new name", "description": "Some description", "createdAt": "2019-05-21T18:06:46.029Z", "updatedAt": "2019-05-21T18:06:46.047Z" } } } } } } } }, "tags": [ "Shops" ] }, "get": { "summary": "Get Shop", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e363f21e97e322e4533", "images": [], "name": "test 1", "description": "Some description", "createdAt": "2019-05-21T18:06:46.058Z", "updatedAt": "2019-05-21T18:06:46.058Z" } } } } } } } }, "tags": [ "Shops" ] } }, "/1/uploads/:hash": { "parameters": [ { "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "get-1-uploads-:hash", "get": { "summary": "Get Upload", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e36acda327e34de5097", "filename": "logo.png", "rawUrl": "logo.png", "hash": "test", "storageType": "local", "mimeType": "image/png", "ownerId": "5ce43e36acda327e34de5096", "createdAt": "2019-05-21T18:06:46.630Z", "updatedAt": "2019-05-21T18:06:46.640Z", "deletedAt": "2019-05-21T18:06:46.639Z" } } } } } } } }, "tags": [ "Uploads" ] } }, "/1/uploads/:hash/image": { "parameters": [ { "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "get-1-uploads-:hash-image", "get": { "summary": "Get Upload", "responses": {}, "tags": [ "Uploads" ] } }, "/1/uploads": { "operationId": "post-1-uploads", "post": { "summary": "Create Upload", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43e36acda327e34de5095", "mimeType": "image/png", "filename": "logo.png", "hash": "e33f137c674224b8bc45ce9a5c52224cde686e24f5bb33034549d527af560da7", "rawUrl": "/var/folders/z9/vjt2qj311zv_vy0gmn29vcmc0000gn/T/upload_55e36f96a58920a9a7750ae766eae963", "storageType": "local", "thumbnailUrl": "/var/folders/z9/vjt2qj311zv_vy0gmn29vcmc0000gn/T/upload_55e36f96a58920a9a7750ae766eae963", "ownerId": "5ce43e36acda327e34de5094", "createdAt": "2019-05-21T18:06:46.612Z", "updatedAt": "2019-05-21T18:06:46.612Z" } } } } } } } }, "tags": [ "Uploads" ] } }, "/1/uploads/:upload": { "parameters": [ { "name": "upload", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "delete-1-uploads-:upload", "delete": { "summary": "Delete Upload", "responses": { "204": { "description": "success" } }, "tags": [ "Uploads" ] } }, "/1/invites/search": { "operationId": "post-1-invites-search", "post": { "summary": "Search Invite", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "skip": { "default": 0, "type": "number" }, "sort": { "default": { "field": "createdAt", "order": "asc" }, "type": "object", "properties": { "field": { "type": "string" }, "order": { "type": "string" } }, "additionalProperties": false, "patterns": [], "required": [ "field", "order" ] }, "limit": { "default": 50, "type": "number" } }, "additionalProperties": false, "patterns": [] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": [ { "id": "5ce43e352395697e309857cd", "email": "usera@platform.com", "createdAt": "2019-05-21T18:06:45.851Z", "updatedAt": "2019-05-21T18:06:45.851Z" }, { "id": "5ce43e352395697e309857ce", "email": "userb@platform.com", "createdAt": "2019-05-21T18:06:45.855Z", "updatedAt": "2019-05-21T18:06:45.855Z" } ], "meta": { "total": 2, "skip": 0, "limit": 50 } } } } } } } }, "tags": [ "Invites" ] } }, "/1/invites": { "operationId": "post-1-invites", "post": { "summary": "Create Invite", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "emails": { "type": "array", "items": { "type": "string", "format": "email" } } }, "additionalProperties": false, "patterns": [], "required": [ "emails" ] } } } }, "responses": { "204": { "description": "success" } }, "tags": [ "Invites" ] } }, "/1/invites/:invite/resend": { "parameters": [ { "name": "invite", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "post-1-invites-:invite-resend", "post": { "summary": "Create Invite", "responses": { "204": { "description": "success" } }, "tags": [ "Invites" ] } }, "/1/invites/:invite": { "parameters": [ { "name": "invite", "in": "path", "required": true, "schema": { "type": "string" } } ], "operationId": "delete-1-invites-:invite", "delete": { "summary": "Delete Invite", "responses": { "204": { "description": "success" } }, "tags": [ "Invites" ] } } } }