Skip to content

    v2_get_prompts

    Read the prompt library, or select a view for a prompt's history, coverage, suggestions, or topic assignments.

    See the REST reference for GET /v2/prompts.

    Signature

    v2_get_prompts(
        *,
        audience_id: str | None = None,
        brand_id: str | None = None,
        category_id: str | None = None,
        country: str | None = None,
        cursor: str | None = None,
        format: Literal['json', 'csv'] | None = None,
        group_id: str | None = None,
        id: str | None = None,
        include_archived: bool | None = None,
        intent: Literal['discovery', 'recommendation', 'evaluation', 'pricing', 'comparison', 'alternatives', 'use_case', 'transaction', 'local', 'troubleshooting', 'trust', 'informational'] | None = None,
        language: str | None = None,
        limit: int | None = None,
        mode: Literal['unbranded', 'branded', 'all'] | None = None,
        offset: int | None = None,
        product_id: str | None = None,
        prompt_id: str | None = None,
        q: str | None = None,
        query: str | None = None,
        scope: Literal['shared', 'private'] | None = None,
        service_id: str | None = None,
        source: Literal['all', 'crm', 'profile'] | None = None,
        stage: Literal['awareness', 'consideration', 'evaluation', 'decision', 'retention'] | None = None,
        status: Literal['active', 'archived'] | None = None,
        tag: str | None = None,
        view: Literal['library', 'coverage', 'export', 'suggestions', 'metadata', 'history', 'topic_suggestions', 'sets', 'topics'] | None = None,
        website: str | None = None,
    ) -> Response[Any]

    Parameters

    audience_id
    Identifier for the audience.
    brand_id
    Identifier for the brand.
    category_id
    Identifier for the category.
    country
    Filter results by country.
    cursor
    Pass the previous page's next cursor with the original filters.
    format
    Requested output format for the selected view.
    group_id
    Identifier for the group.
    id
    Fetch a specific record by its identifier.
    include_archived
    Include archived records when listing results.
    intent
    Filter results by intent.
    language
    Filter results by language.
    limit
    Maximum number of records per page. Each view sets its own limit.
    mode
    Select the collection mode used to obtain the answers.
    offset
    Number of records to skip. For draft lists, send the returned next_offset.
    product_id
    Identifier for the product.
    prompt_id
    Identifier for the prompt.
    q
    Text to search for in this list.
    query
    Search text for the selected view.
    scope
    Choose the prompt scope to include.
    service_id
    Identifier for the service.
    source
    Filter results by source.
    stage
    Filter by the buyer stage assigned to a prompt.
    status
    Only return records with this status.
    tag
    Filter results by tag.
    view
    Choose the result to read. See the linked REST reference for the fields and access each view requires.
    website
    Website for the selected brand or connection.

    Return value

    The library view returns a list in response.data and an optional next cursor. For a CSV export, read the text in response.body.

    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.
    • PreconditionFailedError means the revision has changed. Read the current record before editing it again.
    • For a conflict, read the error message before repeating the write. Check the saved record for a competing edit or a repeated request.

    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_get_prompts(
            limit=10,
            view='library',
        )
        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_get_prompts(
                limit=10,
                view='library',
            )
            print(response.body)
    
    asyncio.run(main())

    Requests by feature

    Prompts and topics

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