{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aurinko/json-schema/aurinko-api-account-out-dto-schema.json",
  "title": "ApiAccountOutDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aurinko-account-api-openapi.yml#/components/schemas/ApiAccountOutDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "parentId": {
      "type": "integer",
      "format": "int64"
    },
    "serviceType": {
      "$ref": "#/$defs/ServiceType"
    },
    "active": {
      "type": "boolean",
      "description": "The account is always active in the current API version"
    },
    "tokenStatus": {
      "$ref": "#/$defs/TokenStatus"
    },
    "tokenError": {
      "type": "string"
    },
    "type": {
      "$ref": "#/$defs/AccountType"
    },
    "daemon": {
      "type": "boolean"
    },
    "loginString": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "mailboxAddress": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "name2": {
      "type": "string"
    },
    "serverUrl": {
      "type": "string"
    },
    "serverUrl2": {
      "type": "string"
    },
    "clientOrgId": {
      "type": "string"
    },
    "authUserId": {
      "type": "string"
    },
    "authOrgId": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "tokenIssuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "authScopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Scope"
      }
    },
    "authNativeScopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/NativeScope"
      }
    },
    "authObtainedAt": {
      "type": "string",
      "format": "date-time"
    },
    "authExpiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "userId": {
      "type": "string"
    }
  },
  "$defs": {
    "AccountType": {
      "type": "string",
      "enum": [
        "daemon",
        "personal",
        "managed"
      ]
    },
    "NativeScope": {
      "type": "string",
      "description": "Native scope from provider's API."
    },
    "Scope": {
      "type": "string",
      "enum": [
        "Calendar.Read",
        "Calendar.ReadWrite",
        "Mail.Read",
        "Mail.ReadWrite",
        "Mail.Send",
        "Mail.Drafts",
        "Mail.All",
        "Contacts.Read",
        "Contacts.ReadWrite",
        "Tasks.Read",
        "Tasks.ReadWrite"
      ],
      "description": "Space separated list of scopes"
    },
    "ServiceType": {
      "type": "string",
      "enum": [
        "Google",
        "GoogleBot",
        "Office365",
        "EWS",
        "IMAP",
        "Salesforce",
        "Salesflare",
        "Repfabric",
        "MsTeamsBot",
        "Slack",
        "SlackBot",
        "SugarCRM",
        "HighLevel",
        "Hubspot",
        "Zoom",
        "ZoomBot",
        "Webex",
        "WebexBot",
        "Pipedrive",
        "EclipseERP",
        "AutoQuotes",
        "Teamwork",
        "NetSuite",
        "MCTrade",
        "SpecPath",
        "Zoho",
        "Clientify",
        "QuickBooks",
        "ActiveCampaign",
        "Creatio",
        "ConstantContact",
        "Fishbowl",
        "iCloud"
      ]
    },
    "TokenStatus": {
      "type": "string",
      "enum": [
        "active",
        "invalid",
        "dead"
      ],
      "description": "* active - means the token is active and ready for use\n* invalid - means that Aurinko failed to access provider API with authentication data.\n   Basically it indicates that Aurinko has received a 401 http status from provider and marked this token as non-active.\n* dead - this is a special variant of \"invalid\" status that can occur only with OAuth 2.0 accounts.\n   It means that Aurinko failed to refresh OAuth access token and received \"invalid_grant\" error which indicates\n   that the access/refresh tokens pair cannot be used anymore and is basically dead.\n   The difference between invalid and dead is that with invalid tokens Aurinko will still try to\n   access provider API and with dead Aurinko won't even attempt:\n   trying to use dead token, Aurinko will just return 401 without making calls to the provider.\n"
    }
  }
}