Skip to content

    v2_patch_reports

    Create a share link for a brand's report month. A separate action revokes an existing share link.

    See the REST reference for PATCH /v2/reports.

    Signature

    v2_patch_reports(
        body: Mapping[str, Any],
        *,
        idempotency_key: str | None = None,
    ) -> Response[Any]

    Parameters

    body
    Dictionary for the selected operation. See the REST reference for its required fields.
    idempotency_key
    Value for Idempotency-Key. For requests that require this header, the SDK generates a UUID if you omit it. Send the original value if your application repeats the same write.

    Return value

    For share_link_create, response.data contains share_path, expires_at and share_id. Keep share_id to revoke access later.

    Errors

    • AeoApiError includes the HTTP status, error code and request ID. An invalid key raises UnauthenticatedError. Check the key’s scopes if you receive ForbiddenError.
    • Invalid arguments can raise ValueError or TypeError before the SDK sends a request.
    • AeoTransportError means the request could not reach the API after any allowed retries, or the response could not be read as JSON.

    Python example

    import os
    from aeo_sdk import AeoClient
    
    with AeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
        response = client.v2_patch_reports(
            body={
                'brand_id': '00000000-0000-4000-8000-000000000001',
                'month': '2026-11',
                'section': 'share_link_create',
            },
        )
        print(response.body)

    Async example

    import asyncio
    import os
    from aeo_sdk import AsyncAeoClient
    
    async def main():
        async with AsyncAeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
            response = await client.v2_patch_reports(
                body={
                    'brand_id': '00000000-0000-4000-8000-000000000001',
                    'month': '2026-11',
                    'section': 'share_link_create',
                },
            )
            print(response.body)
    
    asyncio.run(main())

    Requests by feature

    Reports and sharing

    See Python client setup for the environment variables, response properties and retry settings.