> ## 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.

# Shifts.added webhook

> The `shifts.added` webhook is sent only when an account's data is [refreshed](/overview/ongoing-refresh) (does not include initial data retrieval) and a new shift is retrieved.


Sent when shifts are added, updated, or removed.

If you need to access to shift data as soon as it is available:

* The `shifts.partially_synced` webhook is sent when shifts going back a specified number of days prior (starting from the date [when the account was added](/api-reference/accounts-webhooks/added)) have been retrieved during initial data retrieval for a newly connected account.
* The `shifts.fully_synced` webhook is sent when all shifts have been retrieved during initial data retrieval for a newly connected account.

Because some accounts can contain hundreds of shifts, we recommend subscribing to the `shifts.partially_synced` webhook when especially time-sensitive. The `shifts.fully_synced` webhook will only be sent when all shift data has been retrieved, which may take up to several hours in these cases.


## OpenAPI

````yaml openAPI/shifts-webhooks-added.yaml post /v2/webhooks
openapi: 3.0.0
info:
  title: Shifts Webhooks
  version: '1.0'
  description: >
    Sent when shifts are added, updated, or removed.


    If you need to access to shift data as soon as it is available:


    *   The `shifts.partially_synced` webhook is sent when shifts going back a
    specified number of days prior (starting from the date [when the account was
    added](/api-reference/accounts-webhooks/added)) have been retrieved during
    initial data retrieval for a newly connected account.

    *   The `shifts.fully_synced` webhook is sent when all shifts have been
    retrieved during initial data retrieval for a newly connected account.


    Because some accounts can contain hundreds of shifts, we recommend
    subscribing to the `shifts.partially_synced` webhook when especially
    time-sensitive. The `shifts.fully_synced` webhook will only be sent when all
    shift data has been retrieved, which may take up to several hours in these
    cases.
servers: []
security:
  - basicAuth: []
paths:
  /v2/webhooks:
    post:
      summary: Example subscription
      description: >
        The `shifts.added` webhook is sent only when an account's data is
        [refreshed](/overview/ongoing-refresh) (does not include initial data
        retrieval) and a new shift is retrieved.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShiftsAddedRequest'
            examples:
              shifts_added_subscription:
                summary: shifts.added subscription
                value:
                  events:
                    - shifts.added
                  name: name-for-the-webhook-subscription
                  url: https://your-webhook-backend.com
                  secret: optional-secret
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShiftsAddedResponse'
              examples:
                shifts_added:
                  summary: Shifts added
                  value:
                    event: shifts.added
                    name: name-for-the-webhook-subscription
                    data:
                      account: 0187c66e-e7e5-811c-b006-2232f00f426a
                      user: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
                      available_from: '2016-04-16T05:32:41Z'
                      available_to: '2023-03-03T00:00:00Z'
                      available_count: 412
                      added_count: 6
                      added_from: '2023-03-02T00:00:00Z'
                      added_to: '2023-03-03T00:00:00Z'
components:
  schemas:
    ShiftsAddedRequest:
      type: object
      properties:
        events:
          type: array
          items:
            type: string
          description: '`shifts.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](/api-guide/webhooks#verifying-webhooks).
      required:
        - events
        - name
        - url
      example:
        events:
          - shifts.added
        name: name-for-the-webhook-subscription
        url: https://your-webhook-backend.com
        secret: optional-secret
    ShiftsAddedResponse:
      type: object
      properties:
        event:
          type: string
          description: '`shifts.added`'
        name:
          type: string
          description: Name used for the webhook subscription.
        data:
          type: object
          properties:
            account:
              type: string
              format: uuid
              description: ID of the account.
            user:
              type: string
              format: uuid
              description: ID of the user.
            available_from:
              type: string
              format: date-time
              description: >-
                Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601))
                of the earliest available shift.
            available_to:
              type: string
              format: date-time
              description: >-
                Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601))
                of the most recent shift.
            available_count:
              type: integer
              description: Number of shifts currently available for this account.
            added_count:
              type: integer
              description: Number of shifts retrieved during a data refresh.
            added_from:
              type: string
              format: date-time
              description: >-
                Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601))
                of the earliest shift retrieved during a [data
                refresh](/overview/ongoing-refresh).
            added_to:
              type: string
              format: date-time
              description: >-
                Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601))
                of the most recent shift retrieved during a data refresh.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Username = api_key_id, Password = api_key_secret

````