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

# Sleep (async)

> Creates an async result that will automatically resolve after a specified delay or at a future time.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/samplehc/openapi.documented.yml post /api/v2/async-results/sleep
openapi: 3.0.3
info:
  title: Sample Healthcare API
  description: API for Sample Healthcare
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/async-results/sleep:
    post:
      tags:
        - Async-result
      summary: Sleep (async)
      description: >-
        Creates an async result that will automatically resolve after a
        specified delay or at a future time.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    delay:
                      type: number
                      exclusiveMinimum: true
                      minimum: 0
                      description: >-
                        The number of milliseconds to wait before completing the
                        async result.
                  required:
                    - delay
                  additionalProperties: false
                - type: object
                  properties:
                    resumeAt:
                      type: string
                      description: >-
                        An ISO-8601 string specifying when the async result
                        should be completed.
                  required:
                    - resumeAt
                  additionalProperties: false
      responses:
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  asyncResultId:
                    type: string
                    description: The ID to track the asynchronous sleep operation.
                required:
                  - asyncResultId
                additionalProperties: false
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from samplehc import SampleHealthcare

            client = SampleHealthcare(
                api_key=os.environ.get("SAMPLEHC_API_KEY"),  # This is the default and can be omitted
            )
            response = client.v2.async_results.sleep(
                delay=1,
            )
            print(response.async_result_id)

````