{ "openapi": "3.0.3", "info": { "description": "You can use Admin API to create and manage your Human API users", "version": "1.0.0", "title": "Admin API", "termsOfService": "https://www.humanapi.co/developer-terms", "contact": { "email": "help@humanapi.co", "url": "https://www.humanapi.co/contact" } }, "servers": [ { "url": "https://admin.humanapi.co", "description": "Production server" } ], "tags": [ { "name": "subscriptions", "description": "API endpoints to manage subscriptions", "externalDocs": { "description": "Find out more", "url": "https://reference.humanapi.co/docs/admin-api" } } ], "paths": { "/api/v1/subscriptions": { "post": { "tags": [ "subscriptions" ], "description": "Create a new subscription", "operationId": "createSubscription", "requestBody": { "description": "Subscription details to add to the system", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/subscription" }, "examples": { "createNewSubscription": { "summary": "Create a user and send an invitation email", "value": { "clientUserId": "whateverIdValueYouWant", "subscriberEmail": "agent@acme.co", "subscriberFirstName": "Jane", "subscriberLastName": "Doe", "subscriberOffice": "nw676", "role": "producer" } } } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/subscription" } } } } }, "401": { "$ref": "#/components/responses/unauthorized" }, "404": { "$ref": "#/components/responses/notFound" }, "409": { "$ref": "#/components/responses/conflict" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "subscription": { "type": "object", "required": [ "clientUserId", "subscriberEmail", "role" ], "properties": { "clientUserId": { "type": "string" }, "subscriberEmail": { "type": "string" }, "role": { "type": "string" }, "subscriberOffice": { "type": "string" }, "subscriberFirstName": { "type": "string" }, "subscriberLastName": { "type": "string" } } }, "error": { "type": "object", "required": [ "statusCode", "error", "message", "x-humanapi-request-id" ], "properties": { "code": { "type": "integer", "format": "int32" }, "error": { "type": "string" }, "message": { "type": "string" }, "x-humanapi-request-id": { "type": "string" } } } }, "responses": { "unauthorized": { "description": "The token provided is invalid. It may have expired or may have been revoked.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" }, "example": { "code": 401, "error": "Unauthorized", "message": "Cannot authenticate you with this token", "x-humanapi-request-id": "05518ca2-1c9a-434e-8512-7284bbc54137" } } } }, "notFound": { "description": "The specified resource was not found (e.g. the id does not exist)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" }, "example": { "code": 404, "error": "Not Found", "message": "Not Found", "x-humanapi-request-id": "05518ca2-1c9a-434e-8512-7284bbc54137" } } } }, "conflict": { "description": "There is a conflict with the specified resource (e.g. it may already exist)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" }, "example": { "code": 409, "error": "Conflict", "message": "Unable to match the login of the new user to an existing user found for that user", "x-humanapi-request-id": "05518ca2-1c9a-434e-8512-7284bbc54137" } } } } } }, "security": [ { "bearerAuth": [] } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true } }