{ "openapi" : "3.0.1", "info" : { "title" : "Account Test Child Api", "description" : "Get information about a HubSpot account and its API usage.", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE" }, "x-hubspot-documentation-banner" : "NONE" }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Activity" }, { "name" : "Usage" }, { "name" : "Details" } ], "paths" : { "/account-info/v3/activity/login" : { "get" : { "tags" : [ "Activity" ], "summary" : "Get login activity for a HubSpot account.", "description" : "Get login activity.", "operationId" : "get-/account-info/v3/activity/login", "parameters" : [ { "name" : "after", "in" : "query", "description" : "The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string" } }, { "name" : "limit", "in" : "query", "description" : "The maximum number of results to display per page. Max value of limit is 200.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32" } }, { "name" : "userId", "in" : "query", "description" : "Identifier of user to retrieve activities for", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponsePublicLoginAuditForwardPaging" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2_legacy" : [ "account-info.security.read" ] }, { "private_apps_legacy" : [ "account-info.security.read" ] } ] } }, "/account-info/v3/activity/audit-logs" : { "get" : { "tags" : [ "Activity" ], "operationId" : "get-/account-info/v3/activity/audit-logs", "parameters" : [ { "name" : "after", "in" : "query", "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string" } }, { "name" : "limit", "in" : "query", "description" : "The maximum number of results to display per page.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32" } }, { "name" : "actingUserId", "in" : "query", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "array", "items" : { "type" : "integer", "format" : "int32" } } }, { "name" : "occurredAfter", "in" : "query", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string", "format" : "date-time" } }, { "name" : "occurredBefore", "in" : "query", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string", "format" : "date-time" } }, { "name" : "sort", "in" : "query", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "array", "items" : { "type" : "string" } } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponsePublicApiUserActionEventForwardPaging" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2_legacy" : [ "account-info.security.read" ] }, { "private_apps_legacy" : [ "account-info.security.read" ] } ] } }, "/account-info/v3/api-usage/daily" : { "get" : { "tags" : [ "Usage" ], "summary" : "Get the daily API usage and limits for a HubSpot account.", "description" : "Get daily API usage", "operationId" : "get-/account-info/v3/api-usage/daily", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseApiUsageNoPaging" }, "example" : { "results" : [ { "name" : "api-calls-daily", "usageLimit" : 500000, "currentUsage" : 1, "collectedAt" : "2020-04-10T06:46:40.789Z", "fetchStatus" : "NOTFOUND", "resetsAt" : "2020-04-10T04:00:00Z" } ] } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ ] } }, "/account-info/v3/details" : { "get" : { "tags" : [ "Details" ], "summary" : "Get account details for a HubSpot account.", "description" : "Get account details", "operationId" : "get-/account-info/v3/details", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalInformationResponse" }, "example" : { "portalId" : 12345678, "timeZone" : "US/Eastern", "companyCurrency" : "USD", "additionalCurrencies" : [ "NZD", "AUD", "EUR" ], "utcOffset" : "-04:00", "utcOffsetMilliseconds" : -14400000, "uiDomain" : "app-eu1.hubspot.com", "dataHostingLocation" : "eu1" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "private_apps_legacy" : [ "oauth" ] }, { "oauth2_legacy" : [ "oauth" ] } ] } }, "/account-info/v3/activity/security" : { "get" : { "tags" : [ "Activity" ], "summary" : "Get security activity for a HubSpot account", "description" : "Get security activity", "operationId" : "get-/account-info/v3/activity/security", "parameters" : [ { "name" : "after", "in" : "query", "description" : "The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "string" } }, { "name" : "limit", "in" : "query", "description" : "The maximum number of results to display per page. Max value of limit is 200.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32" } }, { "name" : "userId", "in" : "query", "description" : "Identifier of user to retrieve activities for", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32" } }, { "name" : "fromTimestamp", "in" : "query", "description" : "Limit to activities created after this epoch timestamp.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseHydratedCriticalActionForwardPaging" } } } }, "default" : { "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2_legacy" : [ "account-info.security.read" ] }, { "private_apps_legacy" : [ "account-info.security.read" ] } ] } } }, "components" : { "schemas" : { "CollectionResponsePublicApiUserActionEventForwardPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "paging" : { "$ref" : "#/components/schemas/ForwardPaging" }, "results" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/PublicApiUserActionEvent" } } } }, "PublicLoginAudit" : { "required" : [ "id", "loginAt", "loginSucceeded" ], "type" : "object", "properties" : { "regionCode" : { "type" : "string", "description" : "The approximate region code of the login", "example" : "d" }, "countryCode" : { "type" : "string", "description" : "The approximate country code of the login", "example" : "ie" }, "ipAddress" : { "type" : "string", "description" : "IP address where the activity originated.", "example" : "45.56.67.89" }, "location" : { "type" : "string" }, "userAgent" : { "type" : "string", "description" : "Information about the device used for logging in.", "example" : "Mozilla/5.0 (Linux; Android 11; M2101K6G)" }, "id" : { "type" : "string", "description" : "The login activity's unique ID.", "example" : "5432653" }, "loginAt" : { "type" : "string", "description" : "The time the login took place.", "format" : "date-time", "example" : "2022-04-01T19:36:24.303+00:00" }, "userId" : { "type" : "integer", "description" : "The user's unique ID.", "format" : "int32", "example" : 876 }, "email" : { "type" : "string", "description" : "Email address of the user associated with the login.", "example" : "person3@testdomain.com" }, "loginSucceeded" : { "type" : "boolean", "description" : "Whether the login was successful or not.", "example" : true } }, "description" : "Details about the a particular login activity for a HubSpot account.", "example" : { "id" : "5432653", "loginAt" : "2022-04-01T19:36:24.303Z", "userId" : 876, "email" : "person3@testdomain.com", "countryCode" : "ie", "regionCode" : "d", "ipAddress" : "45.56.67.89", "userAgent" : "Mozilla/5.0 (Linux; Android 11; M2101K6G)", "loginSucceeded" : true } }, "HydratedCriticalAction" : { "required" : [ "createdAt", "id", "type", "userId" ], "type" : "object", "properties" : { "createdAt" : { "type" : "string", "description" : "The time the activity took place.", "format" : "date-time", "example" : "2022-04-01T19:36:24.303+00:00" }, "actingUser" : { "type" : "string", "description" : "Email address of the user associated with the activity.", "example" : "person3@testdomain.com" }, "regionCode" : { "type" : "string", "description" : "The approximate region code", "example" : "d" }, "infoUrl" : { "type" : "string", "description" : "A link to the URL where the action was taken in the account.", "example" : "app.hubspot.com/settings/123/users" }, "countryCode" : { "type" : "string", "description" : "The approximate country code", "example" : "ie" }, "ipAddress" : { "type" : "string", "description" : "IP address where the activity originated.", "example" : "45.56.67.89" }, "location" : { "type" : "string" }, "id" : { "type" : "string", "description" : "The activity's unique ID.", "example" : "5432653" }, "type" : { "type" : "string", "description" : "The type of activity.", "example" : "ADD_USER" }, "userId" : { "type" : "integer", "description" : "The user's unique ID.", "format" : "int32", "example" : 876 }, "objectId" : { "type" : "string", "description" : "The ID of the affected object.", "example" : "7654" } }, "description" : "Details about the a particular security activity for a HubSpot account.", "example" : { "id" : "5432653", "createdAt" : "2022-04-01T19:36:24.303Z", "userId" : 876, "type" : "ADD_USER", "actingUser" : "person3@testdomain.com", "objectId" : "7654", "infoUrl" : "app.hubspot.com/settings/123/users", "ipAddress" : "45.56.67.89", "countryCode" : "ie", "regionCode" : "d" } }, "ActingUser" : { "required" : [ "userId" ], "type" : "object", "properties" : { "userEmail" : { "type" : "string" }, "userId" : { "type" : "integer", "format" : "int32" } } }, "PublicApiUserActionEvent" : { "required" : [ "actingUser", "action", "category", "id", "occurredAt" ], "type" : "object", "properties" : { "actingUser" : { "$ref" : "#/components/schemas/ActingUser" }, "subCategory" : { "type" : "string" }, "occurredAt" : { "type" : "string", "format" : "date-time" }, "targetObjectId" : { "type" : "string" }, "action" : { "type" : "string" }, "id" : { "type" : "string" }, "category" : { "type" : "string" } } }, "PortalInformationResponse" : { "required" : [ "accountType", "additionalCurrencies", "companyCurrency", "dataHostingLocation", "portalId", "timeZone", "uiDomain", "utcOffset", "utcOffsetMilliseconds" ], "type" : "object", "properties" : { "additionalCurrencies" : { "type" : "array", "items" : { "type" : "string" } }, "utcOffset" : { "type" : "string" }, "companyCurrency" : { "type" : "string" }, "portalId" : { "type" : "integer", "format" : "int32" }, "accountType" : { "type" : "string", "enum" : [ "STANDARD", "DEVELOPER_TEST", "SANDBOX", "APP_DEVELOPER" ] }, "uiDomain" : { "type" : "string" }, "timeZone" : { "type" : "string" }, "dataHostingLocation" : { "type" : "string" }, "utcOffsetMilliseconds" : { "type" : "integer", "format" : "int64" } } }, "Error" : { "required" : [ "category", "correlationId", "message" ], "type" : "object", "properties" : { "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error" }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "items" : { "type" : "string" } }, "description" : "Context about the error condition", "example" : { "missingScopes" : [ "scope1", "scope2" ], "invalidPropertyName" : [ "propertyValue" ] } }, "correlationId" : { "type" : "string", "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", "format" : "uuid", "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string" }, "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps", "example" : { "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : "Invalid input (details will vary based on the error)" }, "category" : { "type" : "string", "description" : "The error category", "example" : "VALIDATION_ERROR" }, "errors" : { "type" : "array", "description" : "further information about the error", "items" : { "$ref" : "#/components/schemas/ErrorDetail" } } }, "example" : { "message" : "Invalid input (details will vary based on the error)", "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", "category" : "VALIDATION_ERROR", "links" : { "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } } }, "CollectionResponseHydratedCriticalActionForwardPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "paging" : { "$ref" : "#/components/schemas/ForwardPaging" }, "results" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/HydratedCriticalAction" } } } }, "CollectionResponseApiUsageNoPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "results" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ApiUsage" } } } }, "ErrorDetail" : { "required" : [ "message" ], "type" : "object", "properties" : { "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error" }, "code" : { "type" : "string", "description" : "The status code associated with the error detail" }, "in" : { "type" : "string", "description" : "The name of the field or parameter in which the error was found." }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "items" : { "type" : "string" } }, "description" : "Context about the error condition", "example" : { "missingScopes" : [ "scope1", "scope2" ] } }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate" } } }, "CollectionResponsePublicLoginAuditForwardPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "paging" : { "$ref" : "#/components/schemas/ForwardPaging" }, "results" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/PublicLoginAudit" } } } }, "ApiUsage" : { "required" : [ "collectedAt", "currentUsage", "fetchStatus", "name", "usageLimit" ], "type" : "object", "properties" : { "collectedAt" : { "type" : "string", "description" : "Indicates when the cache was last updated.", "format" : "date-time" }, "usageLimit" : { "type" : "integer", "description" : "Limits by which a single integration can consume the HubSpot public APIs.", "format" : "int32" }, "fetchStatus" : { "type" : "string", "description" : "Status of fetching the information, including if the data came from the cache.", "enum" : [ "SUCCESS", "TIMEOUT", "FAILURE", "CACHED", "NOTFOUND" ] }, "name" : { "type" : "string", "description" : "Name of the limit type." }, "currentUsage" : { "type" : "integer", "description" : "How many API calls an account has made for the current day.", "format" : "int32" }, "resetsAt" : { "type" : "string", "description" : "Time that the limit will reset.", "format" : "date-time" } }, "description" : "API usage and limits information for a HubSpot account." }, "ForwardPaging" : { "type" : "object", "properties" : { "next" : { "$ref" : "#/components/schemas/NextPage" } } }, "NextPage" : { "required" : [ "after" ], "type" : "object", "properties" : { "link" : { "type" : "string" }, "after" : { "type" : "string" } } } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" } } } } }, "securitySchemes" : { "oauth2_legacy" : { "type" : "oauth2", "flows" : { "authorizationCode" : { "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", "scopes" : { "account-info.security.read" : "Allows reading of account security information", "oauth" : "User and Account Information" } } } }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" } } } }