{
  "openapi": "3.0.1",
  "info": {
    "title": "Accounts",
    "description": "The Accounts API allows you register users and to access user account information. You can use it to retrieve details such as the user's e-mail address or the account's block status. You can also use it to block, and in some cases unblock, user accounts.",
    "contact": {
      "name": "Tilia, Inc.",
      "url": "https://www.tilia-inc.com",
      "email": "tilia@lindenlab.com"
    },
    "license": {
      "name": "Tilia, Inc.",
      "url": "https://www.tilia-inc.com/contact/"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://accounts.tilia-inc.com",
      "description": "Production Environment"
    },
    {
      "url": "https://accounts.staging.tilia-inc.com",
      "description": "Staging Environment"
    }
  ],
  "paths": {
    "/register": {
      "post": {
        "summary": "Register account",
        "description": "Register a new user account. Each user account must be created with at least one of the following: user's email address or `user_ID` from an external payment provider (e.g. Steam or Oculus).\n\n\nWhen a value for one of the `external_platforms`is specified, a special _Pay on Behalf of_ (POBO) payment method will be created for the user, which can be used in subsequent transactions. If provided, full name and address details will be associated with the user's POBO payment method. When providing PII, `state_province` and `country_iso` must be sent together in the same request. All other fields can be sent separately.  For more information about this type of interaction, refer to [External Payment Platforms](/guides/external-payment-platforms/).\n| Successful completion triggers this notification |\n| :--- |\n| {% openapiLink text=\"Register account completed\" link=\"accounts/openapi/webhooks/registeraccountcompleted\" /%} |",
        "operationId": "RegisterAccountHandler",
        "requestBody": {
          "description": "Account resource",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/RegisterAccountResponse"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicResponse"
                },
                "example": {
                  "status": "Failure",
                  "message": [
                    "input is invalid"
                  ],
                  "codes": [
                    "INPUT_ERROR"
                  ],
                  "payload": {
                    "errors": {
                      "account_id": [
                        "INVALID_VALUE"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "409": {
            "$ref": "#/components/responses/registrationConflict"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "write_registrations"
            ]
          }
        ]
      }
    },
    "/v2/merge-accounts": {
      "post": {
        "summary": "Merge accounts",
        "description": "Merge source account virtual token balances into destination account wallets\n\nThe source account is closed and both accounts are tagged accordingly.",
        "operationId": "MergeAccounts",
        "requestBody": {
          "description": "Merge account request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseSuccess"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicResponse"
                },
                "example": {
                  "status": "Failure",
                  "message": [
                    "input is invalid"
                  ],
                  "codes": [
                    "INPUT_ERROR"
                  ],
                  "payload": {
                    "errors": {
                      "account_id": [
                        "INVALID_VALUE"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "write_accounts"
            ]
          }
        ]
      }
    },
    "/v2/block": {
      "post": {
        "summary": "Block account capability",
        "description": "Prevents an account from performing the specified capability.\n| Successful completion triggers this notification |\n| :--- |\n| {% openapiLink text=\"Account blocked/unblocked\" link=\"accounts/openapi/webhooks/accountblock\" /%} |\n\n\nFor more information about event notifications, visit [Webhooks](/webhooks/).",
        "operationId": "BlockAccount",
        "requestBody": {
          "description": "Block account request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicResponse"
                },
                "example": {
                  "status": "Failure",
                  "message": [
                    "input is invalid"
                  ],
                  "codes": [
                    "INPUT_ERROR"
                  ],
                  "payload": {
                    "errors": {
                      "account_id": [
                        "INVALID_VALUE"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "write_accounts"
            ]
          }
        ]
      }
    },
    "/v2/block/{account_id}/capability/{block_capability}": {
      "delete": {
        "summary": "Unblock account capability",
        "description": "Permit a previously blocked account capability.\n| Successful completion triggers this notification |\n| :--- |\n| {% openapiLink text=\"Account blocked/unblocked\" link=\"accounts/openapi/webhooks/accountblock\" /%} |\n\n\nFor more information about event notifications, visit [Webhooks](/webhooks/).",
        "operationId": "UnblockAccount",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "Tilia account ID",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          },
          {
            "name": "block_capability",
            "in": "path",
            "description": "Prevented account capability\n\n**Possible values**:\n\n- `login`: Prevents account from accessing the platform. This capability includes all other block capabilities",
            "required": true,
            "schema": {
              "type": "string",
              "example": "login"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicResponse"
                },
                "example": {
                  "status": "Failure",
                  "message": [
                    "input is invalid"
                  ],
                  "codes": [
                    "INPUT_ERROR"
                  ],
                  "payload": {
                    "errors": {
                      "account_id": [
                        "INVALID_VALUE"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "write_accounts"
            ]
          }
        ]
      }
    },
    "/v2/block/{account_id}": {
      "get": {
        "summary": "Get account blocks",
        "description": "Retrieve a list of all prevented capabilities associated with an account",
        "operationId": "GetAccountBlocks",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "Tilia account ID",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicResponse"
                },
                "example": {
                  "status": "Failure",
                  "message": [
                    "input is invalid"
                  ],
                  "codes": [
                    "INPUT_ERROR"
                  ],
                  "payload": {
                    "errors": {
                      "account_id": [
                        "INVALID_VALUE"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "read_accounts"
            ]
          }
        ]
      }
    },
    "/v1/user-info/{account_id}": {
      "get": {
        "summary": "Get account profile",
        "description": "Get profile information for the specified account, including the account holder's email address and whether the account is blocked.",
        "operationId": "getUserInfo",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "The account ID to retrieve.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/userInfoResponse"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "search_accounts"
            ]
          }
        ]
      }
    },
    "/v1/user-info/search": {
      "get": {
        "summary": "Search by username",
        "description": "Get profile information for the specified username, including the account holder's email address and whether the account is blocked. Special characters like `+`s must be urlencoded. For example, `user+1@test.com` would be `user%2B1%40test%2Ecom`",
        "operationId": "searchUserInfo",
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "description": "The username to retrieve.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/userInfoResponse"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "search_accounts"
            ]
          }
        ]
      }
    },
    "/user-info/{account_id}/tos/tilia": {
      "get": {
        "summary": "Check for Terms of Service",
        "description": "Returns whether or not the account holder has signed the latest version of Tilia's Terms of Service.",
        "operationId": "VLatestGetTiliaTOS",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "The account ID to retrieve.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/isTiliaToSSigned"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "read_accounts"
            ]
          }
        ]
      },
      "post": {
        "summary": "Sign Tilia terms of service",
        "description": "[REQUIRES TILIA] Signs Tilia's Terms of Service for the given account. Reach out to Tilia to gain access to this API.",
        "operationId": "SignTiliaTOS",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "The account ID to retrieve.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "sign_tos"
            ]
          }
        ]
      },
      "delete": {
        "summary": "Unsign Tilia terms of service",
        "description": "[STAGING ONLY] Sets the Tilia's Terms of Service to false for the given account. This API is meant for integration testing purposes.",
        "operationId": "UnsignTiliaTOS",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "The account ID to unsign the ToS.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "unsign_tos"
            ]
          }
        ]
      }
    },
    "/v1/tos": {
      "get": {
        "summary": "Get the current Terms of Service",
        "description": "Returns the latest version of Tilia's Terms of Service.",
        "operationId": "VLatestGetTiliaTOSContent",
        "responses": {
          "200": {
            "$ref": "#/components/responses/tiliaToSContent"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": []
          }
        ]
      }
    },
    "/user-info/{account_id}": {
      "put": {
        "summary": "Update account profile",
        "description": "Update account information. This API allows for updating the contact details for an account, as well as adding an external payment platform User ID (e.g. Steam or Oculus).\n\n When a value for external payment platform is specified, a special 'Pay on Behalf of' (POBO) payment method will be created for the user, which can be used in subsequent transactions. If provided, full name and address details will be associated with the user's POBO payment method. When providing PII `state_provice` and `country_iso` must be sent in the request together; all other fields can be sent on their own. For more information on this type of interaction, refer to [External Payment Platforms](/guides/external-payment-platforms/).",
        "operationId": "UpdateAccountHandler",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "The account ID to retrieve.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            }
          }
        ],
        "requestBody": {
          "description": "Account resource",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/UpdateAccountResponse"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          }
        },
        "security": [
          {
            "tilia_auth": [
              "write_accounts"
            ]
          }
        ]
      }
    }
  },
  "x-webhooks": {
    "account_block": {
      "post": {
        "summary": "Account blocked / unblocked",
        "description": "Webhook event notification request.\n\n\n**`event_name` value:** `account-block-unblock-webhook`\n\n\n| This request is sent to registered webhook event handlers after |\n| :--- |\n|  {% openapiLink text=\"Block account capability\" link=\"accounts/openapi/other/blockaccount\" /%} completes successfully |\n|  {% openapiLink text=\"Unblock account capability\" link=\"accounts/openapi/other/unblockaccount\" /%} completes successfully |\n\n\nThe Request body described below is the `message` property in the event notification request data. For more information about event notification requests, visit [Webhooks](/webhooks/#develop-a-webhook-event-handler).",
        "operationId": "accountBlock",
        "requestBody": {
          "$ref": "#/components/requestBodies/AccountInfo"
        },
        "responses": {
          "2XX": {
            "description": "Return a 2XX status to indicate that the data was received successfully"
          }
        },
        "security": [
          {
            "tilia_auth": []
          }
        ]
      }
    },
    "register-account-completed": {
      "post": {
        "summary": "Register account completed",
        "description": "Webhook event notification request.\n\n\n**`event_name` value:** `register-account-completed`\n\n\n| This request is sent to registered webhook event handlers after |\n| :--- |\n| {% openapiLink text=\"Register account\" link=\"accounts/openapi/other/registeraccounthandlerfor\" /%} completes successfully |\n\n\nThe Request body described below is the `message` property in the event notification request data. For more information about event notification requests, visit [Webhooks](/webhooks/#develop-a-webhook-event-handler).",
        "operationId": "registerAccountCompleted",
        "requestBody": {
          "$ref": "#/components/requestBodies/RegisterAccountCompleted"
        },
        "responses": {
          "2XX": {
            "description": "Return a 2XX status to indicate that the data was received successfully"
          }
        },
        "security": [
          {
            "tilia_auth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "tilia_auth": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.staging.tilia-inc.com/token",
            "scopes": {}
          }
        }
      },
      "user_context": {
        "type": "oauth2",
        "x-internal": true,
        "description": "When making an API request that is either returning personalized customer data or acting on behalf of a customer, the customer's consent is required.",
        "flows": {
          "password": {
            "tokenUrl": "auth.tilia-inc.com/token",
            "scopes": {
              "add_email": "Grants permission to add email data",
              "change_email": "Grants permission to change email data",
              "change_info": "Grants permission to update user data",
              "change_password": "Grants permission to update a change a user password",
              "change_passwords": "Grants permission to change multiple user passwords",
              "delete_email": "Grants permission to delete email data",
              "internal": "Grants permission to internal systems",
              "manage_apps": "Grants permission to manage applications",
              "read_email": "Grants permission to read email data",
              "user_info": "Grants permission to read user data",
              "unblock_account": "Grants permission to unblock an account",
              "block_account": "Grants permission to block an account"
            }
          }
        }
      }
    },
    "schemas": {
      "RegisterAccountRequest": {
        "type": "object",
        "required": [
          "username",
          "email"
        ],
        "properties": {
          "username": {
            "type": "string",
            "description": "The desired username for the account.",
            "maxLength": 64
          },
          "email": {
            "description": "The user's email information. If no `external_platforms` value is assigned, this property requires a valid email address. If an `external_platforms` property is assigned, this property must not be present.",
            "type": "object",
            "x-go-name": "RegisterEmailRequest",
            "properties": {
              "address": {
                "type": "string",
                "format": "email",
                "description": "The user's email address that's attached to the account. This value must be a valid email address. Tilia uses this address to contact the user about their account. You must notify [Tilia](https://www.tilia.io/contact-sales/) if the user's email address changes.",
                "maxLength": 254
              },
              "requires_verification": {
                "type": "boolean"
              }
            }
          },
          "external_platforms": {
            "properties": {
              "steam": {
                "type": "object",
                "description": "The user's Steam account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Steam user ID.",
                    "example": "<steam_id>"
                  }
                }
              },
              "oculus": {
                "type": "object",
                "description": "The user's Oculus account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Oculus user ID.",
                    "example": "<oculus_id>"
                  }
                }
              },
              "apple": {
                "type": "object",
                "description": "The user's Apple account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Apple user_id",
                    "example": "<apple_id>"
                  }
                }
              },
              "google": {
                "type": "object",
                "description": "The user's Google account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Google user_id",
                    "example": "<google_id>"
                  }
                }
              },
              "microsoft": {
                "type": "object",
                "description": "The user's Microsoft account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Microsoft user_id",
                    "example": "<microsoft_id>"
                  }
                }
              },
              "nintendo": {
                "type": "object",
                "description": "The user's Nintendo account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Nintendo user_id",
                    "example": "<nintendo_id>"
                  }
                }
              },
              "sony": {
                "type": "object",
                "description": "The user's Sony account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user's Sony user_id",
                    "example": "<sony_id>"
                  }
                }
              }
            }
          },
          "full_name": {
            "description": "The full name of the person associated with the payment method.",
            "type": "string",
            "example": "Jessica Pley"
          },
          "street_address_1": {
            "description": "Address line 1 of the billing address (e.g., street, P.O. Box, or company name).",
            "type": "string",
            "example": "1 Alden Way"
          },
          "street_address_2": {
            "description": "Address line 2 of the billing address (e.g., unit, apartment, suite, or building).",
            "type": "string",
            "example": "BLDG 3"
          },
          "street_address_3": {
            "description": "Address line 3 of the billing address.",
            "type": "string",
            "example": "APT 6"
          },
          "city": {
            "description": "City of the billing address.",
            "type": "string",
            "example": "Atlanta"
          },
          "state_province": {
            "description": "State or Province of the billing address.",
            "type": "string",
            "example": "GA"
          },
          "country_iso": {
            "description": "2-letter [ISO 3166 Country code](https://www.iso.org/iso-3166-country-codes.html) of the billing address.",
            "type": "string",
            "example": "US"
          },
          "zip_postal_code": {
            "description": "Zip or postal code of the billing address.",
            "type": "string",
            "example": "30301"
          }
        },
        "x-go-package": "github.com/lindenlab/extraction-accounts/lib"
      },
      "BaseSuccess": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The status of the request, either `Success` or `Failure`.",
            "example": "Success"
          },
          "message": {
            "type": "array",
            "description": "An array of short, human-readable messages describing the failure. If the request was successful, this array will be empty.",
            "items": {
              "type": "string"
            },
            "example": null
          },
          "codes": {
            "type": "array",
            "description": "An array of failure reason codes. If the request was successful, this array will be empty.",
            "items": {
              "type": "string"
            },
            "example": null
          }
        }
      },
      "AccountId": {
        "type": "string",
        "maxLength": 36,
        "example": "acct_2TiDFXHVFMlAuyy7ovvz3YPKv9b"
      },
      "AccountIdCommon": {
        "allOf": [
          {
            "description": "Tilia account ID",
            "x-go-name": "AccountID"
          },
          {
            "$ref": "#/components/schemas/AccountId"
          }
        ]
      },
      "Email": {
        "description": "The user's email information.",
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "format": "email"
          },
          "email_id": {
            "type": "string",
            "maxLength": 36
          },
          "email_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_verified": {
            "type": "boolean"
          }
        }
      },
      "ExternalPlatforms": {
        "description": "The user's external platforms.",
        "type": "object",
        "properties": {
          "apple": {
            "type": "object",
            "description": "The user's Apple account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "user's apple user_id",
                "example": "<apple_id>"
              }
            }
          },
          "google": {
            "type": "object",
            "description": "The user's Google account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "user's google user_id",
                "example": "<google_id>"
              }
            }
          },
          "microsoft": {
            "type": "object",
            "description": "The user's Microsoft account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "user's microsoft user_id",
                "example": "<microsoft_id>"
              }
            }
          },
          "nintendo": {
            "type": "object",
            "description": "The user's Nintendo account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "user's nintendo user_id",
                "example": "<nintendo_id>"
              }
            }
          },
          "oculus": {
            "type": "object",
            "description": "The user's Oculus account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "The user's Oculus user ID",
                "example": "<oculus_id>"
              }
            }
          },
          "sony": {
            "type": "object",
            "description": "The user's Sony account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "user's sony user_id",
                "example": "<sony_id>"
              }
            }
          },
          "steam": {
            "type": "object",
            "description": "The user's Steam account information.",
            "properties": {
              "user_id": {
                "type": "string",
                "description": "The user's Steam user ID.",
                "example": "<steam_id>"
              }
            }
          }
        }
      },
      "RegisterAccountResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "email": {
            "$ref": "#/components/schemas/Email"
          },
          "external_platforms": {
            "$ref": "#/components/schemas/ExternalPlatforms"
          },
          "username": {
            "type": "string",
            "description": "The username for the account."
          },
          "full_name": {
            "description": "Full name of the person associated with the payment method.",
            "type": "string",
            "example": "Jessica Pley"
          },
          "street_address_1": {
            "description": "Address line 1 of the billing address (e.g., street, P.O. Box, or company name).",
            "type": "string",
            "example": "1 Alden Way"
          },
          "street_address_2": {
            "description": "Address line 2 of the billing address (e.g., unit, apartment, suite, or building).",
            "type": "string",
            "example": "BLDG 3"
          },
          "street_address_3": {
            "description": "Address line 3 of the billing address.",
            "type": "string",
            "example": "APT 6"
          },
          "city": {
            "description": "City of the billing address.",
            "type": "string",
            "example": "Atlanta"
          },
          "state_province": {
            "description": "State or Province of the billing address.",
            "type": "string",
            "example": "GA"
          },
          "country_iso": {
            "description": "2-letter [ISO 3166 Country code](https://www.iso.org/iso-3166-country-codes.html) of the billing address.",
            "type": "string",
            "example": "US"
          },
          "zip_postal_code": {
            "description": "Zip or postal code of the billing address.",
            "type": "string",
            "example": "30301"
          }
        },
        "x-go-package": "github.com/lindenlab/extraction-accounts/lib"
      },
      "BasicResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The status of the request, either `Success` or `Failure`.",
            "example": "Success",
            "x-go-name": "Status"
          },
          "message": {
            "type": "array",
            "description": "An array of short, human-readable messages describing the failure. If the request was successful, this array will be empty.",
            "items": {
              "type": "string"
            },
            "example": [],
            "x-go-name": "Message"
          },
          "codes": {
            "type": "array",
            "description": "An array of failure reason codes. If the request was successful, this array will be empty.",
            "items": {
              "type": "string"
            },
            "example": [],
            "x-go-name": "Codes"
          },
          "payload": {
            "type": "object",
            "properties": {},
            "description": "The response payload.",
            "x-go-name": "Payload"
          }
        }
      },
      "MergeAccountRequest": {
        "type": "object",
        "required": [
          "source_account_id",
          "destination_account_id"
        ],
        "properties": {
          "source_account_id": {
            "allOf": [
              {
                "description": "Tilia account ID"
              },
              {
                "$ref": "#/components/schemas/AccountId"
              }
            ]
          },
          "destination_account_id": {
            "allOf": [
              {
                "description": "Tilia account ID"
              },
              {
                "$ref": "#/components/schemas/AccountId"
              }
            ]
          }
        }
      },
      "BlockAccountRequest": {
        "type": "object",
        "required": [
          "account_id",
          "block_capability",
          "block_reason"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "block_capability": {
            "type": "string",
            "description": "Prevented account capability\n\n**Possible values**:\n\n- `login`: Prevents account from accessing the platform. This capability includes all other block capabilities",
            "example": "login"
          },
          "block_reason": {
            "type": "string",
            "description": "Reason for issuing the block\n\n**Possible values**:\n\n- `account_close`",
            "example": "account_close"
          },
          "note": {
            "type": "string",
            "description": "Custom note to attach to the account",
            "example": "Example note"
          }
        }
      },
      "BlockAccountV2Response": {
        "type": "object",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "block_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Unique Tilia ID for the block",
            "example": "blk_2FizFe7kSxtgUf4Trw0Jwei7pJv"
          },
          "capability": {
            "type": "string",
            "description": "Prevented account capability\n**Possible values**:\n| Value | Description |\n| :--- | :--- |\n| `login` | Prevents account from accessing the platform. This capability includes all other block capabilities |\n| `payouts` | _(Tilia only)_ Prevents account from requesting or executing a payout |\n| `transactions` | _(Tilia only)_ Prevents account from buying or selling items |",
            "example": "login"
          },
          "issuer": {
            "type": "string",
            "description": "Entity that issued the block\n\n**Possible values**:\n\n- `publisher`\n- `tilia`",
            "example": "publisher"
          },
          "reason": {
            "type": "string",
            "description": "Reason for issuing the block\n\n**Possible values**:\n\n- `account_close`\n- `compliance` _(Tilia only)_\n- `merge_account` _(Tilia only)_\n- `gdpr` _(Tilia only)_\n- `failed_kyc` _(Tilia only)_\n- `kyc_application_cancelled` _(Tilia only)_\n- `flagged_for_full_kyc` _(Tilia only)_",
            "example": "account_close"
          }
        }
      },
      "BlockAccountResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "blocks": {
            "type": "object",
            "description": "Active blocks enforced on the account",
            "properties": {
              "<block_capability>": {
                "$ref": "#/components/schemas/BlockAccountV2Response"
              }
            }
          }
        }
      },
      "Tag": {
        "type": "object",
        "properties": {
          "tag_id": {
            "type": "string",
            "description": "Unique identifier of the tag",
            "maxLength": 36,
            "x-go-name": "TagID",
            "example": "acttag_2Jy1MrLMsLIiD2AGWZg8v6gIN9U"
          },
          "account_id": {
            "allOf": [
              {
                "description": "Account ID this tag is associated with",
                "x-go-name": "AccountID"
              },
              {
                "$ref": "#/components/schemas/AccountId"
              }
            ]
          },
          "resource_id": {
            "type": "string",
            "description": "Resource ID tag is associated with",
            "x-go-name": "ResourceID",
            "example": "0e3037fd-9fbc-499b-b5e5-19948502cbdb"
          },
          "resource_type": {
            "type": "string",
            "description": "Resource Type describing what kind of resource the tag is associate with",
            "x-go-name": "ResourceType",
            "example": "lindenaccounts.accounts_v2.account_id"
          },
          "namespace": {
            "type": "string",
            "description": "Namespace of tag",
            "x-go-name": "Namespace",
            "example": "account_merge"
          },
          "tag": {
            "type": "string",
            "description": "Tag name",
            "x-go-name": "Tag",
            "example": "merged_to"
          },
          "status": {
            "type": "string",
            "description": "Status of the given tag",
            "x-go-name": "Status",
            "example": "ACTIVE"
          },
          "integrator": {
            "type": "string",
            "description": "Publisher associated with the tag",
            "x-go-name": "Integrator",
            "example": "acme"
          },
          "created": {
            "description": "ISO 8601 timestamp when the tag was created",
            "type": "string",
            "format": "date-time",
            "example": "2019-08-24T14:15:22Z"
          },
          "updated": {
            "description": "ISO 8601 timestamp when the tag was updated",
            "type": "string",
            "format": "date-time",
            "example": "2019-08-24T14:15:22Z"
          }
        }
      },
      "ProfileInfoResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "username": {
            "description": "The username associated with the account.",
            "type": "string",
            "x-go-name": "Username",
            "example": "david_gaimer@mail.io"
          },
          "email": {
            "description": "The email address associated with the account.",
            "type": "string",
            "x-go-name": "Email",
            "example": "david_gaimer@mail.io"
          },
          "is_blocked": {
            "description": "The account block status. True if the account is blocked. False if the account is not blocked.",
            "type": "boolean",
            "x-go-name": "IsBlocked",
            "example": false
          },
          "blocked_capabilities": {
            "description": "Lists the blocked capability, the issuer, block_reason, and status. Refer to Get account blocks documentation for details on this object. ",
            "type": "object"
          },
          "integrator": {
            "description": "Your company name.",
            "type": "string",
            "x-go-name": "Integrator",
            "example": "acme"
          },
          "tags": {
            "description": "An array of tags associated with this account.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            }
          },
          "created": {
            "description": "A timestamp when the account was created.",
            "type": "string",
            "format": "date-time",
            "x-go-name": "Created"
          }
        },
        "x-go-package": "github.com/lindenlab/extraction-utils-go/models"
      },
      "UpdateAccountRequest": {
        "type": "object",
        "properties": {
          "email": {
            "description": "The email information for the user.",
            "type": "object",
            "x-go-name": "UpdateEmailRequest",
            "properties": {
              "address": {
                "type": "string",
                "format": "email",
                "description": "User email attached to the account. Must be a valid email address. Tilia uses this address when contacting the user about their account; you are required to notify [Tilia](https://www.tilia.io/contact-sales/) of any changes to the user's email address.",
                "maxLength": 254
              },
              "requires_verification": {
                "type": "boolean"
              }
            }
          },
          "external_platforms": {
            "properties": {
              "steam": {
                "type": "object",
                "description": "The user's Steam account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<steam_id>"
                  }
                }
              },
              "oculus": {
                "type": "object",
                "description": "The user's Oculus account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<oculus_id>"
                  }
                }
              },
              "apple": {
                "type": "object",
                "description": "The user's Apple account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<apple_id>"
                  }
                }
              },
              "google": {
                "type": "object",
                "description": "The user's Google account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<google_id>"
                  }
                }
              },
              "microsoft": {
                "type": "object",
                "description": "The user's Microsoft account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<microsoft_id>"
                  }
                }
              },
              "nintendo": {
                "type": "object",
                "description": "The user's Nintendo account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<nintendo_id>"
                  }
                }
              },
              "sony": {
                "type": "object",
                "description": "The user's Sony account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<sony_id>"
                  }
                }
              }
            }
          },
          "full_name": {
            "description": "Full name of the person associated with the payment method.",
            "type": "string",
            "example": "Jessica Pley"
          },
          "street_address_1": {
            "description": "Address line 1 of the billing address (e.g., street, P.O. Box, or company name).",
            "type": "string",
            "example": "1 Alden Way"
          },
          "street_address_2": {
            "description": "Address line 2 of the billing address (e.g., unit, apartment, suite, or building).",
            "type": "string",
            "example": "BLDG 13"
          },
          "street_address_3": {
            "description": "Address line 3 of the billing address.",
            "type": "string",
            "example": "APT 6"
          },
          "city": {
            "description": "City of the billing address.",
            "type": "string",
            "example": "Atlanta"
          },
          "state_province": {
            "description": "State or Province of the billing address.",
            "type": "string",
            "example": "GA"
          },
          "country_iso": {
            "description": "2-letter [ISO 3166 Country code](https://www.iso.org/iso-3166-country-codes.html) of the billing address.",
            "type": "string",
            "example": "US"
          },
          "zip_postal_code": {
            "description": "Zip or postal code of the billing address.",
            "type": "string",
            "example": "30301"
          }
        },
        "x-go-package": "github.com/lindenlab/extraction-accounts/lib"
      },
      "UpdateAccountResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountIdCommon"
          },
          "email": {
            "description": "The email information after updating.",
            "type": "object",
            "x-go-name": "UpdateEmailResponse",
            "properties": {
              "email_id": {
                "type": "string",
                "maxLength": 36
              },
              "address": {
                "type": "string",
                "format": "email"
              },
              "email_types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "is_verified": {
                "type": "boolean"
              }
            }
          },
          "external_platforms": {
            "properties": {
              "steam": {
                "description": "The user's Steam account information.",
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<steam_id>"
                  }
                }
              },
              "oculus": {
                "type": "object",
                "description": "The user's Oculus account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<oculus_id>"
                  }
                }
              },
              "apple": {
                "type": "object",
                "description": "The user's Apple account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<apple_id>"
                  }
                }
              },
              "google": {
                "type": "object",
                "description": "The user's Google account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<google_id>"
                  }
                }
              },
              "microsoft": {
                "type": "object",
                "description": "The user's Microsoft account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<microsoft_id>"
                  }
                }
              },
              "nintendo": {
                "type": "object",
                "description": "The user's Nintendo account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<nintendo_id>"
                  }
                }
              },
              "sony": {
                "type": "object",
                "description": "The user's Sony account information.",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "example": "<sony_id>"
                  }
                }
              }
            }
          },
          "full_name": {
            "description": "Full name of the person associated with the payment method.",
            "type": "string",
            "example": "Jessica Pley"
          },
          "street_address_1": {
            "description": "Address line 1 of the billing address (e.g., street, P.O. Box, or company name).",
            "type": "string",
            "example": "1 Alden Way"
          },
          "street_address_2": {
            "description": "Address line 2 of the billing address (e.g., unit, apartment, suite, or building).",
            "type": "string",
            "example": "BLDG 13"
          },
          "street_address_3": {
            "description": "Address line 3 of the billing address.",
            "type": "string",
            "example": "APT 6"
          },
          "city": {
            "description": "City of the billing address.",
            "type": "string",
            "example": "Atlanta"
          },
          "state_province": {
            "description": "State or Province of the billing address.",
            "type": "string",
            "example": "GA"
          },
          "country_iso": {
            "description": "2-letter [ISO 3166 Country code](https://www.iso.org/iso-3166-country-codes.html) of the billing address.",
            "type": "string",
            "example": "US"
          },
          "zip_postal_code": {
            "description": "Zip or postal code of the billing address.",
            "type": "string",
            "example": "30301"
          }
        },
        "x-go-package": "github.com/lindenlab/extraction-accounts/lib"
      },
      "BlockStatus": {
        "type": "boolean",
        "description": "The account block status. True if the account is blocked. False if the account is not blocked."
      },
      "BlockResponse": {
        "type": "object",
        "properties": {
          "is_blocked": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockStatus"
              },
              {
                "example": true
              }
            ]
          }
        }
      },
      "UnblockResponse": {
        "type": "object",
        "properties": {
          "is_blocked": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockStatus"
              },
              {
                "example": false
              }
            ]
          }
        }
      }
    },
    "responses": {
      "RegisterAccountResponse": {
        "description": "Account profile was registered successfully.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseSuccess"
                },
                {
                  "type": "object"
                },
                {
                  "properties": {
                    "payload": {
                      "$ref": "#/components/schemas/RegisterAccountResponse"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "unauthorized": {
        "description": "Unauthorized access."
      },
      "notFound": {
        "description": "Resource not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BasicResponse"
            },
            "example": {
              "status": "Failure",
              "message": [
                "failed to get account"
              ],
              "codes": [
                "ACCOUNT_GET_ERROR"
              ],
              "payload": null
            }
          }
        }
      },
      "registrationConflict": {
        "description": "Resource already exists.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BasicResponse"
            },
            "example": {
              "status": "Failure",
              "message": [],
              "codes": [],
              "payload": {
                "account_id": "acct_2TiDFXHVFMlAuyy7ovvz3YPKv9b"
              }
            }
          }
        }
      },
      "serverError": {
        "description": "Service unavailable or server error."
      },
      "userInfoResponse": {
        "description": "Account profile was retrieved successfully.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseSuccess"
                },
                {
                  "type": "object"
                },
                {
                  "properties": {
                    "payload": {
                      "$ref": "#/components/schemas/ProfileInfoResponse"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "isTiliaToSSigned": {
        "description": "Indicates if Tilia ToS is signed.",
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "signed_tos": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "success": {
        "description": "The request was successful.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BasicResponse"
            },
            "example": {
              "status": "Success",
              "message": [],
              "codes": [],
              "payload": null
            }
          }
        }
      },
      "tiliaToSContent": {
        "description": "The Tilia Terms of Service.",
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "tos_created": {
                  "type": "string",
                  "example": "2019-08-01"
                },
                "tos_content": {
                  "type": "string",
                  "example": "These Terms of Service (Terms) are a legal agreement between you and Tilia Inc."
                }
              }
            }
          }
        }
      },
      "UpdateAccountResponse": {
        "description": "Account profile was updated successfully.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseSuccess"
                },
                {
                  "type": "object"
                },
                {
                  "properties": {
                    "payload": {
                      "$ref": "#/components/schemas/UpdateAccountResponse"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    },
    "requestBodies": {
      "AccountInfo": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "account_id": {
                  "$ref": "#/components/schemas/AccountIdCommon"
                },
                "blocks": {
                  "$ref": "#/components/schemas/BlockAccountV2Response"
                },
                "is_blocked": {
                  "$ref": "#/components/schemas/BlockStatus"
                }
              }
            }
          }
        }
      },
      "RegisterAccountCompleted": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "account_id": {
                  "$ref": "#/components/schemas/AccountIdCommon"
                },
                "email": {
                  "$ref": "#/components/schemas/Email"
                },
                "external_platforms": {
                  "$ref": "#/components/schemas/ExternalPlatforms"
                },
                "username": {
                  "type": "string",
                  "description": "The username for the account."
                }
              }
            }
          }
        }
      }
    }
  }
}