> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argyle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounts.added webhook

> Sent when account connection events occur.

The `accounts.added` webhook is sent when a user submits login credentials through Link. A new account object is created after the login credentials have undergone authentication, regardless of whether the connection was successful (`accounts.connected` is sent) or unsuccessful (`accounts.failed` is sent).


## OpenAPI

````yaml openAPI/account-webhooks-added.yaml post /v2/webhooks
openapi: 3.0.0
info:
  title: Accounts Webhooks API
  version: 1.0.0
  description: Sent when account connection events occur.
servers: []
security:
  - basicAuth: []
paths:
  /v2/webhooks:
    post:
      summary: Example subscription
      description: Sent when account connection events occur.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountsAddedRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountsAddedWebhook'
components:
  schemas:
    AccountsAddedRequest:
      type: object
      properties:
        events:
          type: array
          items:
            type: string
            enum:
              - accounts.added
          description: |
            Array containing the `accounts.added` event.
            Value: `accounts.added`
        name:
          type: string
          description: Your name for the webhook subscription.
        url:
          type: string
          description: >-
            Where you want to receive webhook delivery. This can be either a
            backend URL that you manage, or a URL provided by a webhook
            management service. Argyle handles URL encoding for webhook URLs.
            Send the URL in its normal, unencoded form.
        secret:
          type: string
          description: Optional secret used to verify webhooks.
        config:
          type: object
          properties:
            include_resource:
              type: boolean
              description: >
                `"include_resource": true` will return the [account
                object](/api-reference/accounts#object) in the response within a
                `resource` object.
      required:
        - events
        - name
        - url
      example:
        events:
          - accounts.added
        name: name-for-the-webhook-subscription
        url: https://your-webhook-backend.com
        secret: optional-secret
        config:
          include_resource: true
    AccountsAddedWebhook:
      type: object
      properties:
        event:
          type: string
          description: The event that triggered the webhook.
          example: accounts.added
        name:
          type: string
          description: Name used for the webhook subscription.
          example: name-for-the-webhook-subscription
        data:
          type: object
          properties:
            account:
              type: string
              format: uuid
              description: ID of the account.
              example: 0187c66e-e7e5-811c-b006-2232f00f426a
            user:
              type: string
              format: uuid
              description: ID of the user.
              example: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
            resource:
              type: object
              description: Optional account object.
              properties:
                id:
                  type: string
                  format: uuid
                  description: ID of the account.
                  example: 0187c66e-e7e5-811c-b006-2232f00f426a
                user:
                  type: string
                  format: uuid
                  description: ID of the user.
                  example: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
                employers:
                  type: array
                  items:
                    type: string
                  description: Employer names connected through this account.
                  example:
                    - Whole Goods
                item:
                  type: string
                  description: >-
                    ID of the Item in Link through which the account was
                    connected.
                  example: item_123456789
                source:
                  type: string
                  description: Name of the payroll source.
                  example: thepayrollcompany
                created_at:
                  type: string
                  format: date-time
                  description: >-
                    Timestamp ([ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)) when the
                    account object was created.
                  example: '2023-01-30T12:53:22.561Z'
                updated_at:
                  type: string
                  format: date-time
                  description: >-
                    Timestamp ([ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)) when the
                    account object was last updated.
                  example: '2023-01-30T12:53:23.123Z'
                scanned_at:
                  type: string
                  format: date-time
                  description: >-
                    Timestamp ([ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)) when this
                    account was last scanned for new data.
                  example: '1970-01-01T00:00:00Z'
                connection:
                  type: object
                  properties:
                    status:
                      type: string
                      description: Current account connection status.
                      example: connecting
                    error_code:
                      type: string
                      nullable: true
                      description: Account connection error code, if present.
                      example: null
                    error_message:
                      type: string
                      nullable: true
                      description: Account connection error message, if present.
                      example: null
                    updated_at:
                      type: string
                      format: date-time
                      description: >-
                        Timestamp ([ISO
                        8601](https://en.wikipedia.org/wiki/ISO_8601)) when
                        connection status was last updated.
                      example: '2023-01-30T12:53:23.123Z'
                direct_deposit_switch:
                  type: object
                  properties:
                    status:
                      type: string
                      description: Current direct deposit switch status.
                      example: idle
                    error_code:
                      type: string
                      nullable: true
                      description: Direct deposit switch error code, if present.
                      example: null
                    error_message:
                      type: string
                      nullable: true
                      description: Direct deposit switch error message, if present.
                      example: null
                    updated_at:
                      type: string
                      format: date-time
                      description: >-
                        Timestamp ([ISO
                        8601](https://en.wikipedia.org/wiki/ISO_8601)) when
                        direct deposit switch status was last updated.
                      example: '2023-01-30T12:53:23.123Z'
                availability:
                  type: object
                  description: Current data availability statuses for this account.
                  properties:
                    gigs:
                      type: object
                      nullable: true
                      example: null
                    paystubs:
                      type: object
                      nullable: true
                      example: null
                    payroll_documents:
                      type: object
                      nullable: true
                      example: null
                    identities:
                      type: object
                      nullable: true
                      example: null
                    ratings:
                      type: object
                      nullable: true
                      example: null
                    vehicles:
                      type: object
                      nullable: true
                      example: null
                    deposit_destinations:
                      type: object
                      nullable: true
                      example: null
                    user_forms:
                      type: object
                      nullable: true
                      example: null
                ongoing_refresh:
                  type: object
                  properties:
                    status:
                      type: string
                      description: Ongoing refresh status for this account.
                      example: idle
      example:
        event: accounts.added
        name: name-for-the-webhook-subscription
        data:
          account: 0187c66e-e7e5-811c-b006-2232f00f426a
          user: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
          resource:
            id: 0187c66e-e7e5-811c-b006-2232f00f426a
            user: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
            employers:
              - Whole Goods
            item: item_123456789
            source: thepayrollcompany
            created_at: '2023-01-30T12:53:22.561Z'
            updated_at: '2023-01-30T12:53:23.123Z'
            scanned_at: '1970-01-01T00:00:00Z'
            connection:
              status: connecting
              error_code: null
              error_message: null
              updated_at: '2023-01-30T12:53:23.123Z'
            direct_deposit_switch:
              status: idle
              error_code: null
              error_message: null
              updated_at: '2023-01-30T12:53:23.123Z'
            availability:
              gigs: null
              paystubs: null
              payroll_documents: null
              identities: null
              ratings: null
              vehicles: null
              deposit_destinations: null
              user_forms: null
            ongoing_refresh:
              status: idle
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Username = api_key_id, Password = api_key_secret

````