# Create an account group

Creates an account group.

Endpoint: POST /account_groups
Version: 1.109.1
Security: oauth-client-credentials

## Header parameters:

  - `upvest-client-id` (string, required)
    Tenant Client ID
    Example: "363f3305-7ab0-4e82-a158-f9d382ad08b6"

  - `Authorization` (string, required)
    Bearer (access) token from the OAuth flow with correct scopes.
https://datatracker.ietf.org/doc/html/rfc6750
    Example: "Bearer c2VjcmV0Cg=="

  - `signature` (string, required)
    https://tools.ietf.org/id/draft-ietf-httpbis-message-signatures-01.html#name-the-signature-http-header

  - `signature-input` (string, required)
    https://tools.ietf.org/id/draft-ietf-httpbis-message-signatures-01.html#name-the-signature-input-http-he

  - `idempotency-key` (string, required)
    A UUID to be used as an idempotency key.  This prevents a duplicate request from being replayed.
https://docs.upvest.co/documentation/concepts/api_concepts/idempotency
    Example: "ccb07f42-4104-44ad-8e1f-c660bb7b269c"

  - `upvest-api-version` (string)
    Upvest API version (Note: Do not include quotation marks)
    Enum: "1"

## Request fields (application/json):

  - `body` (object) — one of:
    - Account Group - Create - User Request:
      - `user_id` (string, required)
        User unique identifier.
      - `type` (string, required)
        Account group type.
* PERSONAL - Account group of a person holding assets on their own behalf.
* LEGAL_ENTITY - Account group of a legal entity holding assets on behalf of their users.
* FRENCH_PEA - Account group of a french resident holding assets in Plan d'Epargne en Actions.
* ISA - Account group of a UK resident holding assets in an individual savings account.
* CHILD - Account group of a child user holding assets in a child account.
        Enum: "PERSONAL", "LEGAL_ENTITY", "FRENCH_PEA", "ISA", "CHILD"
      - `securities_account_number` (string)
        Account unique identifier.
    - Account Group - Create - Business Request:
      - `business_id` (string, required)
        Unique identifier for the business.
      - `type` (string, required)
        Account group type.
* BUSINESS - Account group of a business holding assets.
        Enum: "BUSINESS"
      - `securities_account_number` (string)
        Account unique identifier.

## Response 200 fields (application/json):

  - `body` (object) — one of:
    - Account Group:
      - `id` (string, required)
        Account group unique identifier.
      - `created_at` (string, required)
        Date and time when the resource was created. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
      - `updated_at` (string, required)
        Date and time when the resource was last updated. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
      - `users` (array, required)
      - `users.id` (string)
        User unique identifier.
      - `users.type` (string)
        Relation type
* OWNER - Account Group Owner
* CHILD - Child Account Group Owner
* GUARDIAN - Child Account Group Guardian
        Enum: "OWNER", "CHILD", "GUARDIAN"
      - `status` (string, required)
        Status of the account group
* PENDING_APPROVAL - Account group approval is pending - the account group is visible through our API but cannot be acted on.
* ACTIVE - Account group is active - full functionality of the Investment API is accessible.
* CLOSING - Account group is closing.
* CLOSED - Account group is closed.
* LOCKED - Account group is locked for all actions.
        Enum: "PENDING_APPROVAL", "ACTIVE", "CLOSING", "CLOSED", "LOCKED"
      - `type` (string, required)
        Account group type.
* PERSONAL - Account group of a person holding assets on their own behalf.
* LEGAL_ENTITY - Account group of a legal entity holding assets on behalf of their users.
* FRENCH_PEA - Account group of a french resident holding assets in Plan d'Epargne en Actions.
* ISA - Account group of a UK resident holding assets in an individual savings account.
* CHILD - Account group of a child user holding assets in a child account.
        Enum: same as `type` in "Account Group - Create - User Request" (5 values)
      - `securities_account_number` (string, required)
        Account unique identifier.
    - Business Account Group:
      - `id` (string, required)
        Account group unique identifier.
      - `created_at` (string, required)
        Date and time when the resource was created. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
      - `updated_at` (string, required)
        Date and time when the resource was last updated. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
      - `business_id` (string, required)
        Unique identifier for the business.
      - `status` (string, required)
        Status of the account group
* PENDING_APPROVAL - Account group approval is pending - the account group is visible through our API but cannot be acted on.
* ACTIVE - Account group is active - full functionality of the Investment API is accessible.
* CLOSING - Account group is closing.
* CLOSED - Account group is closed.
* LOCKED - Account group is locked for all actions.
        Enum: same as `status` in "Account Group" (5 values)
      - `type` (string, required)
        Account group type.
* BUSINESS - Account group of a business holding assets.
        Enum: same as `type` in "Account Group - Create - Business Request" (1 values)
      - `securities_account_number` (string, required)
        Account unique identifier.

## Response 400 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 401 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 403 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 404 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 406 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 429 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 500 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 503 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.

## Response 504 fields (application/problem+json):

  - `type` (string, required)
    URL to a document describing the error condition.

  - `status` (integer, required)
    Transmission of the HTTP status code so that all information can be found in one place, but also to correct changes in the status code due to the use of proxy servers.

  - `title` (string)
    A short, human-readable title for the general error type; the title should not change for given types.

  - `detail` (string)
    A human-readable description of the specific error.

  - `instance` (string)
    This optional key may be present, with a unique URI for the specific error; this will often point to an error log for that specific response.

  - `request_id` (string)
    Correlation ID for the original request.


