{ "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": "users", "description": "API endpoints to manage users", "externalDocs": { "description": "Find out more", "url": "https://reference.humanapi.co/docs/admin-api" } } ], "paths": { "/api/v1/users": { "post": { "tags": [ "users" ], "description": "Create a new user", "operationId": "createUser", "requestBody": { "description": "User details to add to the system", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/newUser" }, "examples": { "createUserSendEmail": { "summary": "Create a user and send an invitation email", "value": { "clientUserId": "whateverIdValueYouWant", "clientUserEmail": "jane.doe@humanapi.co", "firstName": "Jane", "lastName": "Doe", "dateOfBirth": "1968-02-13T00:00:00.000Z", "autoInvite": true } }, "createUserNoEmail": { "summary": "Create a user but do not send an invitation email", "value": { "clientUserId": "whateverIdValueYouWant", "clientUserEmail": "jane.doe@humanapi.co", "firstName": "Jane", "lastName": "Doe", "dateOfBirth": "1968-02-13T00:00:00.000Z", "autoInvite": false } }, "createUserWithSuggestedSources": { "summary": "Create a user including suggested sources", "value": { "clientUserId": "whateverIdValueYouWant", "clientUserEmail": "jane.doe@humanapi.co", "firstName": "Jane", "lastName": "Doe", "dateOfBirth": "1968-02-13T00:00:00.000Z", "autoInvite": false, "suggestedSources": [ "Starfleet", "Hospital Plus" ] } }, "createUserWithDemographics": { "summary": "Create a user with demographics", "value": { "clientUserId": "whateverIdValueYouWant", "clientUserEmail": "jane.doe@humanapi.co", "firstName": "Jane", "middleName": "Austin", "lastName": "Doe", "gender": "female", "dateOfBirth": "1968-02-13T00:00:00.000Z", "ssn": "123-45-6789", "phone": "411-133-2332", "orderType": "healthcheck", "autoInvite": false, "address": { "street1": "969-1762 Buttery Rd.", "city": "Boise", "state": "VA", "zip": "54886" }, "conditions": [ "COPD", "Tobacco use" ], "providers": [ { "name": "Maxwell Forrest M.D.", "organizationName": "Brentwood North Family Practice", "clientProviderId": "client custom id", "npi": "national provider identifier", "address": { "street1": "6818 Eget St.", "street2": "6818 Eget St.", "city": "Tacoma", "state": "AL", "zip": "92508" }, "phone": "425-288-2332", "fax": "715-912-6931", "mrn": "000TB0009-3" }, { "name": "Dr. Alban", "address": { "street1": "361-7936 Feugiat St.", "city": "Las Vegas", "state": "NV", "zip": "58521" }, "mrn": "000AZ0002-9", "npi": "1234567890" } ], "attachments": [ { "type": "hipaaAuthorization", "contentType": "application/pdf", "encoding": "base64", "content": "" } ] } } } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/user" } } } } }, "202": { "description": "Accepted", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/user" } } } } }, "400": { "$ref": "#/components/responses/invalidEntity" }, "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": { "user": { "type": "object", "additionalProperties": false, "required": [ "humanId", "clientUserEmail", "createdAt", "updatedAt", "status" ], "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "dateOfBirth": { "type": "string", "format": "date-time", "example": "1968-02-13T00:00:00.000Z" }, "humanId": { "type": "string" }, "clientUserEmail": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "status": { "type": "string" }, "suggestedSources": { "type": "array", "items": { "type": "string" } }, "inviteLink": { "type": "string" } } }, "newUser": { "type": "object", "additionalProperties": false, "required": [ "clientUserId" ], "properties": { "clientUserId": { "type": "string" }, "clientUserEmail": { "type": "string" }, "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" }, "gender": { "type": "string", "enum": [ "male", "female", "other" ] }, "dateOfBirth": { "type": "string", "description": "A string with one of the following formats:\n- YYYY-MM-DD Example: 1990-12-30\n- M/D/YY Example: 3/23/89\n- M/D/YYYY Example: 2/12/2004\n- YYYY-MM-DDTHH:mmZ as ECMA-262 Example: 1990-12-30T00:00Z the timezone is optional\n- YYYY-MM-DDTHH:mm:ssZ as ECMA-262 Example: 1990-12-30T00:00:00Z the timezone is optional\n- YYYY-MM-DDTHH:mm:ss.sssZ as ECMA-262 Example: 1990-12-30T00:00:00.000Z the timezone is optional\n" }, "ssn": { "type": "string", "pattern": "^(((?!(666|000))\\d{3}(?!0{2})\\d{2}(?!0{4})\\d{4})|((?!(666|000))\\d{3}-(?!0{2})\\d{2}-(?!0{4})\\d{4}))$" }, "phone": { "type": "string", "pattern": "^(([()\\- .]{0,2}\\d){10})[()\\- .]{0,2}$" }, "autoInvite": { "type": "boolean" }, "orderType": { "type": "string" }, "clientData": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] } }, "suggestedSources": { "type": "array", "items": { "type": "string" } }, "conditions": { "type": "array", "description": "Include order-specific conditions or additional instructions for APS retrieval orders", "items": { "type": "string" } }, "address": { "$ref": "#/components/schemas/address" }, "providers": { "type": "array", "items": { "$ref": "#/components/schemas/provider" } }, "attachments": { "type": "array", "items": { "$ref": "#/components/schemas/attachment" } } } }, "provider": { "type": "object", "additionalProperties": false, "required": [ "name", "address" ], "properties": { "name": { "type": "string" }, "organizationName": { "type": "string" }, "clientProviderId": { "type": "string" }, "address": { "$ref": "#/components/schemas/address" }, "phone": { "type": "string", "pattern": "^(([()\\- .]{0,2}\\d){10})[()\\- .]{0,2}$" }, "fax": { "type": "string", "pattern": "^(([()\\- .]{0,2}\\d){10})[()\\- .]{0,2}$" }, "mrn": { "type": "string" }, "npi": { "oneOf": [ { "type": "string", "minLength": 0 }, { "type": "number" } ], "description": "This field can be a string, number, or an empty string." } } }, "attachment": { "type": "object", "additionalProperties": false, "required": [ "type", "contentType", "encoding", "content" ], "properties": { "type": { "type": "string" }, "contentType": { "type": "string" }, "encoding": { "type": "string" }, "content": { "type": "string" } } }, "address": { "type": "object", "additionalProperties": false, "required": [ "street1", "city", "state", "zip" ], "properties": { "street1": { "type": "string" }, "street2": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" }, "zip": { "type": "integer" } } }, "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" } } }, "errorInvalidInput": { "type": "object", "required": [ "statusCode", "error", "message", "validation", "x-humanapi-request-id" ], "properties": { "statusCode": { "type": "integer", "format": "int32" }, "error": { "type": "string" }, "message": { "type": "string" }, "validation": { "type": "object", "required": [ "source", "keys" ], "properties": { "source": { "type": "string", "enum": [ "payload" ] }, "keys": { "type": "array", "items": { "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" } } } }, "invalidEntity": { "description": "There is a semantic error with the content of the request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errorInvalidInput" }, "example": { "statusCode": 400, "error": "Bad Request", "message": "\"dateOfBirth\" must be a valid date", "validation": { "source": "payload", "keys": [ "dateOfBirth" ] }, "x-humanapi-request-id": "fd05b02c-f527-4178-a907-42c2c3ac28c1" } } } } } }, "security": [ { "bearerAuth": [] } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true } }