{ "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": "Get Open API Definition", "responses": {}, "tags": [] } }, "/1/auth/register": { "operationId": "post-1-auth-register", "post": { "summary": "Register", "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.eyJ1c2VySWQiOiI1Y2U0M2I1OTIxNWRkYzdhZWMyM2UwZjciLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjEyNzQsImV4cCI6MTU2MTA1MzI3NH0.Tf1nZeNNMliegQa_4z2hfxGV8KYi1rzrylDusccPuxQ" } } } } } } }, "400": { "description": "A user with that email already exists" } }, "tags": [ "auth" ] } }, "/1/auth/login": { "operationId": "post-1-auth-login", "post": { "summary": "Login", "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.eyJ1c2VySWQiOiI1Y2U0M2I1ODIxNWRkYzdhZWMyM2UwZjYiLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjEyNzMsImV4cCI6MTU2MTA1MzI3M30.E1TSNb1BKeaWpO0FNtEBlTcT7Vm7JX1b4no0TYxzyyY" } } } } } } }, "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": "Request password", "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": "Set Password", "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.eyJ1c2VySWQiOiI1Y2U0M2I1YTIxNWRkYzdhZWMyM2UwZjkiLCJ0eXBlIjoidXNlciIsImtpZCI6InVzZXIiLCJpYXQiOjE1NTg0NjEyNzQsImV4cCI6MTU2MTA1MzI3NH0.uqKSCM-K18t6_8Wcj3ut_FGY-iiyy9FlSt3rpy4dI2U" } } } } } } }, "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": "5ce43b59d366737aed11f3ca", "roles": [], "email": "email1@platform.com", "name": "test user", "createdAt": "2019-05-21T17:54:33.874Z", "updatedAt": "2019-05-21T17:54:33.874Z" } } } } } } } }, "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": "5ce43b59d366737aed11f3cb", "roles": [], "email": "email2@platform.com", "name": "other name", "createdAt": "2019-05-21T17:54:33.953Z", "updatedAt": "2019-05-21T17:54:33.987Z" } } } } } } } }, "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": "5ce43b5ad366737aed11f3ce", "roles": [ "user" ], "email": "email5@platform.com", "name": "Two", "createdAt": "2019-05-21T17:54:34.007Z", "updatedAt": "2019-05-21T17:54:34.007Z" }, { "id": "5ce43b5ad366737aed11f3cd", "roles": [ "user" ], "email": "email4@platform.com", "name": "One", "createdAt": "2019-05-21T17:54:34.003Z", "updatedAt": "2019-05-21T17:54:34.003Z" }, { "id": "5ce43b59d366737aed11f3cc", "roles": [ "admin" ], "email": "email3@platform.com", "name": "test user", "createdAt": "2019-05-21T17:54:34.000Z", "updatedAt": "2019-05-21T17:54:34.000Z" }, { "id": "5ce43b59d366737aed11f3cb", "roles": [], "email": "email2@platform.com", "name": "other name", "createdAt": "2019-05-21T17:54:33.953Z", "updatedAt": "2019-05-21T17:54:33.987Z" }, { "id": "5ce43b59d366737aed11f3ca", "roles": [], "email": "email1@platform.com", "name": "test user", "createdAt": "2019-05-21T17:54:33.874Z", "updatedAt": "2019-05-21T17:54:33.874Z" } ], "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": "5ce43b5ad366737aed11f3d1", "roles": [], "email": "hello@dominiek.com", "name": "Hello", "createdAt": "2019-05-21T17:54:34.059Z", "updatedAt": "2019-05-21T17:54:34.059Z" } } } } } } }, "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": "5ce43b5ad366737aed11f3d8", "roles": [ "user" ], "email": "email14@platform.com", "name": "new name", "createdAt": "2019-05-21T17:54:34.373Z", "updatedAt": "2019-05-21T17:54:34.373Z" } } } } } } } }, "tags": [ "users" ] }, "get": { "summary": "Get user", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43b5ad366737aed11f3dc", "roles": [ "user" ], "email": "email18@platform.com", "name": "One", "createdAt": "2019-05-21T17:54:34.394Z", "updatedAt": "2019-05-21T17:54:34.394Z" } } } } } } } }, "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": "5ce43b592f25bd7aeedee4d7", "sellingPoints": [], "name": "test 2", "description": "Some description", "shopId": "5ce43b592f25bd7aeedee4d6", "createdAt": "2019-05-21T17:54:33.891Z", "updatedAt": "2019-05-21T17:54:33.891Z" }, { "id": "5ce43b592f25bd7aeedee4d5", "sellingPoints": [], "name": "test 1", "description": "Some description", "shopId": "5ce43b592f25bd7aeedee4d4", "createdAt": "2019-05-21T17:54:33.888Z", "updatedAt": "2019-05-21T17:54:33.888Z" } ], "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": "5ce43b5a2f25bd7aeedee4da", "sellingPoints": [], "name": "some other product", "shopId": "5ce43b592f25bd7aeedee4d9", "createdAt": "2019-05-21T17:54:34.001Z", "updatedAt": "2019-05-21T17:54:34.001Z" } } } } } } } }, "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": "5ce43b5a2f25bd7aeedee4e0", "sellingPoints": [], "name": "new name", "description": "Some description", "shopId": "5ce43b5a2f25bd7aeedee4df", "createdAt": "2019-05-21T17:54:34.031Z", "updatedAt": "2019-05-21T17:54:34.040Z" } } } } } } } }, "tags": [ "products" ] }, "get": { "summary": "Get product", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43b5a2f25bd7aeedee4e3", "sellingPoints": [], "name": "test 1", "description": "Some description", "shopId": "5ce43b5a2f25bd7aeedee4e2", "createdAt": "2019-05-21T17:54:34.052Z", "updatedAt": "2019-05-21T17:54:34.052Z" } } } } } } } }, "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": "5ce43b582f0bcf7aef850db1", "images": [], "name": "test 2", "description": "Some description", "createdAt": "2019-05-21T17:54:32.907Z", "updatedAt": "2019-05-21T17:54:32.907Z" }, { "id": "5ce43b582f0bcf7aef850db0", "images": [], "name": "test 1", "description": "Some description", "createdAt": "2019-05-21T17:54:32.902Z", "updatedAt": "2019-05-21T17:54:32.902Z" } ], "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": "5ce43b592f0bcf7aef850db4", "images": [ { "id": "5ce43b592f0bcf7aef850db3", "filename": "logo.png", "rawUrl": "logo.png", "hash": "test", "storageType": "local", "mimeType": "image/png", "ownerId": "none", "createdAt": "2019-05-21T17:54:33.052Z", "updatedAt": "2019-05-21T17:54:33.052Z" } ], "name": "shop name", "createdAt": "2019-05-21T17:54:33.066Z", "updatedAt": "2019-05-21T17:54:33.066Z" } } } } } } } }, "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": "5ce43b592f0bcf7aef850db8", "images": [], "name": "new name", "description": "Some description", "createdAt": "2019-05-21T17:54:33.113Z", "updatedAt": "2019-05-21T17:54:33.124Z" } } } } } } } }, "tags": [ "shops" ] }, "get": { "summary": "Get shop", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": { "data": { "id": "5ce43b592f0bcf7aef850dba", "images": [], "name": "test 1", "description": "Some description", "createdAt": "2019-05-21T17:54:33.135Z", "updatedAt": "2019-05-21T17:54:33.135Z" } } } } } } } }, "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": "5ce43b593fbd2e7af288a2f0", "filename": "logo.png", "rawUrl": "logo.png", "hash": "test", "storageType": "local", "mimeType": "image/png", "ownerId": "5ce43b593fbd2e7af288a2ef", "createdAt": "2019-05-21T17:54:33.945Z", "updatedAt": "2019-05-21T17:54:33.960Z", "deletedAt": "2019-05-21T17:54:33.959Z" } } } } } } } }, "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": "5ce43b593fbd2e7af288a2ee", "mimeType": "image/png", "filename": "logo.png", "hash": "b9769511b4e2e6b6a6c2d099fa8d9efb8861e468358d29704b87496aebf7f66c", "rawUrl": "/var/folders/z9/vjt2qj311zv_vy0gmn29vcmc0000gn/T/upload_7216754fb3407567a4d883b022c63ccf", "storageType": "local", "thumbnailUrl": "/var/folders/z9/vjt2qj311zv_vy0gmn29vcmc0000gn/T/upload_7216754fb3407567a4d883b022c63ccf", "ownerId": "5ce43b593fbd2e7af288a2ed", "createdAt": "2019-05-21T17:54:33.924Z", "updatedAt": "2019-05-21T17:54:33.924Z" } } } } } } } }, "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": "5ce43b58847d457af099ea27", "email": "usera@platform.com", "createdAt": "2019-05-21T17:54:32.882Z", "updatedAt": "2019-05-21T17:54:32.882Z" }, { "id": "5ce43b58847d457af099ea28", "email": "userb@platform.com", "createdAt": "2019-05-21T17:54:32.887Z", "updatedAt": "2019-05-21T17:54:32.887Z" } ], "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" ] } } } }